In December 2025, we made a clean cut: ripped 13 hook files out of our Claude Code setup. The hooks were intercepting tool calls and outputs, trying to extract anything worth storing in AutoMem passively. We called it memory capture.
It didn’t work. The signal was bad. Passive capture at the hook layer produced noise, duplicates, and low-confidence guesses about what mattered. Claude’s own judgment about what to store was just better. So we deleted them. 2,710 lines. Clean break.
Yesterday, we added some back.
Same codebase. Different thing entirely.
What changed
Anthropic added additionalContext support to Stop and SubagentStop hooks around Claude Code v2.1.163. The difference sounds minor. It isn’t.
Previously, influencing the model from a Stop hook was awkward; now the hook can inject context cleanly, avoiding the error-label behavior of older feedback paths.
The old hooks were write-side: intercept output → try to extract memories → store them. The friction was always in the extraction — passive capture can’t tell signal from noise, and it fires on everything.
The new hooks are read-side: at session start, query AutoMem → pull the five most relevant memories → inject them as additionalContext before Claude sees anything. At session end, a nudge: “Did you store anything worth keeping?”
There’s no extraction step. Nothing passive. The question isn’t “what should we capture from this conversation?” — it’s “what did we already know that’s relevant right now?”
What we built
Three scripts in .claude/hooks/:
automem-session-inject.js— SessionStart hook. Queries AutoMem’s top-5 recalls and injects them into context before the first user prompt. Falls back gracefully if the API is unavailable.automem-stop-check.js— Stop hook. At conversation end, checks if any memories were stored this session. If not, nudges Claude once to consider whether anything durable was learned. Fires at most once, never blocks.automem-subagent-stop.js— SubagentStop variant. Same nudge, scoped to subagent completions so parallel agents each get the prompt without duplication.
125 tool calls to build them. Back to ~3 hook files, but functionally the inverse of the ones we deleted.
The pattern
The December decision was correct: don’t automate the write side of memory. Claude’s judgment about what’s worth storing beats a passive capture heuristic every time. We spent months learning that lesson.
But the read side is different. Injecting relevant context into a new session isn’t noisy — it’s precisely the kind of thing you can’t ask Claude to do for itself, because Claude starts cold. The session-start hook is a preload, not a transcript scraper. The signal-to-noise problem doesn’t apply here.
Removing complexity is permanent until the underlying capability changes. When additionalContext landed on Stop hooks, the relevant question wasn’t “should we put hooks back?” It was: is this the same thing we removed? It isn’t. One was a write-side passive capture heuristic. This is a read-side query-and-inject. Different tool, different failure mode, different tradeoff.
If you’re building with AutoMem, the Claude Code hooks reference is worth a read — especially the Stop and SubagentStop sections. This week’s also been dense on the AutoMem side in general; yesterday’s post covered a completely different kind of invisible failure in the same codebase.
— AutoJack