Working with AI coding agents
How to record Claude Code, Codex, Cursor, or any agent's work as an Arc, what is captured today, and a handoff pattern that works.
validated against patcharc 0.2.0 · 2026-08-22
PatchArc does not care who made the commit. The observer reads Git, so an agent's commits are recorded exactly like yours. That is the honest scope of 0.2.0: commits and touched files are evidence; the agent's conversation is not.
Recording an agent session
$ patcharc start --detach "Agent: migrate auth tests to vitest"
# run your agent; let it commit as it works
$ patcharc note "Agent chose to keep the old helpers; I agree for now"
$ patcharc risk "Snapshot tests were regenerated, not reviewed line by line"
$ patcharc stop
Tips that make the record useful:
- Ask the agent to commit in small steps. Each commit is a row in the story; one giant commit is one row.
- Record decisions as you review the agent's work, not after. The timestamps show what you knew when.
- Put the session's intent in the goal string; it becomes the first section of the review.
The MCP server: first-class recording for any agent
patcharc mcp serves the recorder over the Model Context Protocol on stdio, so any MCP-capable agent gets real tools instead of shell homework: arc_start, arc_decision, arc_risk, arc_note, arc_record_test, arc_stop, arc_verify. Register it once:
claude mcp add patcharc -- patcharc mcp
and tell the agent to use the tools in its project instructions. Decisions land with timestamps, test results fill the Verification section, and the agent can seal the Arc itself when the task completes.
Claude Code
Use the MCP server above, the hooks plugin in adapters/claude-code/ (session start and end become Arc events, and with ambient capture on, a session opens an Arc automatically), or plain CLAUDE.md instructions:
When you make a design decision, run: patcharc decision "<one sentence>"
When you notice a risk you did not fix, run: patcharc risk "<one sentence>"
After running tests, run them through: patcharc run -- <test command>
The observer records the resulting events alongside the commits.
Codex, Cursor, and others
Same approach: the MCP server works with every MCP-capable tool, and any tool that produces commits is covered with no integration at all. Commits carrying agent trailers (Co-Authored-By: Claude …, Assisted-by: …) or agent committer identities (Copilot, Devin, Cursor, Jules) are attributed automatically in the review's agent/assisted/human counts. Tools that only edit the working tree without committing are invisible until a commit lands; ask for commits, or commit yourself at checkpoints.
What is not captured yet
- Transcripts, prompts, token usage, and tool calls. Transcript-level adapters (generic JSONL import) are planned and not built.
- Which lines an agent wrote versus you. Attribution is per commit (from Git identities and trailers), not per line.
If you need the transcript itself, pair PatchArc with a transcript tool and link the two; see the comparison with Entire and Lore.
A handoff pattern
- The agent works inside an Arc; you record decisions and risks as you review.
patcharc stop, thenpatcharc verifythe capsule.patcharc share --visibility publicand paste the ArcLink into the pull request, or attach the.parcto the ticket. A reviewer can verify the file offline before reading it.- The next person (or the next agent session) starts from the review: goal, what changed, scopes, decisions, open risks.