Skip to content

Resume

aichat resume lets you continue sessions with lineage-based chaining for better control than compaction alone. Compaction preserves full history on disk but reduces the active API context to a lossy summary. With aichat resume, you get a fresh session that links back to every ancestor with explicit lineage pointers and tools to recover any detail on demand.

When you resume a session, you choose one of these strategies:

StrategyWhat it doesWhen to use
Resume as-isOpen the session directly with claude --resumeStill have context headroom
CloneCopy session file, resume the cloneWant a safety copy first
TrimTruncate bloated tool outputs and early messagesQuick fix, frees 30-50%
Smart trimAI decides what is safe to cutSurgical precision needed
RolloverFresh session with lineage pointersClean slate, full history preserved

Rollover is the most frequently used strategy. See Rollover Details for a deep dive on how it works.

While inside a Claude Code session, when you are close to filling up context, type:

Terminal window
>resume

(Or >continue, >handoff — the > prefix is required.)

This triggers a UserPromptSubmit hook that blocks handling by Claude Code (no further tokens consumed), copies the current session ID to your clipboard, and shows instructions to quit and run aichat resume <paste>.

Requires the aichat plugin.

Terminal window
# Auto-find latest session for current project/branch
aichat resume
# Resume a specific session (opens resume menu)
aichat resume <session_id>

The resume menu presents the strategy options listed above. Pick one and the tool handles cloning, trimming, or rollover automatically.

The rollover subcommand gives direct access to rollover with more control:

Terminal window
# Interactive rollover (shows lineage, pick options)
aichat rollover
# Quick rollover -- lineage only, no summarization
aichat rollover abc123 --quick
# Rollover with custom context-extraction prompt
aichat rollover abc123 -p "Focus on the auth changes"
CommandDescription
aichat lineage [session]Show the parent lineage chain
aichat trim [session]Trim session (interactive or direct)
aichat rollover [session]Rollover to fresh session
aichat clone [session]Clone a session file

Every resumed session carries metadata linking it back to its parent:

{
"continue_metadata": {
"parent_session_file": "/path/to/parent.jsonl",
"parent_session_id": "abc123-...",
"continued_at": "2025-12-19T..."
}
}

This creates a linked chain that the agent can traverse to recover any prior context. For the full technical details, see Rollover Details.