Repository navigation
fix(web): sprints load their plan, state and memory whole after compaction - #609
Conversation
…ction The session-start hook showed only 2.5 KB previews of PLAN.md and STATE.md and just a pointer for MEMORY.md, so after most compactions the leader worked without its own files. CLAUDE.md now imports PLAN.md, STATE.md and MEMORY.md, the same way it already imports CREW.md and PROJECTS.md. Claude Code rereads imports from disk at session start and after compaction (tested on 2.1.332 with a 20 KB import), so the leader gets all of each file. The session-start hook keeps only the library listing and the memory snapshot. Sprint rules go to v12. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Code-quality review of This change goes the right way. It deletes machinery instead of moving it around. The session-start hook loses Two small, optional points. Neither blocks:
Not approving: this automation only reviews. CI was still pending when I reviewed. 🤖 Review: Claude Opus 5.5 ( |
NoahHendrickson
left a comment
There was a problem hiding this comment.
Code review of 7b268cdaad0d2c6970c6ba3aeccec2402372ce79.
The change is small and it holds together. The seeded CLAUDE.md imports the three files the same way it already imports CREW.md and PROJECTS.md. The session-start hook still takes the memory snapshot the turn hook diffs against. The rules version moves to v12, so existing sprints refresh, and the guard pins the new text and checks that the hook no longer prints the files. The rules text and the manifest note match what the code now does. I found no correctness bug. Three things are worth a look, all inline:
- Plausible:
@inside agent-written files now imports. Claude Code expands imports recursively, up to 5 hops. A memory or state line written as@context/report.md(bare, not in backticks) would now pull that library file in whole on every new context, past the 8 KB memory budget. The rules ask for a longer note to go in the library "with a line here pointing to it", so a pointer like that is a likely thing for an agent to write. - Consideration: MEMORY.md now reaches the leader as CLAUDE.md text. Before, it came in as hook output. Now every thread's lines arrive inside the block Claude Code labels as instructions that override default behavior. Threads read untrusted text (PR bot comments, web pages), and any of them can write to MEMORY.md. "Files win" already gives the file weight, so this may be fine, but it should be a deliberate choice.
- Nit: the snapshot and the import read are no longer one step. Before, the hook printed MEMORY.md and copied it in the same script run. Now Claude Code reads the import and the hook copies the file separately. If a thread writes to MEMORY.md between the two, the change lands in the snapshot but not in context, and the turn hook never reports it. The window is short.
Out of scope here: apps/web/src/custom/bots/botSeedFiles.ts:4 still says its hooks "re-show STATE.md". That is the bots path, which this PR doesn't touch.
Not run: I read the diff and the surrounding hook scripts and fixtures. I didn't run tests or a live session.
🤖 Review: Claude Opus 5.5 (claude-opus-5-5) via Claude Code
Thread transfer impact
This comment will update automatically after the next completed run. |
Review follow-ups. Imports in an imported file load too, so MEMORY.md and STATE.md lines write paths without a leading @. MEMORY.md now reaches the leader inside CLAUDE.md, so the rules call it notes, with CREW.md and the owner's messages as the instructions. "Imported at the end of this file" is said once, in the closing section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Code-quality notes, handled in 2851046:
Still blocked: Lint fails on 15 stale design-lint B6 stamps. They fail on |
After each compaction, the sprint leader's session-start hook showed only the first 2,500 bytes of PLAN.md and STATE.md and just a "read it" pointer for MEMORY.md. So for most of a sprint the leader worked without its own files. It rarely went back to read them (context/compaction-in-parent-threads.md).
What changed
@PLAN.md,@STATE.mdand@MEMORY.mdin a closing "Your plan, state and memory" section, the way it already imports CREW.md and PROJECTS.md.fork-sprintsguard's session-start case now checks the imports, and that the hook no longer prints the files..fork/customizations.yamlnote is updated.Why imports work here
Tested by hand on Claude Code 2.1.332 in one long-running stream-json session:
@importloads in full./compactit is read again from disk. A word changed in the file before compacting showed up afterwards, while the summary still had the old one.A coding agent other than Claude doesn't expand imports. It still gets the AGENTS.md pointer to read the files, as before.
Checks
vp run check:changed,vp test run src/__fork_guards__/(1028/1028),node .fork/lint-owned.mjsandnode .fork/design-lint.mjs --checkpass.Plan: context/sprints-plan-after-pr596.md (step 5) in the sprint's library.
Reviewed with sol-loop: 1 round with GPT-6.1 Sol (
gpt-6.1-sol) on high. Sol verdict: approved🤖 Signed: Claude Opus 5.5 (
claude-opus-5-5) via Claude Code🤖 Review: GPT-6.1 Sol (
gpt-6.1-sol, high) via Codex: one sol-loop round, approved with no findings🤖 Generated with Claude Code