Session continuity for Claude Code. Save, load, and search your work like video game checkpoints.
> /save
Saved -- My App (save_1711152000000)
Implementing JWT authentication for the API endpoints
Next: Add refresh token endpoint in src/auth.ts
> /load
=== Previously on: My App ===
Saved 2h ago (manual) on MacBook-Pro
Branch: feature/auth | Last commit: a1b2c3d Add login endpoint
INTENT
Implementing JWT authentication for the API endpoints
PROGRESS
- src/auth.ts (modified) -- Added JWT token generation with RS256
- src/middleware/auth.ts (created) -- Auth middleware for protected routes
- src/auth.test.ts (created) -- Started unit tests (incomplete)
DECISIONS
- Used RS256 over HS256 for JWT signing (need key rotation)
NEXT STEPS
1. Implement the refresh token endpoint in src/auth.ts
2. Finish unit tests in src/auth.test.ts
3. Add rate limiting to the login endpoint
RECENT LESSONS
- jsonwebtoken RS256 requires PEM format keys
=== Ready to continue ===
Three commands:
| Command | What it does |
|---|---|
/save |
Checkpoint your session: intent, files changed, decisions, next steps |
/load |
Resume from a save with a "Previously on..." briefing |
/saves |
Browse and search past saves across projects |
Plus a SessionEnd hook that auto-saves on every session exit as a safety net.
git clone https://github.com/andrew-shwetzer/claude-code-save.git
cd claude-code-save
./setup.shThat's it. The installer copies commands, hook, and scripts to ~/.claude/ and creates a default config.
When you run /save, Claude:
- Detects your project from the working directory (via config, git repo name, or directory name)
- Captures git state: branch, last commit, uncommitted changes
- Writes a structured JSON save to
~/.claude/saves/<project>/with:- What you were working on (intent)
- Files you changed and what changed in each
- Decisions you made and why
- Specific next steps, ranked by priority
- Lessons learned (if any)
- Tags for searchability
- Writes human-readable markdown to a daily progress file (backwards compatible)
- Appends to a search index for fast lookups
The killer feature. When you start a new session and run /load:
- Finds the most recent save for your current project
- Reads the structured save state
- Checks what changed since the save (new commits, branch changes, uncommitted files)
- Outputs a scannable "Previously on..." briefing
- Loads project lessons into context
- You're immediately ready to pick up where you left off
You can also load by project (/load my-app) or by save ID (/load save_1711152000000).
Browse your save history:
> /saves
=== Session Saves ===
ID Project When Type Intent
save_1711152000000 my-app 2h ago manual Implementing JWT auth
save_1711148400000 my-app 3h ago auto (session exit)
save_1711134000000 api-server yesterday manual Fixing rate limiter bug
Showing 3 of 3 saves across 2 projects.
/saves <project> -- filter by project | /saves search "query" -- search
Filter by project (/saves my-app) or search (/saves search "database migration").
Your project is detected automatically, in this priority order:
-
.claude-save-config.jsonin your project root (most reliable):{"project": {"slug": "my-app", "name": "My App"}} -
~/.claude/saves/config.jsonpath mappings:{ "projects": { "my-app": ["~/projects/my-app"], "api": ["~/work/api-server"] } } -
Git repo name (from
git rev-parse --show-toplevel) -
Directory name (fallback)
Config lives at ~/.claude/saves/config.json (created by setup):
{
"max_saves_per_project": 50,
"projects": {},
"sync": {
"enabled": false
},
"markdown_progress": {
"enabled": true,
"directory": "~/Desktop/Claude Completed Tasks"
}
}| Setting | Default | Description |
|---|---|---|
max_saves_per_project |
50 | Old saves auto-pruned when limit is exceeded |
projects |
{} |
Map project slugs to directory patterns |
sync.enabled |
false |
Auto-push/pull saves via git for cross-machine sync |
markdown_progress.enabled |
true |
Write human-readable daily markdown files |
markdown_progress.directory |
~/Desktop/Claude Completed Tasks |
Where markdown goes |
~/.claude/
commands/
save.md # /save command
load.md # /load command
saves.md # /saves command
hooks/
save-progress.sh # SessionEnd auto-save hook
saves/
config.json # Configuration
index.jsonl # Search index (append-only)
schema/
save-state.schema.json # JSON Schema reference
scripts/
detect-project.sh # Project detection logic
my-app/ # Per-project save directories
20250323_143000.json # Individual save states
lessons.md # Project lessons (append-only)
api-server/
20250322_091500.json
lessons.md
Each save is a self-contained JSON file. See schema/save-state.schema.json or examples/save-state.json for the full structure.
Key fields:
| Field | Description |
|---|---|
intent |
What you were in the middle of (not what you finished) |
files_modified |
Files changed with action type and description |
decisions |
Choices made and their rationale |
next_steps |
Specific, actionable items ranked by priority |
lessons |
Technical pitfalls, insights, patterns (rare, timeless) |
git |
Branch, last commit, uncommitted changes |
tags |
Free-form labels for search |
Save on your laptop, /load on your desktop. Sync uses a private git repo as the transport.
Setup:
# During install:
./setup.sh --sync git@github.com:you/claude-saves-private.git
# Or add sync to an existing install:
cd ~/.claude/saves
git init
git remote add origin git@github.com:you/claude-saves-private.git
git push -u origin mainThen set sync.enabled to true in ~/.claude/saves/config.json:
{
"sync": {
"enabled": true
}
}How it works:
/saveand the SessionEnd hook auto-commit and push after writing saves/loadauto-pulls before reading saves- Conflict-free by design: each save is its own file (timestamped), and
index.jsonlis append-only - If the network is down, saves are stored locally and sync on the next push
config.jsonis gitignored (machine-specific settings stay local)
Requirements: A private git remote. GitHub, GitLab, Bitbucket, or a bare repo on your own server all work. Use a private repo since saves contain file paths and session context.
Custom progress directory: Change markdown_progress.directory in config.json.
Disable markdown output: Set markdown_progress.enabled to false if you only want JSON saves.
Per-project config: Drop a .claude-save-config.json in any project root for reliable detection in monorepos.
- Claude Code CLI
- Python 3 (used by the hook for JSON handling)
- macOS or Linux
- Git (optional, for git state capture)
MIT