harnessd
v0.2.0
Published
A multi-surface coding agent daemon: sessions, tools, processes, and MCP over JSON-RPC on a WebSocket.
Maintainers
Readme
harnessd
A long-lived coding-agent daemon. It owns the model loop, sessions, tools, and managed processes, and speaks JSON-RPC 2.0 over a WebSocket so any number of thin clients (CLI, TUI, web, or another agent over MCP) can attach to the same session at once.
npx harnessd
# [harnessd] listening on ws://127.0.0.1:7777 (pid 12345)What it does
- Sessions — each is a conversation thread with its own history, working
directory, tool policy, memory scratchpad, and context budget. Persisted as
JSONL under
~/.harness/sessions, so a restart loses nothing. - Tools —
read,write,edit,bash(foreground or background),memory, andtask(spawn a sub-agent, optionally on a different model). - Processes — background commands are supervised, logged to disk, and survive daemon restarts; killable as a group.
- MCP — connects to MCP servers listed in
~/.config/mcp/mcp.json(stdio and streamable HTTP) and offers their tools to the model. Deferred loading plus a tool-search tool keeps large tool catalogs out of the context window. - Context — cross-turn tool history, lossless tool-result eviction, and summarizing compaction, in that order.
Configuration
Credentials: ANTHROPIC_API_KEY, or HARNESS_PROVIDER=vertex with
HARNESS_VERTEX_PROJECT and Google application default credentials.
| Env | Default | Meaning |
| --- | --- | --- |
| HARNESS_PORT / HARNESS_HOST | 7777 / 127.0.0.1 | Listen address |
| HARNESS_PROVIDER | anthropic | anthropic or vertex |
| HARNESS_MODEL | claude-sonnet-4-6 | Default model (per-session override) |
| HARNESS_EFFORT | high | Reasoning effort; clamped per model |
| HARNESS_THINKING | adaptive | hidden keeps thinking, drops the transcript; off disables |
| HARNESS_CACHE | on | Prompt-cache breakpoints |
| HARNESS_MCP_CONFIG | ~/.config/mcp/mcp.json | MCP config file(s), colon-separated; off disables |
| HARNESS_TOOL_SEARCH | on | Defer MCP tool schemas behind a search tool |
| HARNESS_SESSIONS_DIR | ~/.harness/sessions | Session logs |
| HARNESS_WEB_DIR | unset | Also serve a web UI from this directory |
The daemon binds loopback and has no authentication of its own; put a tunnel with real auth in front if you want it reachable.
Status
Early. The protocol is stable enough to build on but not frozen.
Requires Node >= 22.
