Skip to Content
caffeine docs

Runs and state

Logs, summary.json, network.log, last_run and work sessions.

Where a run leaves its traces

Each target of each run gets its own folder:

~/.caffeine/runs/<YYYY-MM-DD>/<pipeline>/<target>/<HHMMSS>/
  summary.json            what happened, machine-readable
  <step>.log              script output, or the agent's full transcript
  <step>.verify.log       output of the step's verify command
  <step>.attempt2.log     transcript of the second attempt (model ladders, `attempts:`)
  <step>.2.log            second pass of a loop, or second item of a foreach
  <step>.prompt.md        rendered prompt (cmd runner)
  changes.diff            everything the run changed (git workspaces)
  base-snapshot.json      the files as they were when the run started
  network.log             the network applied to each step, where it ran, and the refused connections (kubernetes with hubble)
  gates-pending.json      what the gates saw, recorded in state.json if the run succeeds
  smoke-baseline.json     routes recorded by `caffeine check smoke --save`
  REVIEW.json             the verdict of a review step
  memory/                 the target's memory as the run ended (pipelines with `memory: true`)
  <step>.retry1.log       the log of a retried attempt
  REPORT.md, ...          every file the steps left in .agent/

A second run on the same day gets its own HHMMSS folder, and two runs started in the same second get HHMMSS and HHMMSS-2: nothing is overwritten.

For the claude runner, <step>.log holds one JSON event per line (the CLI's stream-json output), followed by the CLI's stderr if there was any. For the llm runner, it holds the request and the response.

summary.json

{
  "target": "my-site",
  "pipeline": "deps",
  "started": "2026-11-29 07:00:02",
  "ok": true,
  "skipped": false,
  "dry_run": false,
  "steps": [
    { "name": "01-gate", "runner": "run", "ok": true, "exit": 0, "secs": 1.2 },
    { "name": "02-update", "runner": "claude", "model": "cheap", "ok": true,
      "turns": 18, "cost_usd": 0.12, "tokens_in": 182000, "tokens_out": 4100,
      "verify": true, "secs": 210.4 },
    { "name": "99-pr", "runner": "run", "ok": true, "exit": 0, "secs": 4.0 }
  ],
  "changed": ["Cargo.lock"],
  "pr": "https://github.com/me/my-site/pull/12",
  "merged": false,
  "cost_usd": 0.12,
  "secs": 216.0,
  "logdir": "/Users/me/.caffeine/runs/2026-11-29/deps/my-site/070002"
}
FieldMeaning
okEvery step passed, or a gate stopped the run with exit 78.
skippedStopped by a gate: nothing to do.
interruptedStopped by Ctrl-C or SIGTERM.
inboxId of the inbox item the run created, if any.
error, failed_stepWhy and where it failed.
steps[].runnerrun, claude, llm or cmd.
steps[].modelThe model role used.
steps[].fallback, steps[].attemptsThe role of the attempt that ended the step, and how many attempts ran, when there was more than one.
steps[].sandbox, steps[].engineWhere the step ran: a name from sandboxes: and its engine, or none and none on the host.
steps[].networkWhat it could reach: none, hosts … or full. See Network.
network_deniedKubernetes with hubble: count of the connections the network policy refused during the run, and the distinct hosts (host:port).
steps[].skipped, steps[].continuedSkipped by if: or an empty foreach; failed under continue_on_error.
steps[].cost_usdReported by the claude runner. Other runners report tokens or nothing.
changedFiles added, changed or deleted during the run, without .agent/.
pr, mergedSet by caffeine pr.
cache[]Per cache: entry: name, key, result (hit, prefix or miss), restored (the older key a prefix hit used), bytes restored (the archive for paths), restore_secs, save_secs when it was saved, warning when the store failed.

These files are the raw material for tracking your factory over time: retry rate per role, cost per useful run, which pipelines need human edits.

state.json and {{last_run}}

~/.caffeine/state.json keeps the date of the last successful run of each pipeline on each target:

{
  "my-site:deps": { "last_success": "2026-11-29" },
  "dir:/Users/me/notes:weekly-digest": { "last_success": "2026-11-22" }
}
  • Declared targets are keyed <target>:<pipeline>, however they run: a clone, their dir:, or a checkout recognised from the current folder all share one history. An anonymous folder is keyed by its path, dir:<path>:<pipeline>.
  • It moves only for runs that ended ok (skipped included) and were not dry runs.
  • {{last_run}} is that date, or today - since_days when there is none. A watch pipeline uses it to look only at what happened since the last run.

To replay a period, edit the date or delete the entry.

Work sessions

caffeine open <target> keeps a full clone in ~/.caffeine/work/<target>, separate from the run clones in ~/.caffeine/app/. A pipeline running on the same repo never touches your session, and caffeine close refuses to delete a session that holds unpushed work. See Command reference.

Other files in the home

PathWhat
~/.caffeine/memory/<target>_<pipeline>/Memory kept between successful runs (memory: true).
~/.caffeine/feedback.jsonlYour notes from caffeine feedback and caffeine reject.
~/.caffeine/inbox/<id>/Inbox items: item.json, the proposed ACTIONS.json, the approved subset.
~/.caffeine/locks/One lock per running target and pipeline.
~/.caffeine/logs/Output of scheduled runs.

caffeine gc keeps the runs, inbox and locks tidy.

On this page