You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the conversation compacts, the agent loses track of which files it was editing, what tasks were in progress, and what the last user prompt was. The user has to recap manually every time.
contextcrawler already has the SQLite tracking substrate (history.db) and owns the hook installation path (contextcrawler init). A scoped-down session-continuity feature is achievable without major new infrastructure.
Problem
Today, after a Claude Code compact, the agent has no idea:
Which branch / worktree it was on
Which files it last touched
What command failed and was being investigated
What the last user prompt was
The user has to recap manually.
Proposed Design (scoped down)
Start with the 5 highest-value signal categories, drawn from data already in history.db. Resist the temptation to track 20+ event types in v1 — measure usefulness of the smaller set first.
Working tree — branch, worktree path, dirty-files list (captured from git status invocations already passing through contextcrawler)
Last failures — most recent 5 rows from parse_failures table (already exists)
Last commands — most recent 10 rows from commands table with non-trivial exec time
Active deps — from cargo/pnpm invocations: which packages were last touched
User intent hint — last proxy invocation often indicates what was being debugged
Two new commands:
contextcrawler session snapshot # build snapshot, store in DB
contextcrawler session resume # emit Session Guide markdown to stdout
Background
When the conversation compacts, the agent loses track of which files it was editing, what tasks were in progress, and what the last user prompt was. The user has to recap manually every time.
contextcrawler already has the SQLite tracking substrate (
history.db) and owns the hook installation path (contextcrawler init). A scoped-down session-continuity feature is achievable without major new infrastructure.Problem
Today, after a Claude Code compact, the agent has no idea:
The user has to recap manually.
Proposed Design (scoped down)
Start with the 5 highest-value signal categories, drawn from data already in
history.db. Resist the temptation to track 20+ event types in v1 — measure usefulness of the smaller set first.git statusinvocations already passing through contextcrawler)parse_failurestable (already exists)commandstable with non-trivial exec timecargo/pnpminvocations: which packages were last touchedproxyinvocation often indicates what was being debuggedTwo new commands:
Hook wiring (extends existing
contextcrawler init):{ "hooks": { "PreCompact": [{"command": "contextcrawler session snapshot"}], "SessionStart": [{"command": "contextcrawler session resume --if-snapshot"}] } }Snapshot persists in new
session_snapshotstable:--if-snapshotreturns empty output (no-op) if no snapshot exists for the session — keeps fresh sessions clean.Why now
history.db— just need to surface themcontextcrawler initEffort
M (1 week) for cut-down. XL (2-3 weeks) for full 23-category version. Start cut-down, expand only if there's empirical demand.
Dependencies
Out of scope (v1)
gain --historyalready gives you raw)