Bookmark
Context snapshots for Claude Code.
You've been deep in a coding session. Claude knows your architecture, the decisions you've made, the bugs you've fixed, the open items left. Then the context window compacts — or you close your terminal and come back tomorrow.
Claude forgets everything.
Bookmark fixes this. It captures snapshots of your session context automatically and restores them when you return. No manual steps. No copy-pasting context. You pick up exactly where you left off.
The Problem
Claude Code sessions are ephemeral. Context is lost when:
- Compaction happens — the conversation gets too long and Claude summarizes it, losing detail
- You close your terminal — start a new session and Claude has no memory of the last one
- Your computer restarts — everything from that deep debugging session is gone
- You switch between projects — come back a day later and Claude doesn't know what "we" decided
This creates a painful pattern: every new session starts with you re-explaining what you were working on, what you decided, what's still left to do.
How Bookmark Works
Bookmark runs as a small external process. Four hooks keep a durable handoff current:
| Hook | When | What |
|---|
| PreCompact | Before context compaction | Captures a mechanical file/tool checkpoint |
| SessionStart | New session begins | Restores prior context so Claude knows what you were doing |
| UserPromptSubmit | Every user message | Checks time and token thresholds; alerts at 75% used |
| Stop | End of every assistant turn | Captures files; asks once per session for a fresh handoff only when context usage is at or above the token threshold (75%) |
When you open a new terminal and run claude, Bookmark restores your prior context. Claude greets you knowing what you were working on, what decisions were made, and what's left to do.
What Gets Captured
Bookmark separates reliable mechanical evidence from semantic judgment:
bookmark.context.md — Claude writes the current task, status, remaining work,
decisions, risks, open questions, sources of truth, and next steps.
- JSON snapshots and
LATEST.md — Bookmark extracts file changes, tool counts,
capture reason, model, and measured context usage from the transcript.
The per-prompt threshold check makes no API call and reads only the transcript tail. Full
transcript parsing runs only when an interval or threshold capture is due. The semantic handoff
is capped at 800 tokens and points to source files instead of copying them.
File paths in snapshots are now project-relative
As of v0.3.3, file paths in .bookmark/snapshots/SNAP_*.json are stored
relative to project_path (e.g. src/foo.ts instead of
/Users/me/dev/git-folder/myapp/src/foo.ts). Older snapshots may carry
pre-move absolute paths that went stale when a project was relocated
(e.g. ~/Desktop/git-folder/... → ~/dev/git-folder/...); those are not
auto-rewritten — they're left intact so the historical record stays
honest. Going forward, a project move only invalidates project_path
itself, not the per-file entries inside each snapshot.
Install
Via Claude Code plugin marketplace (recommended):
/plugin marketplace add tyroneross/bookmark
/plugin install bookmark@bookmark
Via npm (in a project):
npm install @tyroneross/bookmark
Hooks are configured automatically. Start a Claude Code session and you're covered.
Via npm (globally):
npm install -g @tyroneross/bookmark
Then activate in any project by running bookmark setup in your project directory.
Commands
Use these inside Claude Code:
| Command | What it does |
|---|
/bookmark | Show current session context and bookmark status; forwards any arguments to the bookmark CLI |
/bookmark:snapshot | Take a manual snapshot right now |
/bookmark:restore | Restore from latest or a specific snapshot |
/bookmark:status | Show snapshot count, compaction cycles, last snapshot time |
/bookmark:list | List available snapshots with details |
CLI