MCPcopy Index your code
hub / github.com/OpenCoven/coven

github.com/OpenCoven/coven @v0.0.53

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.53 ↗ · + Follow
2,665 symbols 9,472 edges 116 files 216 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

OpenCoven logo

Coven

Local harness substrate for project-scoped agent sessions

Run Codex, Claude Code, and future coding harnesses inside explicit local project boundaries. Launch, observe, attach, and coordinate agent work through one neutral runtime substrate.

MIT License Platform npm Built with Rust

🌐 Ecosystem 💬 Community 🛠️ Development
Website Discord GitHub Issues
Documentation X (\@OpenCvn) Public Roadmap
Submit Feedback Contributing

⚠️ Early MVP — Coven is a local-first runtime in active development. It is usable by adventurous developers on macOS and Linux. The npm package is live. Expect rough edges.

External PRs are open — Start from an issue for larger changes, keep PRs scoped, and include the readiness packet requested by the PR template.


Table of Contents


What is Coven?

Coven is the local harness substrate for the OpenCoven ecosystem. It gives coding-agent CLIs like Codex and Claude Code a shared room where project work can happen visibly and safely.

One project. Any harness. Visible work.

Coven doesn't replace your coding agent, your UI, or other clients. It acts as a neutral runtime layer:

  • You choose the harness — Codex, Claude Code, or future adapters.
  • Coven owns the session — project-scoped boundaries, PTY execution, event logging, SQLite persistence.
  • Clients present the work — CastCodes, the CLI/TUI, comux, or your own integration over the local socket API.

The Rust daemon is the authority boundary. All clients — including the CLI itself — are convenience layers. Security decisions flow inward to the daemon, never outward to clients.


Why Coven?

Without Coven With Coven
Run codex directly; no persistent session history Every run creates a session record with metadata and events
No project boundary enforcement Agent is locked to an explicit project root; cannot escape
Lose track of agent work when the terminal closes Sessions persist across daemon restarts via SQLite
Manually juggle multiple harness CLIs One unified coven run entry point for all harnesses
No API for clients to consume agent sessions Versioned coven.daemon.v1 socket API for all clients
No standard way to observe or replay past work coven sessions browser with Rejoin, View Log, and Archive

Features

  • 🏠 Project-root boundaries — Every launch is tied to an explicit repository or project root. The daemon rejects working directories that escape the declared boundary.
  • 🔌 Harness-neutral runtime — v0 focuses on Codex and Claude Code with a clean adapter path for future harnesses (Hermes, Aider, Gemini, and user-defined CLIs).
  • 🖥️ Interactive session browser — Live and completed work can be selected, rejoined, viewed, archived, restored, or sacrificed without memorizing IDs.
  • 📡 Attachable PTY sessions — Live sessions can be replayed or followed from explicit CLI verbs.
  • 🔌 Local daemon API — CastCodes, comux, and the OpenClaw plugin coordinate through one versioned socket contract (coven.daemon.v1).
  • 🗄️ SQLite-backed history — Session metadata and event logs survive daemon restarts.
  • 🦀 Rust authority layer — Launch, cwd, input, kill, and path-sensitive requests are revalidated in Rust. Clients are never the trust boundary.
  • 🔒 External OpenClaw bridge@opencoven/coven is an opt-in plugin; OpenClaw core does not include Coven code.
  • 📦 @opencoven namespace — CLI wrapper packages live under @opencoven/*; the user-facing command is always coven.
  • 🩺 System diagnosticscoven pc (macOS-first) surfaces CPU, memory, disk, and process health without launching a harness.

Requirements

Requirement Notes
Rust stable toolchain Required only when building from source
Git Required
macOS, Linux, or Windows x64 Native npm packages are published for all three platforms
Node.js 18+ Required only for npm wrapper or package/plugin development
At least one harness CLI Codex and/or Claude Code (see below)

Installing harness CLIs

Run coven doctor first — it prints specific install hints for any missing harness.

Codex (OpenAI):

npm install -g @openai/codex
# or: brew install --cask codex
codex login

Claude Code (Anthropic):

npm install -g @anthropic-ai/claude-code
claude doctor

After installing and authenticating, run coven doctor again to confirm the harness is detected. If doctor still reports missing, ensure the harness binary is on your PATH.


Install

Coven is available as an npm wrapper for the fastest install, or you can build from source.

npm (recommended)

Install globally:

npm install -g @opencoven/cli
coven doctor

Available npm packages:

Package Platform
@opencoven/cli Universal wrapper — auto-selects your platform
@opencoven/cli-macos macOS Apple Silicon
@opencoven/cli-linux-x64 Linux x64
@opencoven/cli-windows Windows x64

Build from source (recommended for contributors)

git clone https://github.com/OpenCoven/coven.git
cd coven
cargo build --workspace
cargo run -p coven-cli -- doctor

Note: Building from source requires Rust stable. See Requirements.


Quick Start

Option A — Interactive menu (recommended for new users)

cd /path/to/your/project
coven
# or explicitly:
coven tui

The menu opens with a Start here guide, checks your local setup, and shows the safest first command to try. Type a task directly (e.g., fix the failing tests) or use slash commands like /run codex fix the failing tests. Press h or type /help for examples.

Option B — Direct commands

cd /path/to/your/project

# 1. Verify setup
coven doctor

# 2. Start the daemon
coven daemon start

# 3. Launch a session
coven run codex "fix the failing tests"
# or with Claude Code:
coven run claude "polish this UI"

# 4. Browse and manage sessions
coven sessions

# 5. Stop the daemon when done
coven daemon stop

Option C — OpenClaw rescue loop

If OpenClaw breaks, Coven provides a predictable repair room:

coven patch openclaw

Choose a repo, choose a harness, get a verified patch.


Commands Reference

Core commands

Command Action
coven Open the beginner-friendly interactive menu
coven tui Explicitly open the slash-command TUI
coven doctor Detect supported harness CLIs and print install hints

Daemon lifecycle

Command Action
coven daemon start Start the local Coven daemon
coven daemon status Show daemon health, PID, and socket path
coven daemon restart Restart the local daemon and rebind the socket
coven daemon stop Stop the local daemon

Session management

Command Action
coven run <harness> <prompt> Launch a project-scoped harness session
coven run <harness> <prompt> --cwd <path> Launch from a cwd inside the project root
coven run <harness> <prompt> --title <title> Set a readable session title
coven run <harness> <prompt> --model <id> Forward a model override to the harness
coven run <harness> <prompt> --think Request deeper reasoning when the harness supports it
coven run <harness> <prompt> --speed <level> Set a latency/reasoning hint: fast, balanced, or thorough
coven run <harness> --continue Resume the latest active session for this project
coven run <harness> --continue <id> Resume a specific session by id
coven run <harness> <prompt> --detach Create the session record without launching the harness
coven run <harness> <prompt> --labels <l> Attach comma-separated labels to the session
coven run <harness> <prompt> --visibility <v> Set visibility: private (default), workspace, or shared
coven run <harness> <prompt> --archive Auto-archive the session when the run completes
coven run <harness> <prompt> --familiar <id> Inject a familiar identity preamble (e.g. --familiar charm)
coven run <harness> <prompt> --stream-json Emit JSONL events on stdout (for tooling/piping)
`coven run claude

--stream-json --stream-json-input| Also read JSONL user messages from stdin | |coven sessions| Open the session browser in a terminal; print a table when piped | |coven sessions --all| Browse active and archived sessions; print all when piped | |coven sessions --manage| Force the interactive session browser | |coven sessions --plain| Force plain table output for scripts or copying | |coven sessions --json| Output sessions as JSON | |coven sessions --json --all| Output all sessions (including archived) as JSON | |coven attach | Replay/follow session output and forward input | |coven summon | Restore an archived session, then replay/follow it | |coven archive | Hide a non-running session while preserving its events | |coven sacrifice --yes` | Permanently delete a non-running session and its events |

Session rituals are intentionally explicit. Archive is reversible and keeps the full event ledger. Summon brings an archived session back. Sacrifice is destructive, refuses live sessions, and requires --yes so beginners don't delete work by accident.

Ritual Reversible? Works on Description
Archive ✅ Yes Non-running sessions Hides from active list; all events preserved
Summon

Extension points exported contracts — how you extend this code

SessionRuntime (Interface)
(no doc) [8 implementers]
crates/coven-cli/src/api.rs
ChannelConnector (Interface)
(no doc) [4 implementers]
packages/channels/src/types.ts
CovenClient (Interface)
(no doc)
packages/openclaw-coven/src/client.ts
FollowerObserver (Interface)
Observer for the running follower loop. The IO-heavy caller (stdout writer, transcript renderer) implements this trait; [2 …
crates/coven-cli/src/tui/cast/follow.rs
CreateConnectorOptions (Interface)
(no doc)
packages/channels/src/index.ts
FollowerPacer (Interface)
Pacer for the follower poll loop. Production passes a `Duration` sleep; tests pass a counter that returns `Err` after N [2 …
crates/coven-cli/src/tui/cast/follow.rs
OnePasswordReadOptions (Interface)
(no doc)
packages/channels/src/onepassword.ts
RuntimeKiller (Interface)
(no doc) [3 implementers]
crates/coven-cli/src/daemon.rs

Core symbols most depended-on inside this repo

path
called by 732
crates/coven-cli/src/harness.rs
get
called by 331
crates/coven-memory/src/db.rs
len
called by 229
crates/coven-memory/src/index.rs
is_empty
called by 181
crates/coven-cli/src/repos_config.rs
open_store
called by 104
crates/coven-cli/src/store.rs
as_str
called by 99
crates/coven-cli/src/patch.rs
handle_input
called by 72
crates/coven-cli/src/tui/chat/app.rs
app_with_client
called by 68
crates/coven-cli/src/tui/chat/app.rs

Shape

Function 2,059
Method 331
Class 187
Enum 66
Interface 22

Languages

Rust86%
TypeScript9%
Python5%

Modules by API surface

crates/coven-cli/src/tui/chat/app.rs227 symbols
crates/coven-cli/src/daemon.rs176 symbols
crates/coven-cli/src/api.rs164 symbols
crates/coven-cli/src/main.rs150 symbols
crates/coven-cli/src/harness.rs128 symbols
crates/coven-cli/src/store.rs115 symbols
crates/coven-cli/src/tui/chat/highlight.rs108 symbols
crates/coven-cli/src/tui/shell.rs98 symbols
crates/coven-cli/src/tui/chat/render.rs69 symbols
crates/coven-cli/src/capabilities.rs62 symbols
crates/coven-cli/src/tui/cast/render.rs59 symbols
crates/coven-cli/src/theme.rs57 symbols

For agents

$ claude mcp add coven \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact