Troubleshooting
Read this page when a stamity run fails, or when check prints a row you do not recognise. You
leave with the meaning of that row or that error code, the command that fixes it, and the place
to report what nothing here fixes.
Start here:
npx @zomarit/stamity check
A healthy repository answers like this, every row reading ok. On a repository whose gate
commands detection could not resolve, four warning: the <gate> gate cannot be resolved lines
precede an ok — 4 advisory warning(s) above close instead of setup green;
config set gates.<name> "<command>" settles each (gates.all for the full gate).
doctor
ok node-version Node 22.22.3 satisfies >=22.22.2
ok git-available git reports a clean working tree
ok manifest .stamity/manifest.json is valid — schema 2.0.0, tools claude, 75 managed path(s) (75 ledger rows across 1 client(s))
ok state-dirs .stamity/learnings, .stamity/handoffs are present
ok learnings no learnings recorded yet
ok tmp-hygiene no writer temp files left behind
ok env-mcp no MCP servers selected, so no credentials are required
ok tool-traces all 1 target tool(s) have emitted files recorded in the ledger
ok claude-hook-shell not a Windows host: the client hands hook commands to sh, where the anchored commands parse (Git Bash is a Windows-only requirement)
ok preserved-duplicate 1 managed file(s) carry their block once
ok pack-integrity no installed pack content is recorded in the ledger
ok pack-reach no installed pack is recorded in the ledger
ok pack-catalog no installed pack is recorded in the ledger
ok moved-skills no override, overlay or core copy of a skill that moved to a pack
ok legacy-files no legacy prompt file or companion an earlier release wrote is left untracked
ok autonomy-deploying no .github/workflows folder, so no workflow deploys on a push
ok model-pins no selected client lists its models (claude runs on its family aliases)
ok invariants invariants 1.4.0 · ratified 2026-08-31 · last amended 2026-11-09
drift: clean — every generated file matches what a sync would write
provenance (the manifest is the record): generated by 1.19.1 · updated 2026-11-11T09:01:05.382Z · schema 2.0.0
claude: 74 file(s)
setup green — gates not run: lint, typecheck, test (check runs no gate)
Almost every question on this page is one check already answers. It reads only. Nothing on
this page's diagnosis path writes to your repository.
What a failed run tells you
Three exit statuses, and only three.
| Exit | What it means |
|---|---|
0 | the command succeeded — --help and --version leave through here too |
1 | the command ran and failed |
2 | the command line was rejected before any command ran |
A failure is always 1. Which failure it was travels in the error's code field, not in the
exit number. Re-run with --json and read error.code. A CI script branches on that string,
because there is no second numbering to read.
On exit 2 stdout is empty. The command line never reached an action, and the diagnostic is
on stderr. Parse stdout only after checking that the status is not 2.
The CLI reference lists every error code and what it classifies, including
the two that exist only at the CLI edge. The codes this page names are VALIDATION_ERROR,
CONFIG_ERROR, INTEGRITY_ERROR, FS_ERROR, LOCK_TIMEOUT, EXPECTATION_ERROR and
AUTONOMY_LOOSENED.
What check prints
Eighteen probes, then the drift gate, then a provenance rollup. Four more rows print only where
they apply, all before invariants: copied-skills where .stamity/skills/ holds a record of a
skill skill add copied in, land-job-workflows with autonomy.landJob on, cloud-install
in a repository that targets Cursor, then change-classes in one that holds a
.stamity/change-classes.json. A run given an --expect-*
flag prints one more row, expectations, after invariants.
Each probe reads ok, warn or fail. A fail takes the exit code to 1. A warn is
advisory and leaves it at 0. That split is deliberate. A missing state subdirectory or an
absent git binary is a legal repository, and a run that failed on those would train you to
ignore check altogether.
Only eight rows can fail: node-version, manifest, claude-hook-shell, pack-integrity,
pack-reach, moved-skills, change-classes and expectations. A probe that cannot
run at all warns instead, saying could not be checked: and why. Every other row still prints.
| Row | What a bad verdict means, and what to do |
|---|---|
node-version | Can fail. Your Node is below the range this build declares. Install a Node in that range, or switch to one with your version manager. Then re-run. |
git-available | Warns when git did not answer, with one of three texts, and none of them names a git command to type. Two open with git did not answer here, and the row tells them apart by what the engine itself found. The first says the engine found no git to start. The engine takes git only from a PATH entry that is a full path to a folder other than the one the verb runs in: an empty entry, a relative one and an entry that is that folder are skipped. So this text prints where no git is installed, and also where your only git sits behind an entry the engine skips, which a git typed at your prompt may still find. Install git, or put the folder that holds it on PATH by its full path. The second says the engine found a git binary on PATH, which leaves two causes: this is not a repository, or git was only slow to answer this check. Tell them apart by a step that runs no git, as the row says: a .git entry in this folder or in a folder above it, found by name, shows whether a repository is. You should run no git here to find out. With a .git entry there, git was slow, or that .git is one git cannot open and git itself refused a folder with the layout the third text describes: look for that layout by name before you run git by hand. Nothing check, init, sync, validate or config does needs git. Six verbs do. The worktree verbs refuse with VALIDATION_ERROR without it, and their refusal tells the first two causes apart as this row does: where the engine found no git to start it says so and which PATH entries git is taken from, and otherwise that the folder is in no repository. init's no-git note has the same two texts, and its question, its security line and its refusal when you decline the question follow them. After a guided migration its line on the previous setup's uninstall says to copy your own files out, where it says to commit wherever git answers. None of these names a git command. The hidden verb gate reads every change from git: with no git or no repository gate scan exits 1, so /st-quick and /st-work list secret scan: not run under Not done:. The hidden verbs plan and run, which an unattended run calls, exit 1 with no git work tree, run overview and run metrics aside, so an unattended run cannot start there. gc exits 1 without git, before it frees anything, and skill add fetches through it. Where git was only slow, all six may still run. Sync's dirty-tree warning stays silent while git does not answer, and a sync that wrote files closes on a review step that names no git command and points at this row. The third, git was not started here, is a fourth cause, and for it too the row names no git command to run. This folder, or a folder above it, has the layout of a bare repository (HEAD beside objects and refs, or beside commondir), met before any .git that git stops at, so the engine did not hand it to git. Look at the entries of this folder and of each folder above it by name to find that folder, and do not run git in it or in any folder under it, the one you stand in included: git started anywhere under it finds it as the engine did, and only the engine's own git calls are set to refuse such a folder. A flow is no exception: /st-work stops the run as BLOCKED_DEPENDENCY and /st-quick stops the batch, running no later step and no git command in that folder, the commit included, when gate says git was not started, but that stop comes at the gate call, and the git the flow's session and sub-agents start before it is not set that way, so start no flow there until the folder is moved, as the row itself says; SECURITY.md names the one git setting that covers git the engine does not start. Then move it off that path, or run the verbs from a checkout that does not keep it there. Until then worktree refuses with this cause, gate scan exits 1 saying git was not started, which stops either flow as above, and init's no-git note states this cause and says to start no flow there; none of the three names a git command there. init's ready panel, and the nextSteps of init --json, open with moving the folder before a client or a flow is started, and after a guided migration its line on the previous setup's uninstall says to copy your own files out without git, as it does wherever git did not answer. The row warns only of a folder met on the way up from the folder a verb runs in. A committed folder of that layout elsewhere in the tree, below the setup root, meets no look and no warning: this row says nothing of it and passes where git answers here, and git that anything other than the engine starts in or under that folder reads it where git can open it. The setting SECURITY.md names covers that placement too. sync stays silent on a dirty tree, and where it wrote files it closes on a review step with no git diff in it, which says to read the files it listed and to compare a file with the .bak a warning names for it. |
manifest | Can fail. Absent means this repository was never set up: run init. Defective prints the engine's own field-level message, so fix the field it names. |
state-dirs | Warns when .stamity/learnings/ or .stamity/handoffs/ is missing. Nothing is lost. Both stores recreate their directory on the first write, and sync rewrites them now. |
learnings | Warns when a recorded learning is invalid, or when it sits past the file cap. Neither kind loads. Run validate for the per-file detail. |
tmp-hygiene | Warns on a live concurrent write. It also warns on .tmp.stamity-<8hex> litter left by a write interrupted between the temp file and the rename. The engine token in that name keeps another tool's .tmp.<hex> files out of the row. The row reports; it never deletes. |
env-mcp | Warns when MCP servers are selected but .env.mcp is absent, and when a credential in it is still blank. A server whose credential is empty fails at start-up. config mcp add <id> recreates the file with the names those servers need. |
tool-traces | Warns when a client the manifest targets has nothing emitted for it in the ledger. sync writes that client's files and records them. |
claude-hook-shell | Can fail, on Windows only. The Claude hook commands this engine emits are anchored on ${CLAUDE_PROJECT_DIR} with a POSIX fail-closed tail, and they parse under sh and Git Bash. On a Windows host with no Git Bash the client falls back to PowerShell, where ${NAME} is PowerShell's own variable and the tail does not parse: the pre-tool-use guard never launches and the client does not block. The row looks where the client looks and nowhere else, in the client's order (vendor's troubleshoot-install page, read 2026-09-22): CLAUDE_CODE_GIT_BASH_PATH when it names an existing file called bash.exe, sh.exe, bash or sh — any other value, a directory or git-bash.exe included, the client ignores and so does the row; then bin\bash.exe under the default install locations C:\Program Files\Git and C:\Program Files (x86)\Git; then the git.exe on PATH, reading bin\bash.exe from that installation. A bare bash.exe on PATH (MSYS2, Cygwin, WSL's C:\Windows\System32\bash.exe) is not a place the client looks and does not count; a git.exe on PATH with no bin\bash.exe beside it (a shim, a relocated Git) fails the row with the variable as the remedy, since how the client resolves such a git is unstated. It fails when this repository targets claude and none of the three holds Git Bash. Install Git for Windows (Git Bash), or set CLAUDE_CODE_GIT_BASH_PATH to its bin\bash.exe in the environment — a value in settings.json's env block reaches the client, not a shell that runs check outside a Claude session; re-run check. On every other host, and where claude is not a target, it passes with a note saying which condition released it. |
preserved-duplicate | Warns when a managed file repeats its own managed block below the STAMITY:END marker. Your repository then loads that content twice. Delete the copy at the line the row names. The block itself is regenerated on every sync. |
pack-integrity | Can fail. An installed pack's bytes no longer match what was recorded at install. Re-install that pack: move any edited file the row names out of the pack's directory or delete it first — clean --pack keeps an edited pack file rather than deleting it, so the edit is not lost, and add would refuse it as a file the pack does not own; then run clean --pack <id>, then delete by hand each client copy it keeps and names, unless it is yours, then sync, then add <source>, then sync, where <source> is the catalog id, local path or package name its install receipt records, as the row's finding line for that pack prints it; when the receipt is missing or unreadable, the line says so, and you add the pack again from the source you installed it from. Do not run sync first: it would carry the edited bytes into your emitted setup. clean --pack removes the pack's client copies while the pack is still installed, and keeps and names a copy it cannot prove the engine wrote: delete each kept copy by hand unless it is yours, then run sync. |
pack-reach | Can fail. An installed pack none of whose artifacts reaches a client this repository targets: each artifact's own tools: list names no targeted client, so the pack installs, syncs and does nothing. Pack skills always reach. The row names the pack, each artifact and why. Remove the pack with clean --pack <id>, or, where its tools: list names a client, add that client with config set tools <list>, then sync. A pack MCP server reaches a client only once config mcp add <id> selects it, so a pack whose only remaining delivery is an unselected server warns instead, naming that command. It warns on a pack the organisation's trust policy denies, which is installed and projects nothing. It also warns for a pack that ships nothing a client loads — every hook row it ships rejected, which sync explains. It passes when no pack is installed or every pack reaches a client, and names any artifact that reaches none. When the plan cannot be built it warns not evaluated: and leaves the failure to the drift gate, which prints the cause. |
pack-catalog | Warns, and never fails. It warns on an installed first-party copy of a retired pack, naming where each of its parts went and the fix in order: clean --pack <id>, then delete by hand each client copy it keeps and names, unless it is yours, then sync, then add <successor> for each pack its parts moved to, then sync. It also warns on a pack installed from the catalog whose content is not the copy this release bundles, naming add <id> to update it. The comparison reads the install receipt's file hashes, never the version. When the receipt's bytes do not match its ledger row, the row skips the comparison and says so (pack-integrity fails on that receipt). A pack from a path or npm is judged only when its content is one a retired release shipped. It passes when no pack is installed or every catalog pack matches its bundled copy. |
moved-skills | Can fail. Two skills left the core for the frontend pack in 1.17.0: st-design-system-detect and st-browser-evidence. The row reads your override folder and the manifest's ledger directly, so it still answers when an overlay stops the plan and drift reads not evaluated. It fails on an overlay of either skill, a SKILL.customize.yaml or SKILL.customize.md under .stamity/overrides/skills/<id>/. Overlays on pack skills are not applied, so sync refuses that file whether or not the pack is installed. Fold the change into a full override under another id, or remove the file. To keep the shipped skill, run add frontend. It warns on a full override of either skill: a SKILL.md under .stamity/overrides/skills/ whose frontmatter id names it, in any folder, or one that declares no id in that skill's folder. With the pack absent, the override no longer replaces anything and tracks no shipped copy. Keep it, or remove it and run add frontend. With the pack installed, sync refuses that override, because it collides with the pack's copy. Remove or rename it, or remove the pack with clean --pack frontend. It also warns when the ledger still records the old core copies at .claude/skills/st-<id>/ or .agents/skills/st-<id>/ and the pack is not installed. sync removes an unedited copy and names an edited one it keeps. It passes otherwise. |
legacy-files | Warns, and never fails. It names each file an earlier release wrote that this setup no longer writes or tracks: a Copilot prompt file .github/prompts/st-<id>.prompt.md that no ledger row holds (Copilot's own touchpoint prompt files are still written and tracked), and a companion .agents/skills/st-<id>/agents/openai.yaml of a touchpoint or a pack command, which only Codex writes now. sync keeps such a file when it cannot prove the bytes are the engine's unedited output, names it once, and stops recording it, so after that run only this row names it. Delete each file it names by hand, unless it is yours. The row finds these files on disk by their fixed names, never through a ledger row. It reads names only, follows no link, and uses the ledger only to leave out a path a row still holds. It passes when no such file is there, or when there is no readable manifest to compare with. |
copied-skills | Warns, and never fails. It shows only where .stamity/skills/ holds an origin record of a skill skill add copied in, and re-hashes each copy under .stamity/overrides/skills/<name>/ against its record. It warns on a copy whose files changed, went missing or were added, on a record whose copy is gone, and on a record that does not read, a record listing a path outside its copy among them. Each line names the skill, the source, tag and commit its record names, and what moved. It never fetches, so it says nothing of the source. Re-copy the skill with skill remove <name> and then skill add in an attended session, or keep the edit as your own override by removing its origin record. It passes when every copy matches its record. |
autonomy-deploying | Warns, and never fails. A push to a branch that autonomy.deployingBranches does not list runs unasked, and in autonomy.mode: autonomous (the default) the land verb merges into the default branch on its evidence alone unless the list names it, and even then where a change fits autonomy.autoShip. The row warns, in both modes, on each job under .github/workflows/ that names an environment, itself or through a local reusable workflow it calls (uses: ./.github/workflows/<file>, followed at most three calls deep), and runs on a push to a branch the list does not cover. For a branches: list, that is the default branch when the list matches it, plus each branch or pattern the list names. A bare push, a push with no branch filter, and a branches-ignore filter run on every branch they do not exclude: the row warns on them until autonomy.deployingBranches holds **, and its fix is to add a branches: filter to the workflow or to set the list to **. In list entries and filters alike, * stays inside one path segment and ** crosses segments. In mode ask the default branch counts as covered, since that mode asks before a push or a merge there. Each warning names the workflow, the job and the branch, says whether the land verb would merge into it (the default branch) or an agent's push to it runs unasked (any other branch), and gives the fix: config set autonomy.deployingBranches <list>, then sync. A push filtered on tags alone names no branch. It warns not evaluated: on a workflow file that is a link or does not parse, on a branch filter holding ?, +, [, ], a leading !, or an entry YAML reads as a number, such as an unquoted 7.0 (name its branches in autonomy.deployingBranches; quoting the entry in the workflow lets the row read it), on a deploy reached through a workflow_run trigger, on one from a pull_request or pull_request_target event, whatever its types, on a call to a workflow in another repository, and on a local reusable-workflow call it cannot follow: a fourth call, a cycle, or a file that is not there. The default branch is the one refs/remotes/origin/HEAD names, else main, and the row then says it assumed main. It passes with no workflows folder and when every such branch is covered, and its pass names only what it read. A schedule trigger reads as a push to the default branch, outside mode ask, since a scheduled run deploys that branch's latest commit. A deploy reached through any other trigger the row does not read, such as create or merge_group, warns not evaluated: naming it. |
land-job-workflows | Warns, and never fails. Present only with autonomy.landJob on. GitHub starts nothing for a name no workflow carries, so a watched workflow that was renamed stops the land job with no other sign. Rename the entry in autonomy.landJob.workflows, or the workflow, so the two agree. Any change to that list is a loosening, so sync then needs the person's --loosen. |
model-pins | Warns, and never fails, when a model this repository pins or emits for a class is not on the client's own model list for your account, and an id the account does not offer fails the sub-agent's start on Cursor. For each targeted client that can list its models (Cursor, Copilot, Codex; Claude Code runs on its family aliases), the row reads the list the client's CLI prints now and, where the CLI is not on PATH, does not answer within 10 s or prints no list, the list the last sync saved in the git-ignored cache .stamity/client-models.json (or, on a 1.15.0 manifest, under its models.listed), never in the committed manifest. The model emission wrote is read from the committed files first. A cache that is there but cannot be read warns, naming it. For Codex the saved list is used whenever there is one, and only without one does the row read Codex's bundled catalogue, with no network call; the row says which list it compared with. With STAMITY_NO_CLIENT_PROBE=1 set it starts no client and reads the saved list only. Each warning names the client, the class and the model. For a pinned model, pin one the list holds with config set model.<class>.<client> <id>. For an emitted model, run sync, which reads the list again and picks again. On Copilot it also warns, naming both models, when the live list would make sync write a different model than the files carry, whether or not a list was saved. On Cursor only a pin is written, as typed, so the row checks pins alone there, and a pin the list holds reads unverified: Cursor checks a sub-agent's model against a narrower list that no command prints, so it may still refuse that pin. When a client has neither a CLI that answers nor a saved list, as on a fresh clone, which holds no cache until its own sync writes one, the row passes and says unverified and why. |
cloud-install | Passes, or warns, and never fails. Printed only when this repository targets Cursor. It prints the lines a Cursor cloud environment's install step needs: node --version, then the global install of the CLI at the version that generated this setup (the manifest's generatedBy), npm install --global <package>@<version>, with a registry fork's --@<scope>:registry=<url> ahead of the package. Without the CLI the flows' gate scan and ledger status calls fail in that machine. Set the lines in the install step of the environment you saved in Cursor. init and sync write no .cursor/environment.json, because Cursor uses a saved environment before a repository file, and a saved environment reads the file only when it points at it (Cursor's cloud agent setup page, read 2026-10-26). A package with no npm channel gets no install line, since a registry install would fetch whatever another publisher holds under its name; the row says to install the copy your fork distributes instead. It warns when the manifest records the root AGENTS.md as skip: sync then leaves that file alone, so the "Cursor Cloud specific instructions" section the engine adds to it for Cursor is missing from the file a Cursor cloud agent reads. Record supplement for AGENTS.md in .stamity/manifest.json to keep your text and carry the section, or copy the section in by hand. Copilot needs no such row while toolOptions.copilot.setupSteps is managed, the default: its copilot-setup-steps.yml runs the same install, unless the project's Node pin sits below the CLI's floor, where the workflow carries a comment instead. Under user the workflow is yours and needs the same install line; under off no workflow is written, and the cloud agent has no CLI unless its environment installs one. |
change-classes | Can fail. Printed only when .stamity/change-classes.json exists. That file holds this repository's own change classes and test-input map, which gate classify reads from a pull request's base commit, never from the change itself. It passes when the file is valid. It fails naming the first error: text that is not a JSON object, a key that is not classes or testInputs, a name that is not a change class, an empty glob, a glob longer than 200 characters or holding more than four ** (in classes and in testInputs alike), a glob under a class weaker than product that matches every path shape — a name, a dotted name, a dotfile, one and two folders deep — (such as "records": ["**"]), a records or docs glob whose extension holds a wildcard (such as **/*.* or notes/*.m*), which no extension list can bound, a records or docs glob whose last segment holds a * but ends in no concrete extension — a folder glob, a name wildcard or a wildcard folder, such as notes/**, **/README* or * (name the extension, as in notes/**/*.md, or the file), or a test entry that is not a plain repository-relative file path (one starting with -, holding a space or a glob character, absolute, or climbing out with ..). Some entries the row accepts are bounded when gate classify applies them: a code file, a config-format file (.json, .yml, .toml, .env and the like) or an extensionless file other than a doc name such as LICENSE never lands in records or docs, except that a config-format file under the engine's own record paths (.stamity/runs/, .stamity/handoffs/, .stamity/inbox.md) stays records; and a code file lands in tests only when a built-in test glob (test/, tests/, __tests__/, *.test.*, *.spec.*) matches it too. While a base commit holds a copy this row fails on, gate classify applies only that copy's product, public-contract and security-sensitive entries, no lowering entry, and gives every change at least product, so the full gates run. Fix the entry the row names, then re-run check. |
invariants | States which version of the charter's floor invariants the installed engine would write — the version, its ratification date, and its last amendment. Warns when the installed charter declares no version at all. That means an old package: upgrade, then sync. |
expectations | Can fail. Printed only when check runs with --expect-version or --expect-tools, which take what the repository must be from a caller a pull request cannot edit, such as a required workflow's input. It names each mismatch: generated by 1.11.0, expected 1.12.0 (the manifest's generatedBy), this check runs 1.13.0, expected 1.12.0 (the running CLI; both must equal the expected release), clients claude — cursor missing (the manifest's clients, compared as a set). The run then exits 1 with error.code EXPECTATION_ERROR, ahead of any drift, and the first steps under next: restore the expected state in a reviewed pull request: sync at the expected release, the same check run at that release, or config set tools <list> then sync. When --expect-version names a release, every one of those steps runs that release, so following them in order leaves generatedBy at it; without it they run the release that ran the check. In check --json, error.next holds the same steps in one string, separated by ; the way error.why separates the mismatches, one step per mismatch and in the same order. It reads not evaluated when the manifest cannot be read; the manifest row above names why. Without the flags neither the row nor the expectations key in check --json appears, and the rest of the output is unchanged. |
Below the rows, one question: would a sync change anything? That is the drift gate. It runs
the same read-only plan sync itself runs, so "check says clean" and "sync writes nothing" are
one statement rather than two implementations that must agree.
A drift line names how many files would change, how many ledgered files are missing, and how
many are queued for reclaim. It then lists them. Each reclaim line names the path, what the next
sync would do to it and why: delete, strip (the managed block goes, your text stays) or
reduce (a shared document loses the engine's entries) with the proof in brackets — hash,
block or co-owned — or keep, refuse or gone with the reason. Every delete line is
printed, however long the list. check --json carries the same list as drift.reclaim. A run
that exits 1 on drift alone reports INTEGRITY_ERROR in its --json output.
If the line reads drift: not evaluated, it names the real reason, and there are two. Either the
manifest could not be read, or the plan itself threw. For the first, the manifest row above
already says so, with the fix. A pack that bricks projection, invalid content and a malformed
override all throw. While the plan does not build, nothing is compared, so that run would not
detect tampering with a generated file.
Common failures
check refuses a manifest whose ledger names a path the engine does not write
The manifest row fails, and sync and clean stop with CONFIG_ERROR before they touch a
file:
`ledger[57].path` "docs/owner.md" lies outside the paths a stamity release writes for infra rows
(owner claude) — a ledger row authorises sync and clean to delete or overwrite its path, so the
row is refused
The ledger in .stamity/manifest.json tells sync and clean which files they may delete or
overwrite, and it is committed, so a row can be added by hand or by a pull request. No stamity
release writes a row outside its own paths — the platform files it writes, a charter
AGENTS.md, its state folders .stamity/generated/ and .stamity/mcp/, the hook folder
.claude/hooks/stamity/ Claude Code's hooks run from, an installed pack's
own folder and the folders it writes agents, skills, rules and commands into. So such a row
refuses the whole manifest rather than being acted on. Remove each row the message names, then
re-run the command. check --json lists the paths a release writes under ownedPaths.
A row inside those paths still proves nothing on its own. sync and clean delete or overwrite
a file without a backup only when its bytes still hash to what the row recorded, or a managed
block spans the file, and the place proves the rest. A row with no content hash keeps its file
unless a managed block spans it, and an overwrite of one takes a verified .bak first. So does
removing the engine's keys from a shared settings or MCP document such a row names.
What a delete needs. Under .stamity/generated/, .stamity/mcp/, .claude/hooks/stamity/
or a pack's own folder, the hash is enough. In an agent, skill, rule or command folder the name must be engine-minted (st-
or stamity-), and the name and the hash together are still not enough: the bytes must also hash
to a rendering the running engine produces at that path for the clients the setup wrote for. The
same holds at an AGENTS.md in any folder, AGENTS.override.md, CLAUDE.md, the Copilot setup
workflow, .github/hooks/stamity.json and Cursor's two 1.11.0 guard names, where the rendering is
the guard 1.11.0 rendered for that setup. A managed block that spans the file proves a delete at
any of them. There a forged row and hash, and an owner's copy of the charter's headings, no longer
prove a delete. Two exceptions take less proof: the setup workflow under
toolOptions.copilot.setupSteps: off, and the land job's workflow, which has no rendering once
autonomy.landJob is off. Read a pull request that sets either off and touches that row as one
that can delete the workflow. A file no
rendering proves is kept and named, on a line that ends
the file is kept; delete it by hand if it is yours to remove, and a sync drops its row from
the ledger. Such a file is an owner's, or an unedited stamity-* or st-* copy the running
engine does not render at that path: one an earlier release rendered (except the core copies of
the two skills that moved to the frontend pack and 1.16.0's touchpoint companions, which sync
deletes while their bytes are still that release's), or the copy of an override
you removed (Customization says how to clear those). When the renderings
could not be built at all, the file is kept with its row, and the next sync tries the proof
again.
What an overwrite without a backup needs. At an AGENTS.md in any folder,
AGENTS.override.md, the Copilot setup workflow and the land job's workflow the bytes must also
show the engine's own shape, and CLAUDE.md is proved only by a managed block that spans it. Elsewhere inside those
paths a whole-file overwrite rests on the matching hash alone. At those files, the land job's workflow aside, and at
.github/hooks/stamity.json the hash and the shape do not settle whose bytes they are, because an
owner's file can carry both. So unless a managed block spans the file, or the bytes on disk
already equal the new rendering once \r\n reads as \n, the overwrite keeps the previous
content recoverable. When git tracks the file with no uncommitted change, in a repository whose
top level is the setup root, the write takes no .bak and prints a notice: the previous content
is in git history, and the overwrite shows in git status. Otherwise it takes a verified .bak
and warns: for an uncommitted or untracked file, a setup in a monorepo subfolder, a charter
inside a submodule, and whenever git is absent or a git check fails.
check reports drift after you edited a managed file
You edited inside a STAMITY:BEGIN / STAMITY:END block, and the drift gate saw it:
drift: 1 file(s) would change, 0 ledgered file(s) missing, 0 queued for reclaim
update CLAUDE.md
That is the drift gate working. Managed blocks are regenerated, so an edit inside one is an edit the next sync overwrites:
npx @zomarit/stamity sync
To keep the change, move it outside the block. Text outside a managed block is yours, and it survives every sync. Where the edit belongs inside a shipped agent, rule, command or skill, author it as an override instead. Customization is that lane. If you deleted a generated file, sync rewrites it.
Your own hooks in Cursor's and Codex's hook files
.cursor/hooks.json and .codex/hooks.json are merged entry by entry, like
.claude/settings.json. The engine owns only the entries it wrote: those that run its scripts
under .stamity/generated/hooks/, and Cursor's two guards. It also owns Cursor's version and,
unless you wrote your own, Codex's description. Every other entry is yours, and sync, clean
and a client's removal leave it where it is, with no .bak. Add a hook of your own as its own
element of the event's array. A command added inside one of the engine's entries is replaced on
the next sync behind a verified .bak holding your edit, with a warning naming the entry. A
version other than 1 in .cursor/hooks.json is refused as a collision naming it.
Releases up to 1.6.0 wired each hook you define in .stamity/hooks/ straight into these files,
and wrote a top-level stamity block into .codex/hooks.json. On a direct upgrade the engine
re-renders that old wiring from each definition still in .stamity/hooks/. An entry equal to it,
and the old stamity block, are the engine's, so the first sync replaces them and your hook
runs once. An entry that differs from that rendering stays yours.
clean does not delete a hook script that a hooks file it keeps still runs. That covers a file it
cannot read, and Copilot's .github/hooks/stamity.json when you edited it. Each kept script is
reported as kept, naming the file. When such a script lives under .stamity/, clean keeps
.stamity/ and says so, and clean --json lists those scripts as stateDirKept. It keeps
.stamity/ too when the kept file runs a copy under .claude/hooks/stamity/, saying the ledger
there is what lets a re-run remove that copy, and lists the copy the same way. Remove the
wiring from the named file, or fix or delete the file, then run clean again.
check fails on an entry Cursor rejects. Cursor accepts 21 event names in .cursor/hooks.json
(its hooks documentation, read 2026-10-07). An entry with no type, or "type": "command", needs
a command; a "type": "prompt" entry needs a prompt; any other type is refused. A key such as
PreToolUse is Claude Code's spelling, not Cursor's. While the file holds such an entry, Cursor
loads none of its hooks, the engine's guards included (shown for Cursor 3.13.10 by
microsoft/apm#3129). check exits 1 naming the entry by its pointer, for example
/hooks/PreToolUse. sync keeps the entry, because it is not the engine's, and warns. Remove the
key or rename it to the Cursor event it means. If an APM package wrote it, install that package
without the cursor target.
Your own tables in .codex/config.toml
.codex/config.toml is merged table by table. The engine owns only the tables it wrote:
[features], [mcp_servers] while no MCP server is selected, and one [mcp_servers.<id>] per
server it renders, each while it still holds what the engine wrote there. Every other table, and
every key above the first table, is yours, and sync, clean and a client's removal keep it byte
for byte. A table of one of those names that you wrote yourself, or one of the engine's that you
edited, is yours too. The engine keeps it and writes no second table of that name; remove yours to
get the engine's back. An engine table that leaves while it differs from the engine's rendering
leaves behind a verified .bak.
Some shapes leave no room for the engine's tables. Then init and sync skip the file, leave it
untouched and write nothing to it, and check exits 1 naming it. --force does not clear any of
them. Each message names the line or the table, and the remedy is one of these:
- A line that does not read as TOML. Fix that line.
- A key that defines one of the engine's tables without a header, such as
features.x = 1orfeatures = { … }above the first table, orgithub = { … }inside your own[mcp_servers]. The engine's header would define that table a second time. Move the key under a header of your own, such as[features], and the engine then keeps your table and writes none of that name. Or remove the key. - An array of tables,
[[mcp_servers]], while the engine writes an[mcp_servers.<id>]table: the engine's table would land inside the last element of your array. Rename your array, or define each of your servers as an[mcp_servers.<id>]table. - A table defined twice, such as two
[features]tables or two[profiles.x]tables. A quoted spelling such as["features"]is the same name. TOML refuses such a file, so Codex would load none of it. Merge the two tables into one. A second copy that is the engine's own, such as its table pasted twice, is not refused:syncdrops the engine's copy. - More than 63 MCP servers selected. The ledger records at most 64 of the engine's tables for
one file,
[features]included. Remove the servers you do not use withstamity config mcp remove <id>.
sync refuses a file it did not write
A drift entry reading collision means a file already occupies a path the setup wants, with no
STAMITY:BEGIN / STAMITY:END markers in it. The engine cannot prove it wrote that file, so a
plain sync will not overwrite it, and running one changes nothing.
Two remedies, and they are not the same. Move the file aside and run sync to keep your copy
where you can read it. Or keep the generated file:
npx @zomarit/stamity sync --force
--force copies your bytes to a verified .bak before it overwrites. Which remedy is right
depends on whose content matters, and sync cannot know that.
.claude/settings.json is different: it is merged entry by entry, never overwritten, and
--force does not apply to it. The engine owns the hook entries it wrote there, and it writes
permissions.deny and permissions.ask rows for the person-only acts, such as a force push, a
merge or a publish; it pre-approves no tool, so it writes no allow row. The ask rows follow the
autonomy setting: in mode autonomous, the default, no row asks for a ready-for-review mark or a
local tag unless autonomy.deployingActs names the act, and a raw merge keeps its row in every
mode. sync appends each engine row a list lacks, so an engine row you delete comes back on the
next sync. It removes no deny row, and an ask row only where the setting no longer renders it and
the ledger records that the engine wrote it, naming the row; an equal row the ledger does not record
stays, named, since it may be yours. Every other row it keeps byte for byte. clean removes none of
them, naming each row equal to an engine row for you to remove by hand. Your own rows and hook entries, the client's
enabledPlugins and your model or env stay whatever you run.
The Read, Grep and Glob allow rows a release up to 1.12.0 wrote leave on the next sync.
Where the ledger records each row (a 1.12.0 setup), they leave with no backup, and an equal row it
does not record is yours and stays. A ledger from 1.11.0 or older records no row, so every bare
Read, Grep or Glob row counts as the engine's: they leave with no backup when the file is as
the engine last wrote it, and behind a verified .bak, with a warning naming them, when it has
changed since. A scoped row such as Read(./src/**) is never the engine's and stays. A bare row
the engine does not take — one kept after a lost ledger, for example — pre-approves reads outside
the project; the engine leaves it alone, so delete it yourself if you did not add it on purpose.
The file collides only when it is not a JSON object, or a member the engine writes into, or a
release up to 1.12.0 wrote into, has another type — permissions not an object, allow, deny
or ask not an array, hooks not an object, an event not an array. The message names the member: make it the
type it names (or remove it), or fix or delete the file, and re-run sync.
An engine hook entry you edited by hand is put back on the next sync behind a verified .bak
holding your edit, with a warning naming the entry. Keep a hook of your own in an entry of its
own, and personal rows in .claude/settings.local.json, which this engine never writes.
Editing or removing a hook you define in .stamity/hooks/ does the same to the entry the engine
wired for it: the next sync removes the old entry behind a verified .bak and names it in a
warning. Adding a definition takes none.
run land exits 1 and does not merge
stamity run land merges the run's own pull request, or fast-forwards the default branch to it,
only when the evidence holds: every required check run green on the exact head commit (commit
statuses do not count), no unresolved review thread, no open Critical or Warning row in the run's
ledger at that commit, mergeable_state reading clean, and, where autonomy.reviewTool names a
tool, that tool's clean word on that commit. Under a hand-written clean: reaction that does not hold: a +1 names no commit, so one left on an earlier head reads clean on every later head, and no request is sent. The branch's own protection still
decides any required human review. Exit 0 means landed or already-landed (or would-land
under --dry-run); in a session exit 1 carries
outcome in its --json output, asks or refused, and prints every reason. Once it has read
the run's own pull request and its review threads, it also writes merge waits on: <reasons> into
that pull request's body (not under --dry-run), and a flow's close turns each reason into a
held row. A raw merge and a raw push to the default branch stay the person's:
the guard asks for them attended and refuses them unattended, as it does for the rest of its ask
list (a push of a tag, a release, a publish, a secret or protection write, an --admin merge, a write
to another repository or a mention of a person, a skill add, a learn accept, and a loosening of the setting). To tighten back to
1.16.0's asks, set autonomy.mode to ask and run sync; to name what deploys, set
autonomy.deployingBranches and autonomy.deployingActs, and the land verb asks for those. A
required check failing on the default branch's tip asks too: that is the brake. The land job is the
verb's second caller, and its own reasons are in the last list below. Under
autonomy.adminRuleProof an administrator can start a run, and the account could still lift the
rule: only the guard stops that. That key counts only once every leg holds it, so until the default
branch does the pre-flight gives its plain direct-push refusal and fix, run as an account or token without admin on this repository. The setting did not fail: the refusal's evidence names the leg. Land
the manifest and the guard copies sync --loosen wrote on the default branch, then run it again.
asks: the act is the person's. The verb merged nothing, and the outcome names the head commit
it holds for on its approve with: line. The reasons, and what each needs:
autonomy.mode is ask: the setting asks for every merge. The person decides. The verb reads the strictest of the default branch's,HEAD's and the work tree's manifest and the baked guard, so a setting loosened in the work tree (autonomy.modeset toautonomous, thensync --loosen) keeps it asking until that change reaches the default branch, and the change to the manifest itself asks: a person lands it.the diff touches paths that define the evidence: <paths>: the change edits a CI definition, a hook or guard file, a client's or the editor's settings, workspace or tasks file, the manifest, the MCP configuration, an installed pack, the trust policy, the trusted skill sources or a copied skill's origin record, a handoff, a cloud agent's environment file, a composite action, aCODEOWNERSfile,.stamity/change-classes.json, the files stamity's own CI uses to pick a change's checks (scripts/ci/pr-proven.mjs,scripts/ci/records-only.mjs,src/change/classify.tsandsrc/roster/triggers.ts, asked about in any repository that has a file at one of these paths) or a hook script the repository declares. A person reads that diff and decides.the diff carries a held patch: an unattended run held a person-only change. A person applies the patch or drops it, then decides.<branch> is named in autonomy.deployingBranches, orautonomy.deployingActs names <act>: the repository says this merge or this ready mark deploys, so it asks in every mode. A change that fitsautonomy.autoShiplifts the branch line only, never an actautonomy.deployingActsnames. A fast-forward always asks here.auto-ship: <rule>, beside that branch line: the change did not fit, and the land names each rule, or only the file limit where GitHub's count is over it, since nothing else is then read. They read<n> files are over autonomy.autoShip.maxFiles,<n> lines are over autonomy.autoShip.maxLines,<class> is outside autonomy.autoShip.classes,<path> is outside autonomy.autoShip.paths,docs-class but not plain text,a specialist lens is asked for,the change is empty,the file count … disagrees with the classified paths,the line count is incomplete,the line count is not a finite numberandthe classification is incomplete. The last one also names what could not be read: GitHub's compare, the class file at the tip, a disagreement between the range and GitHub's file list or line total, or a shallow clone. Fetch the whole history, or let a person decide. The range read needs git 2.41 or newer: on an older git it reads nothing, so the reason says the range and GitHub's file list differ, and the fix is a newer git. The rules read paths, size and class, never content.auto-ship is judged only from the repository's top, and this land started in <folder>: run it from the top.<branch> is red: <checks> failing on its tip: the brake. Fix the default branch first. The land that carries the fix goes through on a person's--approved, since this is an ask and not a refusal. With no required set read, every check run on the tip counts, so any failing run asks. The land job's own run is left out. Under the emitted token a job's merge starts no Actionspushworkflow, so the brake has no such run to read on that tip.<branch>'s tip could not be read (…), so whether it is red is not known: fix the read the reason names, then run it again.the head's manifest loosens <keys> against <branch>'s: the pull request loosens anautonomykey in.stamity/manifest.json. A person lands that. The head is compared with the tip, so a key the default branch gained after the run forked is named too, though the merge keeps that key: this land already asks, over the manifest's path, and the extra name costs nothing but a line.the legs disagree on autonomy.reviewTool, and no leg wins: …: the places the setting is read name different tools, so the tool's word was not read. A person decides, then makes them agree.a person decides on closed review threads that someone beside the closer wrote in, or that did not read whole: <ids>: GitHub shows these threads resolved, and each holds a comment by a person other than the one who closed it and the run's login, or has more comments than one read holds. A person reads those threads and answers the ask. The approval holds for that head, so a new push asks again while such a thread stays closed. An unattended run and the land job take no approval, so there a person merges by hand. On a repository with one account this rarely comes up.<ids>are GitHub's internal thread ids, which its page does not show.- For
--fast-forward, a rule that requires a pull request, branch protection that may require one, or rules the account cannot read: land it as a merge instead, without--fast-forward. the hook declarations at <place> could not be read: the reason names the fix and where it lands; make it, then runrun landagain.
To land over an asks outcome, the person answers it: the land line again, with --approved and the
commit the approve with: line printed. On Claude Code's and Copilot CLI's main thread the guard
asks on that line. On Codex and Cursor the guard refuses it instead of asking, so the agent hands
the person that exact line to run in their own terminal, and the merge stays held until they do. The
flag holds only while the head is still that commit, and an unattended run refuses it. Every refused reason still refuses.
refused: the evidence does not hold yet. Fix what the reason names, then run it again:
-
required check <name> is still running, orhas no check run yeton the head: wait.--wait <minutes>, at most 9, polls every 30 seconds within one call. A check that reports only a commit status never counts: the check has to report as a check run. -
required check <name> did not pass: fix the change and push it. -
<n> review threads are unresolved: resolve them. A thread the run's own login resolved stays open while another person's comment is in it, so that person resolves it. If a third person wrote in it too, the land then asks. -
the tool's open review threads (<n>) wait on its word on this head: a pending reason. The threads the review tool opened stay open until it reads clean on this head.run landthen resolves them itself, so wait, and run it again. -
the tool's review thread <id> was not resolved (…): the land tried to resolve one of the tool's own threads and could not, so nothing merged. Resolve it by hand, or run it again. -
someone else wrote in review thread <id>, which GitHub may show as resolved: a person reopens it and closes it themselves, so the land reads it as theirs, and asks where another person wrote in it too: a comment by someone other than the tool or the run's login sits in a thread the land closed, and the land counts that thread as open. Read the comment. Then a person reopens the thread and closes it themselves, on an account other than the run's. If someone else wrote in it too, the land then asks, as listed underasks.<id>is GitHub's internal thread id, which its page does not show, so look for the resolved thread that holds the comment. -
waiting for <tool> on <sha>, up to <n> minutes from the request, orno result from <tool> on <sha>, and no request on this head yet: pending reasons. Wait, and run it again. A wait longer than the call ends asaskswithasks.pendingand the linepending: run land again for the review tool's word; no approval passes a wait, so--approvedis no way past it. Besidethe review request was not posted to #<n> (…)the second reason is a refusal, not a wait, since with no request no wait can end: fix what that line names, then run it again. -
<tool> reports findings on <sha>, and only a new run clears them: fix them, push, and let the tool run again. Its flags stay true after every thread is resolved. -
<tool> gave no result on <sha> within <n> minutes: the tool stayed silent, and silence never passes. Check that the tool is installed on the repository.no usable resultsays the tool answered with something this reader cannot use, and the reason says what. -
<n> of <m> review rounds spent with no clean head, so a person decides: the run stops here.Both of these last two are refusals, so
--approveddoes not pass them. While rounds remain, the land can ask the tool again on a new head.roundscounts the heads that carry the run's review marker, the first among them, so at most one fewer get a fix, androunds: 1gives none, since a finding on its one head reads as spent here. Past that a person raisesroundsor drops the tool, each throughsync --loosen, or merges by hand. A raise counts only once the run's branch holds it too, since the land reads the lowestroundsof every copy of the setting. -
the ledger at <sha> holds open Critical or Warning rows,does not read, orthe work tree's … differs from the commit's: checkpoint first: close or fix the rows, then runrun checkpoint, so the ledger the head commit holds is the one on disk. -
mergeable_state is not computed yet, run it again;is behindoris dirty: bring the branch up to date with the default branch;is unstable: a check that is not required is failing;is blocked: the branch's rules stop the merge, and a merge past them is the person's. -
mergeable_state is blocked, and the tool's open review threads may be what holds it: a pending reason. A rule that requires resolved conversations readsblockedwhile the tool's own threads stay open, so the land waits for the tool's word on them, as above. Once they are resolved the pull request is read again, and a state stillblockedis the plain reason. -
the pull request is a draft: pass--ready, which marks it ready once everything else holds. -
The pull request is not the run's own: another branch, a fork, another base, a body that does not end with the run's marker (a client's short footer after it aside, as Cloud runs says under The land job), a head that is not
HEADand origin's tip, an author other than the run's login, or a number the run verb did not record (no pull-request record, orthe pull-request record namesanother number). The verb lands only the draft thatrun checkpoint --prorrun endopened or updated, and recorded, from the run's branch: runrun checkpoint --prthere, which pushes soHEADand origin's tip agree and writes the record, and leave a pull request the run verbs did not open, which they only comment on, to a person. -
the head moved since the approval: a commit landed after the person approved. Runrun landagain without the old commit, and answer the new outcome. -
gh not found on PATH, orgh resolves to a program inside the work treeorinside a temp folder: installghoutside the repository and the temp folders, and put its folder onPATHby its full path. -
a read failed before GitHub answered:ghdid not start, is not signed in, or has no network. Ifghcomes from a version manager, see the next section. -
no setup found: the verb found no.stamity/manifest.jsonon the default branch, atHEADor in the work tree; it needs a committed setup. -
<branch> holds no .stamity/manifest.json at the repository's top: a setup on the run's branch alone, or only below the top, does not count. A person places one on the default branch first. -
config changed: …orno pre-flight record, in an unattended run: the configuration window inSECURITY.md. Git's configuration or environment moved since the pre-flight, or none ran. On a fresh clone of a cloud run none ran, sorun landrefuses here. Cloud runs says what you can do, under A held pull request from a cloud run.
The land job. stamity run land --job, off by default, is the second caller of this evidence. It
merges through the same rules, with no bypass, so it reads the same reasons, and a few of its own.
A job exits 0 on every normal end, and a hold shows as the pull request's status line, never as a red job. So read the pull request's merge waits on: line, not the job's colour. Three ends leave no line: a run
still in progress, a head a newer job speaks for, and a pull request that does not read as the run's own,
such as one whose base someone changed. That last one is no wait: nothing lands it until a person puts it
right, and its reason is only in the job's log. It exits 1 only for a true failure,
a read or a write GitHub did not answer as it should, but a read that fails into a decision holds,
with its line, and exits 0. It exits 0 as not-a-run where the pull
request's body names no run, where it is closed, and where an attended run closed through run checkpoint --pr alone left no PR: line. It waits out a review tool's silence in one call, holding a
runner up to waitMinutes per head, since a silent tool sends no event to wake it. A job that merges
nothing can still leave the pull request marked ready, the tool's threads resolved and an evidence
line in the body. Real runs on Claude's cloud on 2026-11-10 ran the job's merge under GITHUB_TOKEN: it read the evidence and the review threads, marked the run's draft ready, wrote its evidence line and merged it. The thread resolve under that token, the review request and the issue_comment wake are still not run until a real run reaches them.
Cloud runs says what the real runs that reached the job showed, under The land job. Its own reasons:
autonomy.landJob is not on in every leg of the setting, so the job does not land here: turn it on through a person'ssync --loosen, on the default branch too.the record at <sha> does not read Status: closed, so the run has not ended: the run did not end. End it withrun end.the record at <sha> reads (blocked:, so a person decides, orholds a ## Refused row, so a person decides, orthe morning list at <sha> holds a ## Refused row, so a person decides: the job never lands such a run.the record at <sha> does not name #<n> on a PR: line, ornames no Login:: onlyrun endwrites those lines, with the setting on. End the run withrun endwhile the setting is on.no merge method is allowed on <branch>, so the job has none to take: the merge method comes from the ruleset or the repository at run time. Allow one, or land it by hand.
The job never starting at all is a different failure. The land-job-workflows row of stamity check
names a landJob.workflows entry no workflow carries, and a required workflow left off that list
finishes with nothing to wake the job: name every required workflow there.
run land cannot start a gh pinned only in the repository
run land starts every gh call at the filesystem's root, with the version managers'
version-choosing variables dropped, so no version file the run can write steers which program
answers. A gh that a version manager (mise, asdf) pins only in the repository's own version file,
with no pin in your home folder, then no longer resolves there: every land read fails, and the verb
refuses with a read failed before GitHub answered, merging nothing. Pin gh in the version
manager's user-level configuration as well, or install gh outside a version manager.
sync exits 1 with AUTONOMY_LOOSENED
sync, init, workspace sync and upgrade refuse to bake a looser autonomy setting into the guard than the
strictest one in force: the guard copies on disk, the copies and the setting committed at HEAD,
and the manifest on disk. The why names the place that is stricter, and nothing is written.
Loosening is the person's act: the person checks the setting in the manifest is the one they want,
then runs the command again with --loosen, which names each guard copy it loosens and what it
dropped. Tightening needs no flag.
A repository that commits .stamity/manifest.json but not its guard copies (under
.claude/hooks/stamity/ or .stamity/generated/hooks/<client>/) pays this once on a fresh clone,
on a switch of every selected client, and on a hooks layout move. There the why reads no guard copy found at `HEAD` or on disk where this write puts one, though the setup committed at `HEAD` records one (read as `ask`): with no copy at HEAD, the
engine cannot tell a fresh clone from guard copies deleted in a commit, so it reads the strictest
setting the committed setup allows. One sync --loosen settles it, and later syncs need no flag.
Committing the guard copies, as the default layout does, avoids it on later clones.
A settings row refuses a push, a tag or a merge chained with another command
Claude Code's permissions.deny rows stay as 1.16.0 wrote them, the wide ones included: they are
the second layer under the hook, for a session whose hooks are off or a guard that timed out. A
* inside such a row matches anywhere on the line, so a row meant for a later flag can match a
later command on the same line instead. A feature-branch push followed by a date call whose
format starts with + met the force-push row this way. Put a push, a tag or a merge alone on its
line, with nothing chained before or after it; the flows already do.
An install is refused where node_modules is a link
In a worktree lane whose node_modules is a link to another checkout's, the guard refuses
npm ci, npm install and every other package-manager write, in every mode, and says
This install would write through node_modules here, which is a link to <target>. The install
would rewrite the other checkout's packages, which every lane linked to it reads. Run it in that
checkout (cd there first, or give the install an absolute --prefix), or remove the link, the
link only, and install in the lane.
Every ask is refused, saying nobody is watching
The nobody-watching switch is on: STAMITY_NOBODY_WATCHING was set when the session started, or
.stamity/away.json is present. stamity away status says which, and lists the acts it held. Run
stamity away off to remove the marker; the variable holds until you start a session without it.
Each refused act still waits for you: run it yourself, or ask again once the switch is off.
Writes to your own repository ask, through an SSH host alias
The guard compares a gh write's target with the host and owner/repo of the origin remote as
the URL writes them. It applies git's URL rewrites, but not your SSH configuration. So an origin
cloned through an SSH host alias, a host other than GitHub's own in the remote's URL, reads as
another host: writes to your own repository ask when someone is watching and are refused
unattended. Set the remote's URL to the real host name, or add a git URL rewrite (url.<base>.insteadOf)
from the alias to the real host. Either way git then connects to the real host with that host's own
SSH settings, not the alias's: a key or an account the alias chose no longer applies, so a push can
be refused or sent as the default key's account. To keep them, move them to a Host entry for
GitHub's own host name in your SSH configuration, or set the key for this repository alone with git's
core.sshCommand.
sync refuses an instruction file with an import-decision collision
check names the file in its next steps. sync writes everything else, skips this file and
exits non-zero:
AGENTS.md holds your text outside the engine's managed block, the shape a `supplement` import
leaves, but the manifest records `skip` for it, so sync would replace your text.
When init met an existing AGENTS.md, AGENT.md, CLAUDE.md or
.github/copilot-instructions.md, it recorded what to do with it under importChoice in
.stamity/manifest.json. A supplement keeps your text and puts the engine's block beside it.
Here the file still has your text beside the block, but the record says something else, or
nothing, so a sync would overwrite the whole file and your text with it. The manifest is
committed and anyone can edit it, so the file's bytes win over the record and nothing is
written.
--force does not clear this. A forced sync skips these files too, because forcing would
replace exactly the text the refusal protects. There are two remedies:
- Keep your text: set the path's
modeback tosupplementunderimportChoice, then runsync. - Let the engine own the whole file: run
init --force --import-config replace. It recordsreplaceand copies your bytes to a verified.bakbefore it writes.
npx @zomarit/stamity init --force --import-config replace
A client has no files
The setup is generated for the clients the manifest names, so a client with no files is usually a client that was never selected:
npx @zomarit/stamity config get tools
npx @zomarit/stamity config set tools claude,cursor
npx @zomarit/stamity sync
config edits state and never regenerates output. The sync is what writes the files.
Two things are expected rather than broken. Codex gets no command files of its own: its
touchpoints are the shared skills under .agents/skills/, started as $st-<id>. Copilot CLI and
cloud hooks land at .github/hooks/stamity.json, and a selected Copilot setup missing that file
needs a sync.
The capability matrix states each client's supported surfaces and
enforcement limits.
Your Codex hook never runs
Three steps stand between the emitted .codex/hooks.json and a hook the client runs.
features.hooks = true. Every byte inhooks.jsonis inert while it is off. On codex-cli 0.155.1 it measured on by default (2026-09-30), and the vendor's hooks page says the same. stamity writes it into.codex/config.tomlfor you anyway, andsyncrestores it, unless the file holds a[features]table of your own, which the engine keeps instead of its own. While a key you keep sets it tofalse(hooks = false, orfeatures.hooks = falseat the top), Codex runs none of the hooks, the engine's guards included:syncwarns, andcheckexits 1 naming the line. Set it totrue, or remove the key.projects.<path>.trust_level = "trusted", in your own Codex home config.- A per-hook review through the interactive
/hookscommand. Automation that cannot take that step uses--dangerously-bypass-hook-trustinstead.
Headless codex exec has never run a project hook in a measured run here. On codex-cli 0.154.0 it
ran none in three runs, measured on 2026-09-15. On codex-cli 0.155.1 (2026-09-30) it again ran none
in 3 of 3 runs. Both measurements trusted the project through a per-invocation -c override, which
may leave the project .codex/ layer unloaded, and on 0.155.1 a project-file hooks = false did
not turn the feature off under it. So the cause is not isolated: exec itself, or a layer that
never loaded. A run with the project trusted in your home ~/.codex/config.toml is unmeasured.
Those runs read a hook's firing from its own output alone: a PreToolUse hook appended one line per
call to qa-observations.jsonl, so no such file after a run meant no hook fired, whatever the
model's reply said, while the codex.hooks.run metrics line in a RUST_LOG=debug log appeared
with the feature off too, so it is no evidence that a hook ran.
Treat a Codex hook as enforcement in the interactive client, and as nothing measured in the headless
one.
A hook never runs in a cloud session
A vendor's cloud runs only the hooks it documents. Each fact below is dated, with its source, in the capability matrix under Cloud sessions.
- Codex: Codex cloud documents no project hooks, so assume none run there. Its sandbox is the enforcement.
- Claude Code: in an Anthropic-hosted environment a cloud session with several repositories loads
no repository hooks, and a project's cloud thread loads none whatever the number of repositories,
so neither the guard nor the session start runs there. A session with one repository, outside a
project's cloud threads, runs the clone's
.claude/settings.json. A self-hosted environment goes by its runner's settings. - Copilot: the cloud agent uses hooks only when the hooks file is present on the default branch, and
loads them from
.github/hooks/*.jsonin its clone, so a branch that adds the file runs no hooks until the file reaches the default branch. - Cursor: its hosted cloud agents run no
sessionStart,sessionEndor MCP hook, and no hook at all during their early read-only turns. A self-hosted worker runssessionStartwhen a session claims it.
Where a session start does run, it names the detected cloud or CI session and the guards not enforced there.
Claude Code blocks every tool call with "the pre-tool-use guard could not run"
That line is the guard failing CLOSED, and it says the guard could not LAUNCH — not that a call was
refused. Three entries carry it: the pre-tool-use guard's, the person-only guard's on
Bash|PowerShell, and the person-only guard's on the GitHub MCP write tools, each command ending on
the same tail. The line and a refusal never arrive together: a refusal names the agent and what it denied — a tool by name, a write
outside its report path, or a shell command that is not read-only git — or, from the person-only
guard, the act it refused as … is a person-only act, an install it refused as
This install …, or an install it refused because its own reading of the install faulted, as
The guard could not read whether this install … (run that install on a line of its own, after a
plain cd to its folder, as the refusal says), and never that line, because the tail below re-raises the guard's own exit 2 in silence and prints only when the
status is neither 0 nor 2. If you see both, the emitted command is not the one this version writes —
re-sync and compare.
The emitted command anchors the script on the client's own project root and turns a failure to launch into a block:
"command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/stamity/stamity-pre-tool-use-guard.mjs\" || { s=$?; [ \"$s\" -eq 2 ] && exit 2; echo 'stamity: the pre-tool-use guard could not run; run `stamity sync` where the CLI is installed, else `npx -y @zomarit/stamity@<version> sync`, which needs the npm registry' >&2; exit 2; }"
<version> is the stamity version the setup was generated with, and a renamed fork's package stands
in place of @zomarit/stamity. A fork no registry serves prints npx --no in place of npx -y,
and no registry clause, because that call fetches nothing. A fork that names its registry prints
--@<scope>:registry=<url> between npx -y and the package, so a machine without that scope
mapping still fetches the fork's build, and its clause reads "which needs the registry it names". A
sandbox with no route to that registry, as a cloud session can be, fails the npx call.
The entry runs the copy under .claude/hooks/stamity/, not the one under
.stamity/generated/hooks/claude/, which is no longer written: the sync that upgrades a setup
removes each old copy still as it wrote it, and keeps and names one you edited. The session start
you run by hand where no hook ran is the copy under .claude/hooks/stamity/ too. Claude Code's
GitHub Action restores .claude/ from the base branch on a pull request, so the copy there is the
base branch's (Cloud runs), and on an upgrade pull request whose base predates 1.16.0 the
base's entry names the removed old copy. From a 1.9.0 to 1.15.x base it refuses every tool call on
that run until the upgrade merges; before 1.9.0 it has no fail-closed tail, so the guard does not run
on that run. For a base older than 1.9.0, upgrade through 1.16.0 first, whose settings already name
the copy under .claude/hooks/stamity/, or keep the Action off that one upgrade pull request.
Two things reach that branch. The copy is gone — clean removed it, a fresh checkout has not
synced, or the file was deleted by hand:
npx @zomarit/stamity sync
npx @zomarit/stamity check
Or the session carries no CLAUDE_PROJECT_DIR. The client sets it to the project root the session
started in, so an empty value means the hook process did not inherit the client's environment — a
wrapper, a launcher or a CI step that scrubs it. With it empty the path resolves to
/.claude/hooks/stamity/…, where nothing is.
Why it blocks rather than warns: the command used to be repository-relative, and a hook handler
runs in the session's current directory, which a cd in the Bash tool moves. Once it left the
root the guard ran as Cannot find module and exited 1 — a status the client does not block on —
so every tool call after that cd went through ungated. A guard that cannot run now stops the
call instead of disappearing. Every non-zero path exits 2: the status is classified, never
forwarded, so a guard that exits 1 does not reach the model as a status the client ignores.
One host is a known gap. The command is POSIX — ||, $?, [ … ], a brace group — and it holds
in the two shells the client's own hooks documentation names first. On a Windows host with no Git
Bash the client falls back to PowerShell, and there nothing about the line works: PowerShell
parses none of that syntax, and ${CLAUDE_PROJECT_DIR} is its own VARIABLE syntax rather than an
environment lookup (which would be $env:CLAUDE_PROJECT_DIR), so the path expands empty. That
affects every anchored command (ten entries over seven scripts), not just the guard — the
session-start and tamper notices, the cloud readiness hook, the person-only shell guard, the
unattended ask gate and the review gate too — so on such a host the anchoring may be
a REGRESSION: a hook that used to run while the session sat at the repository root may now never
launch at all. This is unmeasured; no run on such a host has been made. stamity check says so on
that host: its claude-hook-shell row fails when Claude is targeted with repository-emitted hooks
and no Git Bash is found where the client looks — CLAUDE_CODE_GIT_BASH_PATH, the default install
locations, or beside the git on PATH; a bare bash.exe on PATH does not count. If you are on
one, install Git Bash, and report what you see.
The other three clients' commands find the root themselves. Since 1.15.0 each Cursor and Copilot
hook command is a node -e starter that walks up from the folder the session started in to the
folder holding the client's hook file, .cursor/hooks.json (Cursor's CURSOR_PROJECT_DIR first)
or .github/hooks/stamity.json, and runs the hook there, so a session started in a subfolder runs
its hooks as one started at the root. A runner missing at the root makes the starter exit 1 naming
the sync call that restores it. The Codex starter walks up the same way, to the directory holding the
trusted .codex/hooks.json. The client contract evidence page
carries the vendor citations and the dates.
CONFIG_ERROR says the bundled content was not found
A message about bundled content not being found, naming a package root and the paths it probed,
means the installed package is incomplete. The corpus that ships inside it is not where the
engine expects it. Reinstall the package. In a source checkout, run npm run build, which stages
the corpus under dist/content/.
This is an install problem, not a repository problem. Nothing in your tree can cause it, and nothing in your tree fixes it.
LOCK_TIMEOUT on a write
Another write is already in flight on the same file. It may be a second stamity process, or
another task inside the same run. Re-run once it finishes.
If nothing else is running, an interrupted run left a lockfile behind. The message names the exact path, so remove that one and re-run.
FS_ERROR on a write
FS_ERROR names the operation and the path. The usual causes are a read-only parent directory,
an exhausted quota, or a path you do not own.
Your files are safe either way. Every managed-file write goes through a temp file and an atomic rename, so a failure leaves the previous file intact rather than a half-written one. Three in-repo writes do not take that path, and none of them can damage a file that is already there:
- The state directories'
.gitkeep. It is created exclusively, so a file already at that name is kept. - The
.bakthe writer leaves before it overwrites a file it cannot regenerate. That happens to a colliding unmanaged file under--force, to a managed file whose markers a plainsynchas to repair, to a charter, another instruction file or Copilot's.github/hooks/stamity.jsonoverwritten while git cannot confirm its previous bytes are committed (an uncommitted or untracked file, a setup below its repository's top level, no git) — a file git tracks with no uncommitted change gets a notice there and no.bak— to.claude/settings.json,.cursor/hooks.jsonand.codex/hooks.jsonwhen an engine entry the engine cannot prove it wrote — an edited one, an earlier setup's hook entry, or one the ledger records outside what it can prove by path — is replaced or removed, to.codex/config.tomlwhen an engine table that differs from the engine's rendering leaves, and to those files and the three MCP JSON documents whencleanor a client's removal reclaims an entry the engine cannot prove from bytes that no longer match what the ledger recorded. A key another tool added to the file costs no backup; an untouched file is reclaimed with none; a backup that cannot be taken refuses the removal and leaves the file untouched. The backup takes a name no existing file holds. An upgrade to 1.15.0 meets the charter case atAGENTS.md: that release's charter differs (its invariants moved to 1.3.0), so whereAGENTS.mdis the engine's whole file, the firstsyncprints the notice or leaves anAGENTS.md.bak. - The workspace root's
.stamity/workspace-sync-journal.jsonl, which is an append-only log.
init refuses on a repository that already has a setup
That is deliberate. A second init never silently replaces the first. Use sync to regenerate,
config to change a choice, or init --force to replace the setup in place.
Where to report a problem
- A bug or a question — open an issue. Include
the command you ran, its
--jsonoutput if it failed, and your Node version. - A security vulnerability — do not open a public issue. Use
the private advisory form.
What is in scope, and what the engine defends today, is in
SECURITY.md.