Configuration & state files
Every config/ file, the key data/ and state/ files, .env, and the environment variables worth knowing — with defaults and whether secondmates inherit them.
docs/configuration.md (about 2,400 lines) is the authoritative owner of layout and schemas. This page indexes the parts you are likely to touch. All of config/, data/, state/, projects/ and .env are local and gitignored.
config/ — your operating choices#
Each file is tiny, often one word. Absent means default.
| File | Purpose | Default (absent) | Inherited by secondmates |
|---|---|---|---|
backend |
tmux / herdr / zellij / orca / cmux / paseo / t3code / tern (experimental, explicit only) / hc (experimental, also auto-detected inside a Herdr app terminal) / rex (also auto-detected) |
auto-detect, then tmux | yes |
crew-harness |
harness for crewmates | first mate's own | yes (literal file) |
crew-dispatch.json |
natural-language dispatch rules (Scaling) | none | yes |
secondmate-harness |
<harness> [<model>] [<effort>] for secondmate launches. Optional mate <secondmate-id>: <harness> [<model>] [<effort>] lines pin one named mate. Order: that mate's line, the default line, crew-harness, own. Once a file has a mate line, a malformed file is an error, not a fallback |
crew-harness → own | no |
claude-permission-mode |
bypass or auto |
bypass (--dangerously-skip-permissions) |
yes |
codex-approval-mode |
bypass or approve-for-me (--approve-for-me, a model reviewer) for Codex workers |
bypass (--dangerously-bypass-approvals-and-sandbox) |
yes |
codex-permission-mode |
bypass or restricted (--sandbox workspace-write --ask-for-approval on-request) for Codex workers; restricted replaces the approval-mode flag |
bypass |
no |
claude-account, pi-account |
pin worker logins | ambient login | no |
claude-accounts |
one Claude account per line (ordinary or an absolute Claude config dir). Every Claude ship or scout spawn must name one with --account <entry>, chosen under quota-array-dispatch. Can't coexist with claude-account |
off (--account refuses) |
no |
codex-accounts |
one Codex home per line (ordinary = ~/.codex, or an absolute CODEX_HOME). Every Codex ship or scout spawn must name one with --account <entry>. The launch unsets CODEX_API_KEY and CODEX_ACCESS_TOKEN |
off (--account refuses) |
no |
secondmate-accounts/<id>/claude-account, .../pi-account |
primary home: pin one local secondmate's own agent | home-wide pin | no |
crew-exclude-tools |
one exact tool name per line (e.g. mcp__<server>__<tool>) hidden from ship and scout workers. claude, pi and pi-signed can hide tools; any other runtime refuses the launch. Claude launches with --disallowedTools '<names>', which drops each listed tool's schema from every model request; an entry may be a whole server (mcp__<server>). A misspelled Claude name is silently ineffective |
nothing hidden | no |
project-capacity |
one line per project, e.g. my-project 2: how many ship and scout workers it runs at once on this machine. A spawn beyond it is deferred; a malformed file refuses fresh spawns |
uncapped | read from the root home by every local home |
lane-capacity |
first line: one non-negative integer, how many ship and scout lanes this home runs at once, or auto for a budget measured from this machine's free memory, run queue and disk (auto-only keys max-lanes, min-gpu-free-gb; needs jq). Optional keyed lines follow (min-avail-gb, min-disk-gb, pressure-file, reserve-flag, captain-idle, quota-provider, max-load1). Opt-in admit-spawns makes bin/fm-spawn.sh defer (exit 75) a fresh ship or scout the verdict does not admit; without it no spawn reads the verdict. While it exists, the watcher publishes this home's lane facts to state/lane-capacity.json via bin/fm-capacity.sh --publish. bin/fm-capacity.sh reports open lanes against it, plus load, free memory and free disk. It reports free_lanes=0 when load ≥ cores, memory free < 10%, or disk free < 5120 MB. Secondmates hold no lane |
no target, counts only | no |
backlog-backend |
manual to hand-edit the backlog |
tasks-axi |
yes |
brief-include.md |
standing text appended to every brief | none | no |
branch-prompt-include.md |
standing home rules appended verbatim as # Home prompt additions to the supervision branch's system prompt. A path that isn't a readable regular file stops the branch from starting |
none | no |
calm |
on / off |
off |
no |
supervision-branch-model, supervision-branch-effort |
Pi supervision-branch pins (/supervision-model) |
follow main | no |
supervision-host |
opts a home into headless supervision beside non-Pi primaries and picks its engine (<engine> [<model>]) |
on for a Claude primary; off for Cursor, OpenCode, omp, Grok, Codex | no |
supervision-host-off |
presence flag, whatever it holds → opts the home out of the supervision host on every primary | absent | yes (primary-authoritative) |
warm-compact |
presence flag → the supervision host sends /compact to an idle Claude primary and its engine conversation before the prompt cache expires. Optional lines idle-seconds=<n> (default 2700) and min-context-tokens=<n> (default 80000). Needs the supervision host beside a Claude primary |
off | no |
codex-stop-park |
empty presence flag → a Codex primary waits for watcher wakes outside the model, in the native Stop hook. Only a native interactive Codex session registered through the project SessionStart hook and holding this home's session lock parks, on a canonical codex-cli release at or above 0.163.0; otherwise foreground checkpoints. Read at session start |
off (foreground checkpoints) | no |
wait-no-turns |
presence flag → a waiting worker spends no turns: ship/scout briefs gain # Waiting, workers don't poll the inbox, pending-reply recovery holds during the mate's open decision, an unlanded fire-and-forget steer gets one more ring |
off | no |
keep-ai-trailers |
presence flag → keep AI co-author trailers in fleet commits | off (trailers stripped) | yes |
startup-memory-budget |
token budget for captain/learnings memory | 7500 | yes |
stow-pass-horizon |
opt into pass-count memory decay | wall-clock only | no |
stow-guard |
presence flag → a Claude Stop hook (bin/fm-stow-guard.sh) asks a Claude primary to run /stow once context reaches tokens (default 300000) or the last /stow is hours old (default 24). Optional lines tokens=<n> and hours=<n>. Silent in crew worktrees and secondmate homes; never compacts itself |
off | no |
wedge-alarm |
away-mode alert channels: off, auto, osascript, herdr, command:<cmd> |
auto (macOS notification) |
— |
firstmate-role |
firstmate-repository publication role: maintainer <scope> lets this home publish to firstmate's upstream |
user/operator (no upstream publishing) | yes, under the resolved-role and receipt policy, not as a raw copy |
fleet-ledger |
presence flag → state/fleet-ledger.jsonl |
off | no |
pr-health-monitor |
presence flag → on PRs this home owns, wake once per latest commit for a conflict, a failing check, or an author action (CHANGES_REQUESTED or a waiting-on-author label). Maintainer-gated CI and missing required reviews go to state/pr-health.json without a wake. Reads follow GitHub notifications, with a 15-min fallback sweep. Further reports each need their own empty file: pr-health-any-failure (a non-required failing check, printed only when a later pass still sees it on the same commit), pr-health-approved-green (never merges), pr-health-final (merged or closed, once) and pr-health-stale-review (changes requested on an older commit). pr-health-label-gated lists checks that a PR label releases. They take effect on the next check |
off | no |
pr-follow |
presence flag → firstmate follows a GitHub PR or GitLab MR only when you explicitly ask it to, recorded in data/pr-follows.json. Merged, closed, a newly failing check, or requested changes each appear as one direct transcript line with the URL. No task is created and no model turn runs. Supported on Pi/pi-signed and on Claude Code with Calm's outcome surface active |
off | no |
pr-register-scan |
presence flag → the watcher's check sweep runs bin/fm-pr-check.sh scan. It records a ship task's PR only from a ready report: the newest crew status line must be exactly done: PR <url>, PR <url> checks green or PR <url> published for review. A later paused: line naming only that same PR does not withdraw it (punctuation around the URL and a #fragment are ignored); a paused: line naming no PR or another PR does. It records it when the task has no pr= (or that pr= with no merge poll). A different ready PR replaces a pr= the status log named, moving the merge poll. A refusal, such as a draft, or a registration cut at the scan's time bound, wakes once as check: pr-register:; later sweeps retry silently |
off (pr= only from a manual fm-pr-check.sh) |
no |
pr-degraded-watch |
presence flag → the merge poll also wakes once when a ready PR or MR degrades: a GitHub failing check, a GitLab failed pipeline, or a merge-train drop. Repeats of the same transition stay silent | off (merged wake only) | no |
park-on-review |
presence flag → stop the idle agent of a ship lane whose PR or MR only awaits human review (bin/fm-park.sh). The lane relaunches a fresh worker on review activity and is cleaned up on merge |
off | no |
auto-land |
presence flag → the watcher also cleans up unparked ship lanes on merge | off | no |
hold-pr-settle |
presence flag → the contribution observer settles captain holds that declare a PR policy (fm-captain-hold.sh pr-policy) when the PR merges or closes. An unmerged closure of a still-open hold's PR arrives as a contribution notification. Takes effect on the next contribution poll |
off | no |
hold-answer-words |
empty presence flag → captain-hold intake refuses an answer that is only an option selection (e.g. A) without its displayed words, and answered resolution records end with a Selected answer: line. Takes effect on the next command |
off | no |
pr-squash-summary |
presence flag → a GitHub squash merge by bin/fm-pr-merge.sh, with no caller subject or body, uses the PR title plus (#N) as subject and the PR body's ## What Changed section as body. Overrides the repo's squash message setting |
off (repo's squash text) | no |
pipeline-spend |
presence flag → teardown records each ship task's no-mistakes spend (per run, per purpose) as one line in data/pipeline-spend.jsonl via bin/fm-pipeline-spend.sh |
off | no |
record-hygiene |
presence flag → session-start bootstrap prints a RECORD_HYGIENE: line per inconsistent record (orphan status logs older than 24h, in-flight rows or metadata without a tab, duplicate pr=); the heartbeat raises check: record hygiene: when findings change. A mutating session start archives orphan logs to data/<id>/status.log |
off | no |
treehouse-pool-report |
presence flag → bootstrap prints read-only TREEHOUSE_POOL_REPORT: findings: pools with unavailable project paths, unowned slots older than FM_POOL_ORPHAN_DAYS (30), duplicate-origin clones, leftover project-* pools. Needs jq |
off | no |
record-export-root |
one absolute path to a dedicated private root. bin/fm-record-export.sh sync copies a fixed allowlist of data/ and state/ records to <root>/live/; teardown archives meta, status and inbox under <root>/archive/<task>/<spawn_gen>/. Needs python3. Keep the root private |
off | no |
nm-home-resolver |
absolute path of a site-provided executable that maps a task copy to its no-mistakes home for host-side reads; an explicit NM_HOME wins |
off (ambient home) | no |
herdr-presentation-spaces |
on / off for one workspace per task |
on for Herdr ≥0.8.0 | yes |
osc7501-status |
on / off for the worker-side OSC 7501 status bridge: workers report idle/working/blocked/done to herdr-core, the Herdr app, Ghostty or Rex. Harnesses that report natively are skipped. An unrecognized word reads as off |
on | — |
trace-context |
W3C trace-context to workers | off | yes |
turnend-churn-absorb |
pane churn counts as activity | off | no |
turnend-abort-absorb |
presence flag → absorb a bare turn-end when the task's no-mistakes run has an explicit abort record and its busy-state verdict is busy and newer than that run. A run that failed for any other reason still surfaces | off | no |
wedge-defer-parked-gate |
defer wedge alarm at the first mate's own gate | off | no |
wedge-defer-worker-wait |
presence flag → defer wedge alarm while the lane's newest status line is its own still-open blocked: or needs-decision:; a newer status line or acknowledged inbox record ends it |
off | no |
wedge-defer-validating |
presence flag → defer wedge alarm on the FM_PAUSE_RESURFACE_SECS cadence while the lane's attributed no-mistakes run is validating (running) or validating (fixing) |
off | no |
spawn-base-primary-checkout |
presence flag → a fresh local-only ship, or a scout without --base-branch, starts from the primary checkout's default branch when it strictly contains origin's tip; fm-review-diff.sh reviews such a task against the branch it delivers to |
off (origin's tip) | no |
pause-ceiling |
presence flag → an overdue paused: wait opens one blocked [key=paused-overdue-<task>] decision instead of the FM_PAUSE_RESURFACE_SECS recheck. A dated pause is overdue FM_PAUSE_RESURFACE_SECS past its until; an undated one after FM_PAUSE_UNDATED_MAX_SECS (86400). It never interrupts or tears anything down |
off (recheck cadence only) | no |
paused-wait-supersession |
presence flag → the foreground watcher surfaces a paused: lane ahead of the FM_PAUSE_RESURFACE_SECS cadence once its run is parked at a human-owed gate with no open decision, or is terminal. Away mode is unchanged |
off | no |
paused-recheck-silent |
presence flag → the FM_PAUSE_RESURFACE_SECS recheck of an unchanged paused: declaration queues no wake while the agent is alive, its until is not due, and no decision is open. A changed line, a due time or an open decision still wakes. Captain-held transfers are not affected |
off (every recheck wakes) | no |
open-decision-reminders |
presence flag → the watcher queues a check: open decision overdue wake for an unanswered keyed needs-decision/blocked line after FM_OPEN_DECISION_OVERDUE_SECS (1800); repeats double up to FM_OPEN_DECISION_BACKOFF_MAX_SECS (14400) |
off | no |
read-repetition.json |
Linux Pi primary only: {"enabled": true, "repeatLimit": 3, "windowMs": 900000} stops the primary after 3 identical successful reads within 15 minutes, until fresh user input |
off | — |
wedge-evidence-guards |
absolute paths to operator guard executables, one per line, asked before a wedge escalation | off | no |
watched-tools.json |
tools to watch for updates. An entry with command can add published ({"source":"npm","package":"tasks-axi"} or {"source":"github","repo":"herdrdev/herdr"}) to compare the installed version with npm's latest dist-tag or GitHub's latest release, via curl, with no login |
not armed | no |
self-update-source |
one line, <remote> <branch> (e.g. fork carry), that /updatefirstmate follows instead of origin; nothing else reads it. An unusable file stops the update |
origin | no |
usage-warner |
<window-id>:<percent> lines (e.g. seven_day:90): Claude usage-window thresholds for the opt-in macOS warner armed with bin/fm-usage-warner.sh arm |
not armed | no |
launch-env-allowlist |
env names passed to workers ("not a sandbox") | unfiltered | — |
launch-env-tmux-session |
Orca only: a tmux session whose local environment supplies the allowlisted values; needs launch-env-allowlist; a listed name missing from the session stops the spawn; also sets GIT_CONFIG_NOSYSTEM=1 |
absent (values from the Orca terminal) | no |
lavish-axi-host |
per-machine Lavish server address | ambient | yes |
cmux-socket-password |
cmux control-socket password | CMUX_SOCKET_PASSWORD |
— |
watch.env |
home-local watcher tuning as exported shell assignments (e.g. FM_PAUSE_RESURFACE_SECS). bin/fm-watch-arm.sh loads it before x-mode.env; bootstrap never removes it. The Codex checkpoint route without supervision-host and the away-mode daemon don't read it |
watcher defaults | — |
x-mode.env |
generated Relay watcher cadence | — | — |
"—" means the doc doesn't state inheritance for that file. When inheritance matters, check the row for that file in the on-demand operational-home-layout skill (.agents/skills/operational-home-layout/SKILL.md), which moved out of AGENTS.md in September 2026.
.env#
| Key | Enables |
|---|---|
FMX_PAIRING_TOKEN (+ FMX_RELAY_URL, FMX_DRY_RUN) |
Relay |
FM_DISPATCH_PROVIDER (typesafe, openrouter, systemone or openai), FM_DISPATCH_MODEL |
typed dispatch resolution; absent provider keeps the typesafe.ai jev-latest behaviour; openrouter, systemone and openai need a model |
FM_DISPATCH_BASE_URL, FM_DISPATCH_API_KEY |
systemone only: the http(s) base of a System One-compatible host (required; posts to <base>/v1/systemone) and an optional key (absent sends no Authorization header) |
TYPESAFE_API_KEY, OPENROUTER_API_KEY, OPENAI_API_KEY |
the selected dispatch provider's key |
TYPESAFE_BASE |
optional TypeSafe base (e.g. a gateway), default https://api.typesafe.ai; posts to <base>/v1/systemone; an invalid URL exits 2. For a gateway model ID, set FM_DISPATCH_PROVIDER=typesafe and FM_DISPATCH_MODEL |
FM_MAIL_USER, FM_MAIL_PASS, FM_IMAP_HOST/PORT, FM_SMTP_HOST/PORT |
mail plane |
Tracked config#
| File | What |
|---|---|
.tasks.toml |
tasks-axi backend config: data/backlog.md, done_keep = 10, archive data/done-archive.md |
.no-mistakes.yaml |
this repo's own gate: commands.lint: bin/fm-lint.sh && bash tests/fm-pi-primary-types.test.sh (shell/workflow lint, then the strict Pi typecheck), evidence on orphan branch no-mistakes/evidence |
.claude/settings.json, .pi/extensions/, .omp/extensions/, .cursor/hooks.json, .codex/hooks.json, .opencode/plugins/, .grok/hooks/ |
harness integration (Harnesses) |
data/ — durable records#
| File | What | Who writes |
|---|---|---|
backlog.md |
the task queue: In flight / Queued / Done, dependencies, holds | tasks-axi (via the first mate) |
projects.md |
project registry: mode, yolo, branch prefix, forge | first mate (project-management) |
secondmates.md |
local and remote routing table | secondmate seed helpers |
captain.md |
your preferences and working style | first mate, inspect-then-update; curated by /stow |
captain-shared.md |
preferences propagated read-only to secondmates | primary only |
learnings.md |
fleet gotchas: dated, evidence-backed, pruned | first mate / /stow |
memory-archive.md |
cold tier for expired memory | /stow |
<id>/brief.md, <id>/report.md |
task contract; scout deliverable | fm-brief.sh; the worker |
status-report-<date>.md |
/bearings file output |
/bearings |
Edit captain.md yourself
data/captain.md is the right place for durable preferences ("always squash", "never touch the payments module without asking", "prefer codex for Rust"). The first mate reads it at every session start. /stow keeps it pruned.
state/ — runtime#
| Path | What |
|---|---|
.lock, .lock-session |
per-home session lock |
.wake-queue |
durable actionable wakes |
.last-watcher-beat, .watch-triage.log, .watch-cycle-exits.log, .watcher-down |
watcher health |
.afk, .afk-contract, .subsuper-* |
away and quiet posture |
.lease-<task> |
main/branch actor lease |
<id>.status, <id>.meta, <id>.inbox/, <id>.busy-state |
per task (Briefs & status) |
fleet-ledger.jsonl |
opt-in ledger |
public-followup/, x-outbox/ |
Relay promises; dry-run outbox |
reconcile-requests/ |
board "reconcile" requests |
Environment variables worth knowing#
| Var | Default | What |
|---|---|---|
FM_HOME |
repo root | which home to operate on; fm-send.sh requires it explicitly |
FM_BACKEND |
— | backend override for new spawns |
FM_POLL |
15 | watcher cycle, seconds |
FM_HEARTBEAT / FM_HEARTBEAT_MAX |
600 / 7200 | backstop cadence |
FM_STALE_ESCALATE_SECS |
240 | idle-without-proof threshold |
FM_BUSY_TURN_MAX_SECS |
3600 | max single busy turn |
FM_PAUSE_RESURFACE_SECS |
14400 | recheck for paused / captain-held |
FM_WEDGE_DEMAND_INSPECT_COUNT |
3 | stale wakes before a deep inspection |
FM_WEDGE_MAX_ESCALATIONS |
0 (off) | cap on consecutive wedge escalations for one worker window; at the cap, one PERMANENTLY-WEDGED wake, then silence. rm state/.wedge-permanent-<key> re-engages at once |
FM_CAP_HORIZON_SECS |
86400 | how long a fired cap silences that window |
FM_MAX_DEFER_SECS |
300 | away-mode injection defer before the wedge alarm |
FM_CODEX_WATCH_CHECKPOINT |
180 | Codex foreground checkpoint |
FM_SNAPSHOT_UNDATED_HOLD_AGE_DAYS |
14 | hold becomes aged |
FM_FLEET_PRUNE |
1 | prune merged branches in clones |
FM_BOOTSTRAP_DETECT_ONLY |
— | 1 = read-only bootstrap |
FM_ZELLIJ_SESSION |
firstmate |
Zellij session name |
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS |
— | 1 enables /calm on Claude Code (you set it) |
Two things are set on every worker launch automatically:
COMPACT_ADVISER_DISABLE=1(no knob)- Claude attribution cleared (
attribution:{commit:"",pr:"",sessionUrl:false}), Devin attribution off, plus a per-task hooks path that strips AI commit trailers.
Firstmate never adds an agent as a co-author. The one knob is config/keep-ai-trailers: with that presence flag set, the attribution-off settings and the strip hooks are skipped, and each harness's own attribution applies (Devin's user-config setting, which defaults to on). The flag is local and gitignored, and secondmate homes inherit it.