← the whole session

Fulcrum 11 of 18

When the conversation is compacted

When a long conversation fills the context window and Claude Code replaces the earlier part with a summary (compaction).

What goes wrong here

The summary is a paraphrase. The person's exact words become an agent's tidier version of them. The confirmed scope, the rigor score, pending items and earlier corrections can thin out or disappear. The agent carries on confidently from the summary.

How it compounds if nothing catches it

After compaction the agent is working from a map of a map. Anything the summary distorted now looks like something the person said, and the rest of the session builds on it with no memory that it was ever different.

What the harness does here

Before compaction, a hook saves session details and the person's messages, word for word, to disk. After compaction, other hooks put back two things: the session's structured record of intent, scope and unfinished items (also called a 'compaction', filed through compact-agentic-session), and the last rigor score. That way the agent resumes knowing what it was doing and why. CLAUDE.md asks agents to file that record themselves when a session is getting long, before automatic compaction fires.

The pieces that act here

  • pre-compact-extract.sh

    A hook: a script Claude Code runs on its own at a set moment.

  • post-compact-reinjection.sh

    A hook: a script Claude Code runs on its own at a set moment.

  • post-compaction-reload.sh

    A hook: a script Claude Code runs on its own at a set moment.

  • /compact-agentic-session

    Create and consume agent session compactions for cross-session continuity. Use when capturing or retrieving intent.

  • /agentic-session-compactions

    Create, consume, triage, and act on agent session compactions. Use when capturing or retrieving intent across sessions.

Loops that pass through here