A hook that asked every session for its context
Phase 2 of our context view, the test that cleared it, and why we took it out.
D008 showed how full a session’s context was, but not what filled it. Phase 2 was to get that breakdown.
The decision uses a Stop hook, a command Claude Code runs each time Claude finishes a response. The hook calls claude --resume <session_id> --print "/context", which asks the same session for its context report.
The entry records two questions we answered first, both dated 2026-04-24. Does --print "/context" run the slash command or send the text to Claude? It runs the command and returns a table of categories, from the system prompt and tools to messages, free space and the autocompact buffer. And would resuming a session from inside its own Stop hook lock up or loop? We tested it by registering such a hook. It exited with code 0 and returned the full breakdown, and the resume call did not set the hook off again. “Phase 5b is fully unblocked.”
Those dates are eleven days older than git’s first sight of the entry. It arrived on 2026-05-05 with ten other decisions, in a commit with no message that also added a plan for “5b” dated 2026-04-24. The hook’s installer came in a commit two hours earlier (d99123f9). We didn’t record any other design we weighed, or a cost.
Later, on 2026-06-11, our check marked it shipped. Otto wrote the hook into Claude Code’s own settings and parsed its reports in the main process.
Later, on 2026-11-02, we retired it (93df613f). The commit gives the reason. The hook “ran claude --resume --print /context after every turn of any Claude on the Mac, a second process writing into the live transcript.” Each run left a /context message in the conversation, sometimes with a synthetic “No response requested.” reply, several a minute in our Keepers’ conversations (a Keeper is a session that leads a project). It cost about 3.7 seconds a turn. And “nothing read its output.” Otto now reads context from Claude Code’s status line instead (D035), and every Otto start removes the old hook. The commit also says what it did not test: “Not run on a real Mac.”
Decision D010 · 2026-05-05 · ba6e1975, 9399ca23, 93df613f (moved to its own file in 94a000a6, wording unchanged)