You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stamp CLAUDE.md's Digest When It Is Written, Not Only When the Whole Install Completes #2498
main() in host-setup/agent-safety/claude/install.py rewrites CLAUDE.md at its first stage. It writes the stamp, and with it instructionsDigest, only at its last stage. Where CLAUDE.md is rewritten completely and a later stage then fails, the stamp keeps the previous digest. The stages that can fail are hook staging, a hook self-test, and the settings write.
The file on disk is then a whole render that no stamp vouches for. Once the render changes again, for example after an edit to the host-local instructions file, --report says CLAUDE.md "was edited since the last install". The next run then backs up the installer's own render as a hand edit. That is the symptom #2454 fixes for a write cut short, reached here by a write that completed.
Shape that reproduces it
Install into a throwaway CLAUDE_HOME.
Change the render by adding text to the host-local file, and make a later stage fail, for example by making settings.json unwritable.
Run the installer. CLAUDE.md is rewritten, and the run then fails at the settings write.
Change the host-local file again, and run --report, then the installer.
The report calls the file hand-edited, and the run writes a backup of the installer's own render.
Shape of a fix
Record the new digest once CLAUDE.md is written, rather than only at the end. For example, update instructionsDigest in an existing stamp right after the write, the way #2493's record_leftover_instructions does for a leftover. Or write the stamp's instructions fields at that point and the rest at the end.
Found by the local strict review of #2493. This was confirmed by reading the code rather than by a run.
Declined under GOVERNANCE.md "Trust Boundaries and Hardening Effort" (#2501, released in 2.0.867), at the maintainer's direction. The trigger, a later install stage failing after CLAUDE.md is rewritten, fails the run loudly. Its only cost is a spurious backup of the installer's own render and one misleading --report line, and nothing is lost, so it does not meet the silent-or-destructive bar.
Activity
Recognize the Installer's Own Partial CLAUDE.md Rather Than Backing I…
Promote develop to main: Recognize the Installer's Own Partial CLAUDE…
ptr727 commentedon Oct 8, 2026
Declined under
GOVERNANCE.md"Trust Boundaries and Hardening Effort" (#2501, released in 2.0.867), at the maintainer's direction. The trigger, a later install stage failing afterCLAUDE.mdis rewritten, fails the run loudly. Its only cost is a spurious backup of the installer's own render and one misleading--reportline, and nothing is lost, so it does not meet the silent-or-destructive bar.