Claude Code plugin + local console

Inside the console

How the local console runs a ticket: the pieces, the path of a hook, the questions, the run worktree, run health, the evidence chain, the life of a run, the queue and its scheduling, the metrics and what each repository remembers, and what stays on disk. Who does what and on which model is in the agent map; this page shows the machinery underneath.

Claude Code session
Console or hook code
File on disk
Software Engineer
Zoom 100%
00

The pieces

A Next.js page and a Node server on 127.0.0.1:3210, started by impl. The server spawns the real claude binary in a PTY, one session per run, and learns what it does through its hooks. Two more sessions run headless (claude -p, no terminal, no run): one compares the tickets of a batch before they are scheduled, the other judges an improvement branch. A terminal client, console/cli, is a second client of the same server beside the page. No direct API call and no key. The forge is read with glab or gh by the server itself, without a Claude session. In every diagram, hover a node to see what it does.

flowchart LR
  swe("Software Engineer
the page or the terminal"):::swe cli{"Terminal client
console/cli: impl run,
watch, answer, queue"}:::script page{"Next.js page
run view, terminal,
tracking, evidence"}:::script server{"Node server
registry, RunSession,
monitor, watchers"}:::script engine{"server/engine
the only code that
knows Claude Code"}:::script session["Claude Code session
in a PTY,
in the run worktree"]:::agent headless["Headless sessions
claude -p: batch
scheduling, judge"]:::agent data[("console/data
runs, queue,
repositories")]:::file forge{"glab / gh
merge request state,
blocking links"}:::script swe --> page swe --> cli page -- "WebSocket" --> server cli -- "HTTP and WebSocket" --> server server -- "run state" --> page server -- "run state" --> cli server --> engine -- "spawn, keys" --> session engine -- "claude -p" --> headless session -- "hooks" --> server server --> data server -. "no token" .-> forge classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
Several runs at onceEverything a run owns lives on its RunSession, and every message that acts on a run names it by runId.
One boundaryOnly server/engine knows the binary, the hook vocabulary and the transcript format. Nothing above it imports node-pty.
Two clientsThe page and the terminal client send the same WebSocket messages. The terminal client reads the same HTTP routes and names the console as its Origin. A message may carry an ackId, answered by ack once handled or put in the error that refuses it. Exit codes: 1 refused or failed, 2 usage, 3 no console.
Local onlyEvery request needs a Host naming the console: the loopback names, the interface it binds, the machine's addresses when it binds every interface, and the names given in IMPL_ALLOWED_HOSTS. The WebSocket needs an Origin it served, /api/hooks the secret of the hook URL. With IMPL_ALLOWED_MACS set, a device other than this machine must be on the local network and listed by hardware address, read from the neighbour table; a client behind a router or a VPN has none and is refused. It is a filter, not an authentication.
01

The path of a hook

Each hook of the session runs emit.mjs. The guard and the stop gate decide first, inside the session, then the event is posted to the server, which turns it into an engine event, applies it to the run and pushes the new state to the pages that opened that run.

flowchart LR
  session["Pilot or agent
a tool call,
an agent stop"]:::agent emit{"emit.mjs
one call
per hook"}:::script guard{"guard.mjs
refuses a
dangerous call"}:::script gate{"gate.mjs
checks at the stop
of Dev and Senior"}:::script session --> emit --> guard guard -- "refused" --> session guard --> gate gate -- "fails: back
to work once" --> session classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
flowchart LR
  spool[("hooks-spool.jsonl
kept when the
server is away")]:::file access{"access.ts
checks the secret
of the hook URL"}:::script engine{"server/engine
raw hook into
EngineEvent"}:::script hooks{"hooks.ts
applies it to
the RunSession"}:::script runjson[("run.json
one write
at a time")]:::file ws{"context.ts
WebSocket to the
pages of that run"}:::script spool -. "replayed" .-> access access --> engine --> hooks hooks --> runjson hooks --> ws classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
What the guard refusesEight kinds of call during a run: a workflow agent under its bare name, a Dev on a model other than Sonnet or Opus, a Dev started while planner-output.json lacks a complete integration or end-to-end test decision, a reviewer started while a task has no report, a reviewer or a merge request publication below the review tier the diff requires, a session trailer or link in a commit or a publication (a model credit in Co-Authored-By is allowed), a publication that shows a credential, a git command that destroys work.
Review tier floorreview-tier.mjs reads the paths the diff touches: at least tier 1 on a sensitive path, at least tier 2 on CI or a migration. Below the floor a reviewer does not start and the merge request is not published. Tier 2 needs review-orchestrator to have started and review-summary.md to say READY or BLOCKED; tier 1 needs QA or the orchestrator. A verdict that is not ready is published only as a draft.
What the stop gate runsPer package the edited files belong to: the type-check, then the lint and the related tests of those files. A failure sends the agent back once; the second stop always goes through, and so does a stop that follows a SubagentHandback call. Every check is a line of gate-log.jsonl with pass, fail, inconclusive (type errors outside the agent's files while a peer edits), skipped (the check could not run) or none, and its duration in ms when it ran. keepGateLog copies the lines to data/runs/<id>/gate-log.jsonl, since the workflow empties its task directory.
Dropped hooksThe hooks of a run that ended or is paused are dropped, except a question, which is still raised because the engineer can keep talking to an idle session. A hook from a run the console no longer holds is answered and ignored.
Lost hooksemit.mjs retries once, then spools the event. The spool is replayed before the next hook and on every monitor tick, and hookId drops the duplicates.
Fails openA guard that cannot read what it checks lets the call through, and so does a gate that cannot run a check. IMPL_STOP_GATE=off disables the gate.
02

Questions and decisions

A question from the workflow blocks the session until the engineer answers in the console. The folder trust dialog Claude Code draws before any hook is read off the terminal and shown the same way, but it is never answered on the engineer's behalf. The page and the terminal client both answer.

flowchart LR
  pilot["Pilot
AskUserQuestion"]:::agent hook{"PreToolUse hook
waits for the answer,
3600 s at most"}:::script run{"RunSession
pending question,
dated when asked"}:::script swe("Software Engineer
answers in the
conversation"):::swe pty["Claude Code
folder trust dialog,
before any hook"]:::agent trust{"trust-prompt.ts
reads the dialog
off the PTY"}:::script cli{"Terminal client
impl answer,
impl trust"}:::script pilot --> hook -- "question" --> run -- "question card" --> swe swe -- "answer" --> run -- "updatedInput" --> hook --> pilot pty -- "screen text" --> trust -- "decision" --> swe swe -. "sessionPrompt.answer:
the engine types the keys" .-> pty swe --> cli cli -. "question.answer,
sessionPrompt.answer" .-> run classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
Never retried, never spooledA question only makes sense while its session waits. Claude Code replays the hook with the answers; the engine ignores that second pass.
The trust decisionKept as RunState.sessionPrompt and answered with sessionPrompt.answer, a state of its own and not the question bridge. It is dropped on the first hook, when the screen moves on, or at exit. The directory it names is the run worktree, not the checkout.
Refusing the trust dialogThe run ends stopped with its reason, not failed, and its worktree is settled like that of any stopped run. An unknown wording shows nothing.
03

The run worktree

Every ticket run works in a git worktree of its own, created before the session and settled after it. The main checkout is never touched, and a worktree that may still hold work is kept with its reasons.

flowchart LR
  registry{"registry.ts
main checkout,
one run per ticket"}:::script add{"git worktree add
.claude/worktrees/#lt;run-id#gt;
detached HEAD"}:::script nope(("no run")) provision{"provisionWorktree
dependencies, ignored
config, git hooks"}:::script stale{"staleDependencies
node_modules against
package-lock.json"}:::script session["Session
in the worktree,
reinstalls when stale"]:::agent registry --> add add -. "fails" .-> nope add --> provision --> stale --> session classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
flowchart LR
  settle{"settleRunWorktree
applies the
removal rules"}:::script removed(("removed")) kept[("kept
with its reasons")]:::file swe("Software Engineer
removes it, with force
after seeing the risks"):::swe settle -- "run completed, MR not a draft,
workflow not blocked, archive synced,
tree clean, HEAD on a
remote-tracking ref" --> removed settle -- "otherwise" --> kept --> swe classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
What the worktree receivesThe ignored dependency directories (node_modules by default), copied copy-on-write or linked when the copy fails, the .env* files and .claude/settings.local.json, and the ignored git hooks helper (husky's .husky/_). Build outputs are not provided.
What the session is toldIMPL_RUN_WORKTREE, IMPL_SOURCE_REPOSITORY, IMPL_SOURCE_BRANCH (left out on a detached HEAD), IMPL_WORKTREE_DEPENDENCIES (symlink as soon as one directory is linked, otherwise clone, left out when nothing was brought over), and IMPL_WORKTREE_DEPENDENCIES_STALE when they lag behind the lockfile.
When it is removed aloneThe run is completed with a merge request that is not a draft, the workflow is not blocked, the archive sync was acknowledged, the tree is clean and HEAD sits on a remote-tracking ref. Only local refs are read, nothing is fetched. Anything else keeps it, with the reasons.
Removal on requestRefused while the session lives. When the tree holds uncommitted or unpushed work the answer is confirm with the risks, until the request comes back with force. The page and impl worktree rm both ask.
If the worktree cannot be createdThe launch is aborted. The server never falls back on the main checkout.
Shutdown and restartA shutdown marks the worktree kept; the same rules run again on boot. Only a path directly under .claude/worktrees/ is ever removed, and the branch never is.
04

Run health

The server does not read silence as a failure. It pairs the tool calls, tells the pilot from its subagents and reads the step the workflow declares, evaluates all of it at each tick and opens an incident only when a decision is needed. The decision on an incident is written before it takes effect.

flowchart LR
  signals[("RunSession.signals
turn ends, paired calls,
background calls")]:::file state[("workflow-state.json
the declared step")]:::file monitor{"run-monitor.ts
one tick per run,
serialised"}:::script health{"run-health.ts
evaluateRunHealth,
pure, injected clock"}:::script incidents{"run-incidents.ts
deduplicated,
lifted by its event"}:::script swe("Software Engineer
picks an action
on the banner"):::swe action{"incident.action
decision persisted
before the effect"}:::script archive[("/api/archive
runs left with
an open incident")]:::file signals --> monitor state --> monitor monitor --> health -- "stalled, interrupted" --> incidents -- "banner" --> swe swe --> action --> incidents incidents -. "after a restart" .-> archive classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
Five readingshealthy, waiting (on the engineer, dated from the question), suspected_stall (silence alone, never an incident), stalled, interrupted.
Four incidentsno_next_action, lost_session (the session exited before a result: the run is failed; an exit within 5 s of a Ctrl-C typed in the run's terminal is a stop by the user), missing_result, unresolvable_dependency.
ActionsAnswer, open the terminal, view the diagnostic, ask the pilot to continue, stop the run, dismiss.
PausedA workflow that declares paused, a wait the engineer asked for such as another ticket's merge, puts a run in progress whose session is open in the status paused, shown as "Paused". It takes no slot, keeps its ticket and the conflict holds on its repository, is healthy by definition and is never closed for a queued launch. It is not an end: no self-audit opens and no merge is watched yet. The next declared state other than paused puts it back to running; the exit of its session or a shutdown ends it stopped.
An agent waiting on its own workA subagent whose stop does not follow its SubagentHandback call (handedBack: false), after it launched a background call, has not ended: it resumes. It raises no missing-file incident and keeps the run open (agentsAwaitingBackground) until its next start, a stop that hands back, or a kill. The reverse case: an agent whose stop never reached the console (the gate blocked it before the hand-back was written) but whose transcript ends on that call is closed at the pilot's next turn end.
Which step is the phaseThe step the pilot declares in workflow-state.json is the phase, and it never goes back except during a reopening. What a document, an agent start or a command points at moves the phase only while no step is declared. A step the pilot never declares has no arrival time.
File contractsAn agent that ends without the file its contract requires (planner-output.json, the QA and design reports with their plan and evidence, review-summary.md), with nobody taking over, raises an incident.
05

The evidence chain

Each acceptance criterion gets a status the console derives itself from the evidence files, never from what an agent says about its own work. The same derivation feeds the "Evidence" tab and the summary the merge request quotes.

flowchart LR
  pilot["Pilot
acceptance-criteria.json
AC1 … ACn"]:::agent agents["Dev, Senior,
Designer, QA

evidence files"]:::agent ingest{"acceptance-runtime.ts
ingests, identifies
the code version"}:::script versions[("data/runs/#lt;id#gt;/evidence
every version
and capture")]:::file derive{"acceptance.ts
failed, blocked,
unverified, verified"}:::script qa{"qaVerdictConsistency
QA's verdict against
what QA observed"}:::script facts[("Observed facts
diff, gate log, findings,
incidents, workflow state")]:::file confidence{"review-confidence.ts
note from 0 to 5, measured
on the MR diff"}:::script tab{"Evidence tab
in the console,
in English"}:::script summary[("acceptance-summary.md
in IMPL_LANGUAGE")]:::file mr["Pilot
merge request
description"]:::agent pilot --> ingest agents --> ingest --> versions ingest --> derive derive --> qa derive --> tab qa --> summary --> mr derive --> summary derive --> confidence qa --> confidence facts --> confidence confidence --> tab confidence --> summary classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
Which status winsFailed over blocked, then unverified, then verified. Stale, unversioned or replaced evidence never counts as verified, and a fail is never read as a confirmation.
Break attemptsA QA item of kind attempt that fails counts against its criterion; any other is listed under it and verifies nothing.
QA verdict checkedA PASS over a criterion QA did not observe raises a warning in the tab and in the summary.
Review confidenceA note from 0 (a person reviews everything) to 5 (nothing observed stands against the automated review), computed by a pure function from the coverage, the diff, the stop gate's log, the findings and the incidents. No agent declares it, and what an agent declares can only lower it. Each rule that applied is listed with the note.
When it existsOnly once the merge request is open and senior-review.md or qa-report.md is archived. The diff is read from the merge request, and the readings are kept until their source moves (code snapshot, merge request address and target branch): one forge call per merge request, never from a GET. A finding counts as open only in the last review round, uncorrected and with no rework after it.
Where it is writtenAt the top of the review comment and of a follow-up comment, never in the description. confidenceAtDelivery keeps the note of the first end and is never rewritten; /api/metrics serves a calibration that counts, per note, the delivered runs later reopened or given feedback.
Review orderWhen qa-plan.md did not arrive before qa-report.md, or design-inventory.md before designer-review.md, the evidence tab shows a note. It changes no verdict.
CapturesA capture is a screenshot or, for a flow, a short video (.webm): an evidence item lists videos in attachments and the Evidence tab plays them.
Coverage frozen at deliveryThe code is identified until the workflow's end is archived. A rebase or an edit made afterwards, outside a reopening, leaves the delivered coverage as it was.
06

The life of a run

A run has one status. The workflow decides when it is over, not the session: a finished run keeps its session idle at its prompt, and the engineer can still ask for a change.

flowchart LR
  starting{"starting
worktree made,
session spawned"}:::script running{"running
the workflow
works"}:::script attention{"attention
a decision or a
permission waits"}:::script paused{"paused
a wait the engineer
asked for"}:::script completed[("completed
the workflow
reached its end")]:::file stopped[("stopped
by the engineer
or a refusal")]:::file failed[("failed
lost_session
incident")]:::file starting -- "first hook" --> running running -- "question, permission,
trust dialog" --> attention attention -- "answered" --> running running -- "workflow declares paused" --> paused paused -- "next declared state" --> running running -- "pilot handed back,
nothing left running" --> completed completed -- "change asked after
the final report" --> running running -- "Ctrl-C, run.stop,
trust refused" --> stopped paused -- "exit or shutdown" --> stopped running -- "exit before a result" --> failed classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
When a run is completedThe pilot handed control back, no agent or background call is still running, and either the last step was reached or the declared end holds against what the run shows. The slot is freed at once, the figures of the run are written and the self-audit may open.
ReopeningA change asked after the final report puts the run back in progress at the step the workflow declares. The first end is kept and the duration adds the reopenings, never the idle time between them. A session that exits or a console that closes before the next end leaves it completed with an attention line, never failed or stopped.
What ends a run stoppedA Ctrl-C typed in the run's terminal (an exit within 5 seconds of it), run.stop, a refused trust dialog, or the console closing. An exit before a result with none of these is failed, with a lost_session incident.
After a restartOn boot, archived runs that were not over are read back as failed, except one reopened after its final report, which is closed completed.
07

The queue and scheduling

A launch goes through the registry, which holds one run per ticket and a limited number of slots, and keeps tickets that would collide in one repository apart. What does not start at once waits in a queue with its reason.

flowchart TB
  swe("Software Engineer
run.start, batch.submit,
impl run"):::swe proposals[("ticket-proposals.json
kept by an
outside watcher")]:::file intake{"ticket-source.ts
resolves each URL
to its checkout"}:::script registry{"registry.ts
queue, one run per ticket,
IMPL_MAX_CONCURRENT_RUNS"}:::script analysis["Batch analysis
headless Sonnet,
output.json"]:::agent forge{"glab / gh
blocking links,
merge request state"}:::script sched{"Scheduler
conflictBetween,
describeQueue"}:::script run{"RunSession
starts in
its worktree"}:::script watch{"merge-watch.ts
polls the merge
request"}:::script queue[("queue.json
restored on boot")]:::file swe --> intake proposals -. "read every 5 s" .-> intake intake --> registry registry --> analysis -- "predicted edges" --> sched forge -- "links" --> sched registry --> sched sched -- "entries that may start" --> run run -- "ends with a
merge request" --> watch forge -. "status" .-> watch watch -- "merged or closed" --> registry registry --> queue classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
AdmissionOne run per ticket identity, the same for the /-/issues/ and /-/work_items/ addresses, held while the run is in progress or its session is open. IMPL_MAX_CONCURRENT_RUNS (3 by default) counts only the runs whose workflow still works: a finished run frees its slot, and its open session is closed when a launch waits on its ticket. A launch that hits either limit is queued with its reason.
Batch intakeTwo ticket addresses or more in the launch form, or several in impl run, become one batch. Each address is resolved to its checkout, and one invalid address refuses the whole batch. A ticket filed in a project with no code opens the target picker: the engineer chooses the checkouts and one run starts per repository. With several delivery projects the merge request cites the full reference and closes nothing.
Batch analysisOne headless Sonnet session per repository per batch, serialised per repository and outside the slot limit, bounded by IMPL_SCHEDULE_TIMEOUT_MINUTES (5 by default). It is judged by output.json alone, validated against contracts/schedule.md. A missing file, a timeout or a restart marks its tickets failed, and the next analysis of the repository predicts them again.
Forge linksBeside the session, the server reads the blocking links of each ticket analysed, with one glab api call or two gh api calls. A link to another ticket the console holds in the same repository becomes a depends_on edge over the agent's. Unreadable links give no edge.
ConflictsTwo tickets of one repository wait apart on an overlap or depends_on edge. A ticket whose analysis failed, or whose confidence is low, waits apart from every other ticket of its repository. Two repositories never conflict. A waiting entry gets the first reason that matches: ticket, slot, analysis, conflict, merge, dependency or order.
Merge watchWhen a scheduled run ends with a merge request, the entries in conflict wait for its merge. The watcher polls only the watches that hold a queued entry, every IMPL_MERGE_POLL_MS (60 s), with one forge call and no Claude session. merged or closed releases them; opened and a failed call keep holding. A run that ends without a merge request releases them at once.
Overridesqueue.force starts an entry from the base branch, or stacked on the branch of the ticket that blocks it. queue.move reorders, though a dependency still goes first, and queue.cancel removes. The terminal client has impl queue for each.
Ticket proposalsThe console never asks the forge for tickets. An outside watcher keeps data/ticket-proposals.json up to date; the new tickets in it are queued as a batch with no click. One that cannot be launched keeps its reason, is listed under the queue, and can be dismissed or launched on checkouts the engineer chooses.
08

Metrics and repository memory

The console measures every run and keeps, per repository, what the next run on it should know. The figures come from transcripts and git, never from what an agent says about its own cost.

flowchart LR
  transcripts[("Claude Code transcripts
pilot and subagent
files")]:::file usage{"engine/usage.ts
only the bytes gained
since the last reading"}:::script metrics{"run-metrics.ts
timeline, tokens, diff,
gate time"}:::script mjson[("metrics.json
per run")]:::file api{"/api/metrics
runs, calibration,
improvements"}:::script pilot["Pilot
runtime-recipe.md"]:::agent senior["Senior reviewer
senior-findings.json"]:::agent repos[("data/repositories
recipe, findings,
source fixes")]:::file seed{"Seeding
at the next launch
on that repository"}:::script guide[("REVIEW.md
in the repository")]:::file next["Next run
developers, reviewers"]:::agent fixes{"finding-fixes.ts
proposes a source fix"}:::script swe("Software Engineer
accepts or
dismisses"):::swe instr[("CLAUDE.md or AGENTS.md
of the checkout")]:::file transcripts --> usage --> metrics --> mjson --> api pilot --> repos senior --> repos repos --> seed --> next guide -- "copied at launch" --> next repos --> fixes --> swe swe -- "accept" --> instr classDef agent fill:#3a2210,stroke:#ff9d3c,stroke-width:1.6px,color:#c9cddb classDef script fill:#12301f,stroke:#4ade80,stroke-width:1.6px,color:#c9cddb classDef file fill:#0f2236,stroke:#60a5fa,stroke-width:1.6px,color:#c9cddb classDef swe fill:#3a310a,stroke:#facc15,stroke-width:1.6px,color:#c9cddb
TokensRead from the transcripts Claude Code keeps, at most once every 5 seconds and only the bytes a file gained. One call written on several lines counts once, with its last figures. Each subagent's file is read with the agent_id its hooks carry.
Run metricsmetrics.json is written when the workflow ends and again when the session exits. It holds the waits on the engineer, the arrival at each step, the reopenings, the tokens, the gate time and the diff, measured from the branch the merge request targets. A run is compared to the delivered runs of the same review tier once three share it, and to nothing below three. The plan sizes and the tier are an estimate; the diff is the fact.
Runtime recipeThe pilot writes how the app is started, reached and driven. Every version is kept per repository and put back in the task directory at the next launch. It holds no secret.
Review findingsThe senior reviewer files each finding under one key of a fixed list. A category found on at least two tickets in the last 90 days is written to recurring-findings.md for the next run, at most five kinds with three examples each. The pilot passes it to developers, never to a reviewer. Findings older than 180 days are dropped.
Review guideThe first of REVIEW.md, .claude/REVIEW.md and docs/REVIEW.md is copied to the task directory at launch and passed to the senior reviewer, QA, the design reviewer and the orchestrator, never to a developer. A finding on a path it ignores is not kept in the repository's store.
Source fixesWhen one category shows in IMPL_FINDING_FIX_RUNS distinct runs (3 by default) in 90 days, a pending proposal is written and the run says "Source fix proposed". Accepting appends a block to CLAUDE.md, else AGENTS.md, else a new CLAUDE.md, on the main checkout, never on a run worktree. A dismissal sticks until the findings are forgotten. No linter configuration is edited.
Automatic merge of improvementsEvery minute, auto-merge.ts takes each improvement branch whose report is written and tree is clean, replays it on HEAD with git alone, and rejects it on a mechanical rule (a protected path, a deleted or skipped test, over 15 files or 400 lines), on a check the console reruns in the worktree, or on the verdict of the headless judge. Otherwise it merges, unless HEAD or the branch moved meanwhile. The loop itself is drawn in the agent map.
09

What stays on disk

Everything the console keeps is under console/data/, ignored by git. It holds ticket content: it never goes into tracked files, commits or docs.

data/runs/<run-id>/run.json (the state, one write at a time), terminal.log, artifacts/ (the workflow documents), evidence/, metrics.json (tokens, durations, diff; written when the workflow ends and again when the session exits), gate-log.jsonl, hooks-spool.jsonl while hooks wait.
data/queue.jsonShaped { version: 2, queue, tickets, edges, watches }: the launch queue and the schedule, with the conflict edges and the merge request watches. Written whole, then renamed. The bare array written before batches still loads.
data/repositories/<checkout>-<digest>/Per repository: runtime-recipe.md (how the app is started and driven), review-findings.json (the defects the reviews keep finding) and finding-fixes.json (the source fixes proposed, accepted or dismissed). The recipe and the recurring findings are handed to the next run.
data/ticket-proposals.jsonThe file the outside watcher writes, read every 5 seconds, and ticket-proposals-handled.json for the tickets already queued or dismissed.
Batch analysesIn implementation-factory-<user>/schedule/ of the system's temporary directory, removed once read, kept with session.log on a failure, wiped on boot.
data/feedback/ and data/self-improvement-decisions.jsonlThe feedback and self-audits the improvement loop reads, its plans and reports, and one line per decision of the automatic merge (merged, rejected with its reasons, reverted), with the duration and tokens of each judge session on the branch. The judge's files sit beside the batch analyses, in improvement-judge/, removed once read and kept on a failure.
data/server.logThe output of the server started by impl. Every failure nobody awaits leaves a line there, with its stack when there is one.
Unreadable is not absentA persisted file that cannot be read is renamed *.unreadable-<time> and reported before the console starts from nothing.