Docs Concepts

Concepts

Sessions, events, turns, flags, datasets, experiments, graders, judges and benchmarks, each in a sentence or two.

The words coding.sh uses, in the order you meet them, with a link to where each one is used.

Recording

TermWhat it is
SessionOne run of an agent: a Claude Code conversation, a Codex thread, one coding.sh run -- <cmd>, or one trace from your own agent. coding.sh show <id> opens one.
Headless sessionA session the agent ran without a person at the keyboard (claude -p, the Claude Agent SDK, codex exec). Its stats.launch is "headless", and --where launch:headless finds them.
EventOne thing that happened in a session, in the coding.sh/trace v0 format, such as llm.call or tool.end.
TurnOne user prompt and everything the agent does until it hands control back. It ends with a turn.end event.
Tool callA tool.start and its tool.end: a shell command, a file read or edit, a fetch or an MCP tool, with input, output and duration.
Model callOne request to a model, stored as an llm.call with tokens, latency and cost. Hooks do not see them, so most adapters read them from the transcript. See Agents and OpenTelemetry.
Replaycoding.sh exp replay sends a logged model call again with one thing changed, several times per arm, and compares the arms.
Forkcoding.sh replay <session> --step N --fork sends the call behind step N again with changed context files or another model. Needs the proxy.
SubagentA child agent a session started, such as Claude Code's Task tool, stored as its own session with a parent id.
Harness childAn agent started by another agent's shell tool, such as codex exec from Claude Code's Bash tool. Its parent.type is "harness". An id a hook names links the child only when that session is in the store and was open when the child started, so a shell that outlived its agent starts top-level sessions.
RunA top-level agent and every subagent under it, as one tree. coding.sh tree <session> shows it with per-node cost, tokens and flags.
Spool, index and blobsHooks append raw events to ~/.coding.sh/spool. Ingest moves them into index.db and large payloads into blobs/. See Storage, sinks and privacy.
SinkA remote copy of your events over OTLP or HTTP, metadata only unless you set mode = "full". See Configuration.
ProjectA namespace on a shared coding.sh serve server. See PRODUCTION.md.

Flags

A flag is a failure pattern found on a session at each ingest. coding.sh sessions --flag <name> lists the sessions that have it.

FlagThe session
premature-completionstopped while the last test run was failing, and the agent's last words did not say so. Saying "2 tests still fail" is not flagged.
repeated-tool-failurehad the same tool fail three times in a row with similar input. A search that found nothing is not a failure.
no-verificationchanged files, but no test, type check, lint or build ran.
compactionhad its context compacted.
test-tamperedited a test or test-runner config to hide failures: a skip marker, a test file deleted while tests failed, or an assertion change that alone turned a run green.
duplicate-fetchrepeated three or more read-only calls in one context with the same result and no edit in between.
skill-copy-conflictused two copies of one skill, such as the project's and a personal one.
refusalhad a model call stop on a refusal (refusal, content_filter or safety).
text-tool-callhad the model write a tool call out as text, so it never ran. Usual cause in Claude Code: a subagent whose tools: frontmatter is a map, not a list. List the tool names, or deny some with disallowedTools: Edit, Write.
unapproved-actionran a destructive or paid command the user's turn did not approve, such as rm -rf outside temp and build dirs, git reset --hard, git push --force or dropping a database.
looping, failure-streak, churn, no-progress, stalled, context-thrashwent off the rails in a long run. These are derails. See Derails.
step-retried, resumedis a durable workflow run that retried a step, or continued after a crash or restart. Notes, not failures. See Trace a durable workflow.

For unapproved-action, a turn approves a command when it asks for it, says yes to the agent, or gives leave in advance ("you don't need to ask"). A Claude Code permission prompt counts too. Codex approval prompts are not seen. Dry runs, read-only commands and a package manager's own -y are never flagged.

unapproved-action and premature-completion read word patterns, not a model. The full rules, including what each flag leaves alone, are in src/core/sessions.ts and the files its FLAGS list names.

Tags

A flag with a colon, such as gateway:vercel, is a tag rather than a failure.

TagAdded when
skill:<name>the session used a skill, through the Skill tool or a file in the skill's folder.
hook:<source>another hook added text to the context, such as hook:plugin:terse. stats.hookContext counts its tokens.
secret:exposedredaction replaced a vendor token. The agent and its provider saw it, so rotate it. A made-up example key adds no tag.
model:switchthe model changed mid-session. stats.modelSwitch names both models and the cost difference. A helper model, such as Claude Code's title calls, is not a switch.
model:fallbackthe agent recorded a fallback, such as Claude Code's --fallback-model when the main model is overloaded.
cache:lowa session of three or more turns wrote a prompt cache of at least 4,096 tokens but read back fewer than it wrote. coding.sh usage --cache shows the ratio.
fold:errorcoding.sh could not fold the session's events into stats (a coding.sh bug). coding.sh ingest tries again.

What each tag's stat holds is in the API reference.

Evaluating

TermWhat it is
CaseOne input to test, with an optional expected answer, metadata and a split (train, dev or test).
DatasetA named list of cases. Each change makes a new version named by a content hash, so an experiment records what it ran on.
TaskWhat an experiment runs for each case: a command that reads the input on stdin and prints an answer, or an HTTP endpoint.
ExperimentOne graded run of a task over a dataset. coding.sh exp run makes one and coding.sh exp compare pairs two by case.
GraderScores one output: built-in ones such as exact, regex or json-schema, your own script (command) or code (module), or a model (llm).
JudgeAn llm grader. It is trusted only after coding.sh judge calibrate measures its agreement with your labels. Reports mark uncalibrated judges.
ScoreOne typed value on a session, event, case or eval run. Labels are human pass or fail scores. See Scores.
Eval taskA repo-replay task drafted from a session: the starting repo, an instruction, a verifier and the session's diff as the reference. See Turn a session into an eval.
Eval suiteA folder evals/<name>/ with a suite.json. eval run never fails on a capability suite, and exits 1 when a regression suite's task fails most trials. See Your first eval.
Harness bundleA snapshot of an agent's setup: config files, instructions and model. coding.sh harness snapshot makes one and coding.sh compare <a> <b> runs two on the same tasks. See Compare two agents.
BenchmarkA bench/<name>.toml that samples fresh cases each run and runs every contender on them. coding.sh bench show prints the leaderboard.
Tool evalsHow well agents use a CLI, MCP server or HTTP API, across variants of its descriptions. See TOOL-EVALS.md.

Reading results

TermWhat it is
Paired comparisonHow exp compare decides. It is better or worse only when the paired bootstrap interval excludes zero and an exact sign-flip test has p below 0.05, which needs at least 6 changed cases or clusters. Otherwise it is inconclusive.
Minimum detectable effect (MDE)The smallest true gap a comparison finds 80% of the time. A small suite may have none: no 80% power at this n.
pass@k and pass^kOver k trials, the chance that at least one passes, and that all k pass. A task that passes some trials and fails others is flaky.
Seq@kWith exp run --seq K, a failed trial is tried again with feedback. Seq@k is the share solved by attempt k. See Sequential attempts.
Regression to the meanA change run only on the cases a baseline failed looks better even when it does nothing. exp compare marks such a pair inconclusive. See Running a subset.
Judge-corrected deltaHuman labels on a sample of each arm correct an LLM judge's B − A for the judge's own errors. See Correcting a judge's delta.
Signal validityWhether a flag or tool errors predict failure beyond task difficulty. compare --signals prints it. See Do the flags predict failure?.
Plausibly best setWith three or more configs, the ones not significantly worse than the best. exp sweep prints it.
Item difficultyA per-task difficulty from an item response model fit on stored runs. compare --pick N --pick-by irt runs the most informative tasks first. See Picking tasks.
Forgetting guardexp sweep --guard keeps the start config when the winner breaks what it solved on earlier suites.
Repair roundWith compare --repair N, a run whose verifier fails goes back to the agent, up to N times. A round that edits, deletes or skips tests does not count. See Repair rounds.
Agent releaseThe agent version a compare run started on. When the two arms ran on different releases, compare says so and --promote holds.
Protected lineA harness line an edit may not delete or relax, such as "Never run git push --force". refine check and exp ab reject an edit that drops one. See Protected safety lines.
Memory auditcoding.sh harness audit counts the sessions that loaded, read and wrote each memory and instruction file, and flags files never read. Each session keeps the files its events name in stats.memoryUse. See Memory and instruction files.