Never lose context between Claude Code sessions again.
You're deep in a Claude Code session β 45 minutes in, multiple files changed, complex decisions made. Then:
- Context gets compacted and Claude forgets what it was doing
- You
/clearor start a new session and lose everything - You spend 10 minutes re-explaining where you left off
- Claude makes the same wrong decisions you already corrected
Sound familiar?
claude-baton gives Claude Code persistent memory across sessions. One command saves what was built, what's next, and why β one command brings it back. Context compaction? A PreCompact hook auto-saves before anything is lost.
Session 1 Session 2
βββββββββββββββββββββββ βββββββββββββββββββββββ
β Work on features β β /memo-resume β
β Make decisions β β β β
β Hit blockers β β Full context restoredβ
β ...context compacts βββπΎβββ β Decisions preserved β
β (auto-saved!) β DB β Next steps ready β
βββββββββββββββββββββββ β Git diff shown β
β Ready to continue! β
βββββββββββββββββββββββ
- π One-command resume β Start any session with
/memo-resumeto restore what was built, decisions, blockers, and next steps - πΎ Auto-checkpoint β PreCompact hook saves your session state before Claude compacts context. You never have to remember.
- π Diff intelligence β Resume shows what changed since your last session (new commits, modified files, dependency changes)
- π§ Decision memory β Key decisions and their reasoning survive across sessions
- π EOD summaries β Generate end-of-day reports from all sessions with
/memo-eod - π° Cost transparency β EOD shows daily LLM calls;
claude-baton statusshows all-time usage and DB size - π Fully local β All data in a local SQLite database. No cloud, no API keys, no data leaves your machine.
Claude Code is powerful, but it has structural limitations around context persistence. Here's what changes with claude-baton:
| Scenario | Claude Code alone | Claude Code + Baton |
|---|---|---|
| Context compaction | π΄ Claude silently loses session state. After compaction, it may forget decisions, repeat mistakes, or restart work already done. | π’ PreCompact hook auto-saves a structured checkpoint before compaction. Claude resumes with full context. |
| New session | π΄ Blank slate. You re-explain everything from scratch. Claude has to re-read files and rediscover project state. | π’ /memo-resume loads the last checkpoint with what was built, decisions, blockers, next steps, and git diff since then. |
| Decision persistence | π΄ "We decided not to use Redux because..." β gone after /clear. Claude may suggest Redux again next session. |
π’ Decisions and their reasoning are stored in checkpoints and surfaced on resume. |
| Long-running tasks | π΄ Multi-session tasks lose continuity. Each session starts from zero context. | π’ Chained checkpoints maintain a thread across sessions. Each auto-checkpoint includes the previous one for continuity. |
| Team handover | π΄ No way to export what Claude was doing. Knowledge lives only in the conversation. | π’ claude-baton export produces JSON. /memo-eod generates daily summaries of all sessions. |
| Git awareness | π‘ Claude can run git commands but doesn't automatically know what changed since last session. | π’ Resume computes git diff since checkpoint β shows new commits, modified files, dependency changes. |
Claude Code has no persistent structured memory across sessions. This is the fundamental gap:
-
No session state survives
/compactor/clearβ Claude Code's context window is ephemeral. When it compacts, the nuanced understanding of why you made decisions, what you tried and rejected, and where you were headed is lost. CLAUDE.md can store project rules, but not dynamic session state. -
No automatic preservation β There's no built-in mechanism to save state before compaction. You'd have to manually write notes every time, which you won't.
-
No structured handover β Even if you paste notes into a new session, Claude has to parse free-text. claude-baton provides structured data (what was built, current state, next steps, decisions, blockers, git context) that Claude can act on immediately.
-
No cross-session diff intelligence β Claude Code can't tell you "3 files changed and 2 new commits landed since your last session." claude-baton compares checkpoint state against current git state and surfaces the delta.
-
No session history β There's no way to look back at what you accomplished across multiple sessions in a day. claude-baton's
/memo-eodsynthesizes all checkpoints into a daily summary.
claude-baton fills these gaps by sitting alongside Claude Code as an MCP server β it doesn't replace anything, it adds the persistence layer that's missing.
Two commands. That's it.
npm install -g claude-baton claude-baton setup
npm install -g claude-baton@latest
claude-baton setup # re-registers MCP server with new versionYou must run claude-baton setup after upgrading β the MCP server runs as a long-lived process inside Claude Code, so it won't pick up the new version until re-registered.
Start a new Claude Code session and you're ready to go:
You: /memo-checkpoint β saves session state
You: /compact β safe, state is preserved
You: /memo-resume β restores everything
## Session Resume β my-project β 2026-03-25
Resuming from checkpoint: 2026-03-25T15:26:07Z
Source: auto checkpoint
### Branch
main β currently on main
### Where We Left Off
v2.1.1 published on npm. Build clean. All tests passing.
### What Was Built (Last Session)
Implemented auto-checkpoint chaining with git diff context,
switched LLM from haiku to sonnet for better summarization quality.
### Decisions Made
Used claude mcp add for server registration instead of manual config.
Added source field (manual/auto) to distinguish checkpoint types.
### Next Steps
1. Test /memo-resume in a fresh session
2. Verify auto-checkpoint fires on context compaction
### Changes Since Checkpoint
No changes since checkpoint β clean working tree, HEAD at 795f9aa.
### Commits From Last Session
795f9aa 2.1.1
108b65e feat: switch LLM calls from haiku to sonnet
fe5dae0 docs: fix README to reflect claude mcp add registration
## EOD Summary β my-project β 2026-03-25
### What Was Built / Shipped
feat: auto-checkpoint chaining and resume resilience
feat: allowed tools for frictionless slash commands
fix: MCP server registration via claude mcp add
### Decisions Made
- Used claude mcp add for correct MCP discovery
- Chained auto-checkpoints with previous context + git diff
### Git Stats
- Commits today: 12
- Files changed: 15
- Feature areas: feat, fix, docs, style, chore
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Claude Code Session β
β β
β /memo-resume βββ reads latest checkpoint from DB β
β β β
β You work normally β
β β β
β /memo-checkpoint βββ saves state + git context to DB β
β β β
β /compact or /clear (safe!) β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββ β
β β πͺ PreCompact Hook (automatic) β β
β β β β
β β Context about to compact? β β
β β β Read conversation transcript β β
β β β Fetch previous checkpoint for chaining β β
β β β Extract state via claude -p --model sonnetβ β
β β β Save auto-checkpoint to DB β β
β βββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
~/.claude-baton/store.db
(local SQLite)
-
πΎ Checkpoint β Captures what you built, current state, next steps, decisions, blockers, learnings (corrections, wrong assumptions, failed approaches), and git context (branch, uncommitted files, recent commits)
-
πͺ Auto-checkpoint β Before context compaction, the PreCompact hook reads the transcript, fetches the previous checkpoint for continuity, and uses
claude -p --model sonnetto extract a structured checkpoint automatically β including learnings from the session -
π Resume β Fetches the latest checkpoint, compares current git state vs checkpoint state, computes what changed (new commits, file diffs, dependency changes), and presents a structured handover briefing
-
π EOD Summary β Synthesizes all checkpoints from the day into a daily summary: what was built, decisions made, blockers, and next steps
-
π Retro β Analyzes recent checkpoints to find recurring learnings, cross-references with existing memory and CLAUDE.md, checks git history for correction patterns, and proposes actionable updates to your project's memory files and rules
| Command | Description |
|---|---|
/memo-resume |
π Restore context from last checkpoint β run this at session start |
/memo-checkpoint |
πΎ Save session state with git context and learnings β safe to /compact after |
/memo-eod |
π End-of-day summary combining all sessions |
/memo-retro |
π Analyze checkpoint history, surface recurring learnings, propose memory/CLAUDE.md updates |
claude-baton setup # π§ one-time setup (MCP, hooks, commands) claude-baton status # π checkpoint counts, LLM calls, db size claude-baton projects # π list tracked projects claude-baton export [--project] # π€ export as JSON claude-baton import <file> # π₯ import from JSON claude-baton reset [--project] # ποΈ clear data (with confirmation) claude-baton uninstall # β remove everything cleanly claude-baton uninstall --keep-data # β uninstall but preserve your data
For automation and advanced use cases, claude-baton exposes 4 MCP tools:
| Tool | Description |
|---|---|
save_checkpoint |
Save session state (what was built, current state, next steps, learnings, git context) |
get_checkpoint |
Retrieve a checkpoint by ID, or the latest for the project |
list_checkpoints |
List checkpoints by date or most recent (supports limit param) |
daily_summary |
Generate EOD summary from the day's checkpoints |
| Alternative | Limitation |
|---|---|
| Manual notes | You have to remember to write them. You won't. |
| CLAUDE.md | Great for project rules, not for session state that changes every hour |
| TodoWrite | Tracks tasks, not context. Doesn't capture decisions, blockers, or git state |
| Just re-explain | Wastes 5-10 minutes per session. Loses decision reasoning. |
| Git commit messages | Captures what changed, not why or what's next |
claude-baton captures the full session context β what was built, why decisions were made, what's blocked, and what to do next β automatically.
claude-baton setup is a single command that configures everything:
β Registered MCP server (user scope β works across all projects)
β Registered PreCompact hook for auto-checkpoint
β Registered allowed tools (slash commands run without prompts)
β Initialized database at ~/.claude-baton/store.db
β Installed slash commands to ~/.claude/commands/
All data lives locally in ~/.claude-baton/store.db:
- checkpoints β session state snapshots with git context, source tracking (
manual|auto) - daily_summaries β LLM-generated EOD summaries
No data leaves your machine. No cloud. No API keys. LLM calls use your existing claude -p subscription.
- Node.js >= 18
- Claude Code CLI installed and authenticated
- No API keys needed β all LLM calls use
claude -p(your existing subscription)
git clone https://github.com/bakabaka91/claude-baton.git cd claude-baton npm install npm run build npm test # 109 tests
Clean removal β no traces left behind:
claude-baton uninstall # removes hooks, MCP server, commands, and database npm uninstall -g claude-baton # removes the binary
To keep your checkpoint data: claude-baton uninstall --keep-data
MIT
Built for developers who are tired of re-explaining context to Claude.
npm Β· Issues Β· Contributing
