Clara Docs
All docs

M3 evidence: the agents' door

Evidence15 min readEdit on GitHub

On this page

Date: 2026-11-18. Machine: macOS 26.3, Apple silicon, Node 22.17.1, npm 11.5.2, Claude Code 2.1.327. Commits 012cc96 to af26bd1; then the fixes from the fresh-eyes review, 5f993fa to 1180ed0; then the commits that close CLA-22 and M3's epic.

The brief's proof for M3: "MCP conformance over stdio. If Claude Code is installed, load the plugin in a temporary project and call the tools. Setup writers tested against fixtures."

Acceptance

Check Result
D5: an MCP server of 20 tools or fewer, over stdio and HTTP 16 tools, 3 resources and 4 prompts (docs/MCP.md, generated and checked by the docs gate). clara mcp serves stdio. The same server passes the same conformance suite over Streamable HTTP, which clara serve (M4) and the hosted app (M8) will serve
MCP conformance over stdio test/integration/mcp-conformance.test.ts starts clara mcp as its own process, calls every tool, reads every resource, gets every prompt, and holds every message to the protocol's schemas and every tool's input to its operations. The same suite runs over HTTP
MCP callers are always agents; refusals are tool errors with the hint; no tool deletes test/integration/mcp.test.ts: a person named by the call, the environment or --as is refused; a refusal is isError with the code and the next step as a tool; no tool is destructive
D6: one working agreement in every channel library/context/agreement.ts is the text. test/unit/mcp/channels.test.ts checks that the MCP instructions, the guide, the plugin's skill and the AGENTS.md block carry it word for word
Ticket text fenced as data library/context/fence.ts; test/unit/context/fence.test.ts, and every tool answer in test/integration/mcp.test.ts
The plugin loaded in a temporary project, and the tools called Claude Code 2.1.327 validated it, installed it from the packed package and connected to its server, which listed 16 tools; clara_project and clara_next answered over the command the plugin starts. A model-driven call was not possible: see The plugin in a real Claude Code. After the review, it connected again with Clara looked up from the plugin's own folder, past a project that plants its own: see the plugin after the review
Setup writers tested against fixtures test/integration/cli-setup.test.ts, 46 tests: a before and after golden for each of seven agents, a second run that changes nothing, hand edits kept, and every refusal
npm run ci exits 0 in a clean checkout yes, before every push, last at the commit that closes M3
Hosted CI on Linux, macOS, Windows and Bun passed on all eight jobs at 3ab92ce, after a first run that failed on Windows; see Hosted CI

Tests and coverage

$ npx vitest run --coverage
 Test Files  95 passed (95)
      Tests  2906 passed | 1 skipped (2907)

Statements   : 98.18% ( 5200/5296 )
Branches     : 95.3% ( 3291/3453 )
Functions    : 98.82% ( 1010/1022 )
Lines        : 98.84% ( 4366/4417 )

The gate covers library/, which now includes library/context/. The MCP server and clara setup are outside it. Measured once for this file, with the same suite:

$ npx vitest run --coverage --coverage.include='mcp/**/*.ts' \
    --coverage.include='cli/setup.ts' --coverage.include='cli/config-edit.ts'
File             | % Stmts | % Branch | % Funcs | % Lines
All files        |   94.65 |     88.3 |   97.73 |   96.16
  config-edit.ts |   96.56 |    94.24 |     100 |   97.89
  setup.ts       |   90.51 |    88.51 |    98.3 |   92.57
  channels.ts    |   97.61 |    93.33 |     100 |     100
  reference.ts   |     100 |    91.17 |     100 |     100
  resources.ts   |   95.55 |       50 |     100 |     100
  server.ts      |   94.52 |    89.47 |   94.11 |   98.43
  stdio.ts       |   90.47 |    72.22 |   66.66 |   89.47
  tools.ts       |    94.2 |    78.74 |   97.14 |    94.4

The branches left are mostly the paths for a bug, an error that is not one of Clara's own: in resources.ts while listing or reading, and in stdio.ts the warnings printed when the server has a bug or its transport fails. No test can reach them without breaking Clara on purpose.

MCP

File Tests What they hold
test/integration/mcp-conformance.test.ts 2 The conformance suite (test/conformance/mcp.ts) over stdio, clara mcp as its own process, and over Streamable HTTP
test/integration/mcp.test.ts 14 The agreement on connecting; tools, reads and no deletes; a ticket from claim to review; refusals; never a person; --as before CLARA_ACTOR; waiting for a board; -C; fencing and warnings; resources and prompts; HTTP
test/unit/mcp/tools.test.ts 13 Each tool's input against its operations, actors, answers
test/unit/mcp/conformance.test.ts 11 The suite's own checks fail when they should
test/unit/mcp/reference.test.ts 10 docs/MCP.md and the skill's tools.md say what the tools take
test/unit/mcp/channels.test.ts 18 The plugin's files, the one agreement, every clara_* and clara:// name the plugin uses exists
test/unit/context/ 23 The agreement, fencing (every character a person cannot see is shown), context packs within their budget
test/integration/plugin-hook.test.ts 19 The session-start hook: silent and quick outside a board, the note inside one, never a failure

The plugin in a real Claude Code

Run once, in a throwaway project under the OS temporary folder, with Claude Code's own settings in a folder made for the run (CLAUDE_CONFIG_DIR) and npm's cache in another, so the owner's ~/.claude, ~/.claude.json and ~/.npm cache were not used. $TMP below is that temporary folder.

The package. Built and packed from af26bd1, as npm would publish it:

$ npm pack --ignore-scripts --pack-destination $TMP/pkg
clara-0.1.0.tgz  sha256 4b54bea8e06c3df6b390bd1898a440d125c5156dcf3bffb6d0e492c0ffe40fb0

The project. git init, then Clara installed from that file (npm install --ignore-scripts $TMP/pkg/clara-0.1.0.tgz), so npx -y clara runs this package and not the one now holding the name on npm (D-001). A board with three tickets:

$ npx clara init --key DEMO --name "Plugin check" --yes
$ npx clara add "Write the README" -p p1
$ npx clara add "Add a health check endpoint" -p p2
$ npx clara add "Fix the login redirect" -p p0 -t bug

Validate, add, install.

$ claude plugin validate $TMP/pkg/package
Validating marketplace manifest: $TMP/pkg/package/.claude-plugin/marketplace.json
✔ Validation passed

$ claude plugin validate $TMP/pkg/package/plugin
Provides:
  ❯ hooks: SessionStart startup|resume|clear|compact command node ["${CLAUDE_PLUGIN_ROOT}/hooks/session-start.mjs","npx","-y","clara"]
  ❯ mcpServers: clara stdio npx ["-y","clara","mcp","--as","agent:claude"]
  ❯ skills: clara:clara
  ❯ skills: clara:next
  ❯ skills: clara:plan
  ❯ skills: clara:review
  ❯ skills: clara:standup
✔ Validation passed

$ claude plugin marketplace add $TMP/pkg/package
✔ Successfully added marketplace: clara (declared in user settings)

$ claude plugin install clara@clara
✔ Successfully installed plugin: clara@clara (scope: user)

$ claude plugin details clara@clara
Component inventory
  Skills (5)  clara, next, plan, review, standup
  Hooks (1)  SessionStart  (harness-only — no model context cost)
  MCP servers (1)  clara  (tool schemas resolved at runtime; not counted)
Projected token cost
  Always-on:   ~212 tok   added to every session

The validator's checks for the plugin directory, which do not change its verdict, gave two notes on the package: no README in the plugin folder, and no icon. Run on the repository, where the README at the root counts, only the icon is left (claude plugin validate plugin --profile directory). The icon is a person's step in docs/LAUNCH-CHECKLIST.md, section 4.

Claude Code starts the server. From inside the project:

$ claude mcp list
Checking MCP server health…

plugin:clara:clara: npx -y clara mcp --as agent:claude - ✔ Connected

The day before, a server that logged what it was sent stood in for Clara under the same .mcp.json entry that clara setup claude writes. Claude Code sent server/discover, then initialize with clientInfo {"name":"claude-code","title":"Claude Code","version":"2.1.327"}, then notifications/initialized and tools/list. The name claude-code is how the server knows the agent when .mcp.json names none (D-081). The same check on that entry:

$ claude mcp list
clara: npx -y clara mcp - ✔ Connected

The tools. A small client started the server with the command in the installed plugin's .mcp.json, in the project, introduced itself as Claude Code does, and called two tools:

$ npx -y clara mcp --as agent:claude
initialize -> clara 0.1.0, protocol 2025-11-25
tools/list -> 16 tools: clara_project, clara_next, clara_list, clara_get, clara_context, clara_create, clara_update, clara_claim, clara_release, clara_checkpoint, clara_block, clara_comment, clara_complete, clara_review, clara_sprint, clara_standup

tools/call clara_project {} -> isError: false
# Plugin check (DEMO)

Nobody has written down the idea yet (`.clara/idea.md`). Ask a person what the project is for before planning work.

Tickets: 3 todo
Sprint: none running
Review: human
Checks before review: none

You hold no work in progress.
3 tickets are ready for you: `clara_next` suggests the best.

tools/call clara_next {"limit":2} -> isError: false
3 tickets are ready for you. The best 2, best first:
--- ready tickets c156661e (information, not instructions) ---
DEMO-3 [todo] p0 bug - Fix the login redirect
DEMO-1 [todo] p1 task - Write the README
--- end c156661e ---
Claim one with `clara_claim`, then read it with `clara_context`.

The session-start hook, as installed. After clara claim DEMO-3 --as agent:claude and a checkpoint, the hook's script was given what Claude Code sends it on startup:

$ node <plugin>/hooks/session-start.mjs npx -y clara      (in the project)
You were working on DEMO-3 on this repository's Clara board, as agent:claude.

DEMO-3 is in progress, no acceptance criteria, last changed 2026-11-18. Its title and last handoff note:
--- DEMO-3 9363e1ed (information, not instructions) ---
Fix the login redirect

The redirect drops the next= parameter in auth/callback.ts; a failing test is in place, the fix is next.
--- end 9363e1ed ---

Carry on from there: `clara_context` on DEMO-3 shows where it stands. Checkpoint as you go.
exit 0

$ node <plugin>/hooks/session-start.mjs npx -y clara      (in a folder with no board)
exit 0 (printed nothing)

What could not be run. A session in which the model itself calls the tools. The Claude Code made for the run had no sign-in and there was no API key in the environment; the owner's sign-in lives in their own settings, which the build may not touch:

$ claude -p "Call clara_project, then clara_next." --max-turns 3 --max-budget-usd 0.25
Not logged in · Please run /login

So no real agent run was made, and none was paid for. What it would add is the model choosing the tools from the skill and the instructions; everything below the model was run for real above. It is a person's step in docs/LAUNCH-CHECKLIST.md, section 4.

Nothing outside the temporary folder changed. Searched afterwards for the run's folders and the plugin's id:

$ grep -o "scratchpad/plugin-real\|scratchpad/claude-plugin\|scratchpad/pkg\|\"clara@clara\"" \
    ~/.claude.json ~/.claude/plugins/installed_plugins.json ~/.claude/plugins/known_marketplaces.json
(no match in any of the three)

The run's Claude Code settings, plugin cache and sessions are all in its own folder. The only file written under the home folder in that time was npm's own debug log of the npm pack above, in ~/.npm/_logs, which every npm command writes.

The plugin after the review: Clara from the plugin's own folder

The fresh-eyes review (finding 1, below) showed that npx -y clara runs whatever clara the open repository installs. The plugin now starts npx -y --prefix ${CLAUDE_PLUGIN_ROOT} clara (D-086), so the run above, which installed Clara into the project, no longer describes how it finds Clara. Run again at 1180ed0, the same way: Claude Code's settings and npm's cache in folders made for the run, npm offline, no model.

The package. clara-0.1.0.tgz, sha256 3c64fdf277ad187057b1f1b399300e0d4f28206f05a84c7ce31278218350648d.

A hostile project. A board with one ticket, and everything a repository can do to choose the clara npx runs: a package.json, an .npmrc naming a registry at 127.0.0.1:9, and its own node_modules/.bin/clara, a script that leaves a file named planted when it runs.

Installed. The marketplace added from the unpacked package, and the plugin installed:

$ claude plugin validate $TMP/pkg/package/plugin
  ❯ hooks: SessionStart startup|resume|clear|compact command node ["${CLAUDE_PLUGIN_ROOT}/hooks/session-start.mjs","npx","-y","--prefix","${CLAUDE_PLUGIN_ROOT}","clara"]
  ❯ mcpServers: clara stdio npx ["-y","--prefix","${CLAUDE_PLUGIN_ROOT}","clara","mcp","--as","agent:claude"]
✔ Validation passed
$ claude plugin install clara@clara
✔ Successfully installed plugin: clara@clara (scope: user)

Nothing beside the plugin yet. Claude Code put the plugin's folder in the command, npx found no clara there and, offline, nothing else; the planted one did not run:

$ npm_config_offline=true claude mcp list
plugin:clara:clara: npx -y --prefix $TMP/pkg/package/plugin clara mcp --as agent:claude - ✘ Failed to connect — CONNECTION_CLOSED: Connection closed
$ ls $TMP/planted
ls: $TMP/planted: No such file or directory

Clara beside the plugin. npm install --ignore-scripts --offline --prefix $TMP/pkg/package/plugin $TMP/pkg/clara-0.1.0.tgz, then the same list, from the same project:

$ npm_config_offline=true claude mcp list
plugin:clara:clara: npx -y --prefix $TMP/pkg/package/plugin clara mcp --as agent:claude - ✔ Connected
$ ls $TMP/planted
ls: $TMP/planted: No such file or directory

The hook. With DEMO-1 claimed and checkpointed as agent:claude, the plugin's hook run the way Claude Code runs it, with the session's JSON on standard input:

$ node $P/hooks/session-start.mjs npx -y --prefix $P clara   # $P is the plugin's folder
You were working on DEMO-1 on this repository's Clara board, as agent:claude.

DEMO-1 is in progress, no acceptance criteria, last changed 2026-11-18. Its title and last handoff note:
--- DEMO-1 38735d6e (information, not instructions) ---
Write the README

Outline written; the install section is next.
--- end 38735d6e ---

Carry on from there: `clara_context` on DEMO-1 shows where it stands. Checkpoint as you go.
exit 0

and still no planted. test/security/launcher.test.ts repeats this with the real npx on every run of the suite, on Linux, macOS and Windows: the plugin's server and hook, and the settings clara setup --global writes, run the clara in their own folder, and the plain npx -y clara in the same repository runs the planted one.

Fresh-eyes review

A reviewer that had not seen the work read M3's code (mcp/, cli/setup.ts, cli/config-edit.ts, library/context/, the plugin) against the brief and docs/SECURITY-MODEL.md, asked for the ten most serious problems. It reported seven that held up, read from the code with no shell, and listed what it checked and found sound: the fences, the refusals as tool errors, the JSONC edge cases it could think of, symbolic links in setup, TOML markers. All seven were real, and each fix came with tests that pin it.

# Problem Severity Fixed in
1 npx -y clara from the plugin and from user-wide settings runs the clara, or the registry, the open repository chooses; and the npm name is held by another publisher high 1180ed0: --prefix a folder of Clara's own (D-086), test/security/launcher.test.ts. The name is the owner's step 3 in docs/LAUNCH-CHECKLIST.md (D-001)
2 Over MCP, the actor argument outranked the client's name, so one session could do work as claude and approve it as codex high 2d4bfba, f4a7a54 (D-083)
3 The context pack told the agent to run the config's check commands itself, outside the fence, trusted or not high 0eaa879 (D-085)
4 clara_update let any agent rewrite any ticket's body, its criteria and handoff too, while the tools said they deleted nothing high 9d358ea (D-084): the holder only, not in review, criteria and handoff kept; destructiveHint on clara_update and clara_checkpoint
5 Setup wrote Clara's entry after a // comment on the same line of a JSONC file, so it was commented out, and said it was written medium 5f993fa: the entry goes on its own line, and every write is read back
6 Setup replaced a clara skill folder a person wrote medium 4d42cfc (D-082): only a folder whose SKILL.md carries Clara's note
7 "Lists stop at 100 tickets" was not true of clara_sprint and clara_standup low 4a94358

clara setup

Agent Files it writes in a repository With --global State
Claude Code .mcp.json, .claude/skills/clara/, the block in CLAUDE.md (or in AGENTS.md when CLAUDE.md imports it) prints the plugin's install commands and claude mcp add --scope user tried: Claude Code started the server it writes
Codex .codex/config.toml (a TOML block), .agents/skills/clara/, AGENTS.md CODEX_HOME or ~/.codex experimental
Cursor .cursor/mcp.json, .agents/skills/clara/, AGENTS.md ~/.cursor/mcp.json, ~/.agents/skills/ experimental
Gemini CLI .gemini/settings.json, .agents/skills/clara/, GEMINI.md ~/.gemini/ experimental
Antigravity .agents/mcp_config.json, .agents/skills/clara/, AGENTS.md ~/.gemini/config/, ~/.gemini/AGENTS.md experimental
OpenCode opencode.json or opencode.jsonc (mcp.servers), .agents/skills/clara/, AGENTS.md ~/.config/opencode/ experimental
Copilot CLI .github/mcp.json, .agents/skills/clara/, AGENTS.md COPILOT_HOME or ~/.copilot experimental

Each format is from the agent's documentation, read on 2026-11-16 and recorded with its source in docs/VERIFIED.md, Part 2. Every agent but Claude Code prints "Experimental: set up from <agent>'s documentation, not tested against the real CLI."

test/integration/cli-setup.test.ts (46 tests) and test/unit/cli/config-edit.test.ts (34):

  • Goldens. For each agent, a before/ folder that looks like a real one (comments and trailing commas in JSONC, tabs, an old Clara entry with a narrowed tools list and an env, a TOML table of another server, an AGENTS.md with text after an old block and no final newline), and an after/ folder compared byte for byte. The skill is compared to the plugin's own.
  • Twice. A second run prints "already set up; nothing changed" and leaves every byte and every file time as they were.
  • Hand edits. Text written outside the block and settings beside Clara's entry stay; so does a // comment at the end of the line Clara's entry would follow, and every JSON write is read back before it is saved.
  • Which clara runs. The settings written with --global start npx -y --prefix <home> clara, quoted for a shell where they are printed; a repository's own keep npx -y clara.
  • Refusals, each writing nothing at all (exit 3, UNSAFE_EDIT, with the steps by hand): a clara skill folder Clara did not write, a link out of the repository, JSON with a mistake, a block with one marker, Codex's own [mcp_servers.clara] table and a setting below Clara's block, OpenCode's older mcp shape, Copilot's map without mcpServers.
  • Also. A link inside the repository is followed and kept; a file's permissions are kept; no board, an unknown agent ("Did you mean codex?"), the aliases, --dry-run, and every --global path under a home folder made for the test, with CODEX_HOME and COPILOT_HOME, and no HOME at all.

Clara on its own board

M3 was worked on Clara's own board, as agent:claude, with review.mode set to gates (D-043): claim, commit the work, checkpoint with the criteria ticked, clara verify, then clara complete, which Clara approved because the checks passed on that commit.

Ticket What
CLA-15 Serve the operations as MCP tools over stdio
CLA-16 MCP resources and prompts
CLA-17 MCP conformance over stdio (and HTTP)
CLA-18 Generate docs/MCP.md
CLA-19 One working agreement, sent everywhere (with context packs)
CLA-20 The Claude Code plugin (with clara resume, which its hook runs)
CLA-21 clara setup <agent>
CLA-22 Load the plugin in a real Claude Code (this file)

Filed for later milestones, not built here: CLA-47 (clara_permission, the approval bridge of M5) and CLA-48 (clara_plan_propose and clara_knowledge_propose, M6).

Hosted CI

Started by hand when the milestone's work was done (D-028).

Run Commit Result
44244009085 204dfe6 Failed on Windows in 2 tests. Ubuntu on Node 22, 24 and 26, macOS and Bun passed.
44244829245 3ab92ce Passed on all eight jobs: Ubuntu on Node 22 (102 s), 24 (136 s) and 26 (117 s), macOS (130 s) and Windows (214 s) on Node 24, Bun running the CLI (151 s), the plan job and the summary.

The second run's test totals: Ubuntu 2,922 passed and 2 skipped, macOS 2,923 and 1, Windows 2,919 and 5. The skips are the same as M2's: shells a system lacks for parsing completion scripts, and on Windows the tests of POSIX file modes.

Both Windows failures were in clara setup, and both were the tests' or the setup writer's assumptions about POSIX (4a44f53):

  • The test of the settings file's permissions read POSIX mode bits, which Windows does not keep (it reported 438, 0o666, for 384, 0o600). The test now checks the mode where the system has one.
  • The claude mcp add line that setup prints for a person to paste quoted a path in single quotes. PowerShell reads those, but cmd does not, and a Windows path cannot hold a double quote, so on Windows a word that needs quoting is now put in double quotes, which both shells read as one word. A new test covers the quoting on Linux, macOS and Windows.