🤖 Claude Code agent instructions

An agent using the bridge today spends every call on a shell round-trip: read the endpoint file, sed the token out, hand-quote JSON. stage_findings is the worst of it, and hand-quoting is what produced the malformed_request seen in testing. The seven methods are already granular and chainable — do not add more, smaller ones, which would only mean more shell round-trips. Fix the invocation, not the granularity.

Do not rewrite the transport. Keep crates/app/src/agent_bridge.rs and the ai::agent contract as they are: they work, they are tested, and AGENTS.md documents them as the language-neutral route any runtime can use. Add a thin MCP adapter in front.

Target the 2026-07-28 spec, not the 2025-11-25 one

Researched 2026-08-15. The current spec is 2026-07-28, the largest revision since launch, and it lands in qrate's favour — several things that would have been work under the old spec no longer exist:

A feature-lifecycle policy now guarantees ≥ 12 months between deprecation and removal, so pinning to 2026-07-28 is safe.

Scope

One tool per existing method, schemas generated from the ai::agent types. Stdio JSON-RPC is the transport an agent runtime registers; it forwards to the loopback HTTP already running. No new dependency needed — serde_json is in the tree and the repo already hand-rolls its HTTP; hand-roll the MCP subset the same way rather than pulling in an SDK for tools/list + tools/call.

Definition of done

An agent registers one MCP server, then reviews an open project and stages findings without invoking a shell, and every call still appears in the Agent panel with a real client name.

🧠 Agent memory log