Ephemeral branch-scoped handoff state for AI coding agents. Like git stash, but for your agent's working memory.
Open Source · Free · No Signup · No Cloud · MIT License
Every new AI session starts cold. Switch tools, hit a token limit, come back the next day. The agent has no idea what you were doing. context0 fixes that by saving a compact checkpoint scoped to your git repo and branch, so the next agent resumes exactly where you left off.
It stores the useful handoff state:
- what was done
- what should happen next
- blockers
- test status
- key files
- commit SHA
It does not try to be long-term project memory, static project rules, or full conversation replay. You get the state you need to resume work, without dragging along stale assumptions or session junk.
context0is ephemeral session state for the current branch.context0is not long-lived project memory like architecture notes or decision logs.context0is not static instruction files likeCLAUDE.mdorAGENTS.md.context0does not carry over your full chat history. It carries the structured handoff state needed to resume the task cleanly.
curl -fsSL https://raw.githubusercontent.com/SyedSibtainRazvi/context0/main/install.sh | shWorks on macOS (Intel and Apple Silicon) and Linux (x86_64 and arm64).
Windows: download the .zip from Releases and add the binary to your PATH.
With MCP configured, you do not manually run context0 save or context0 resume. Tell the agent you are switching tools or ending the session and it saves everything through MCP. On the next session, the agent is instructed to load the latest checkpoint for the current branch at session start.
If you prefer, ask Claude or another coding agent to do the setup for you step by step. For example:
Install context0 on this machine, run context0 init-rules in this project, set up MCP for Claude Code, and verify everything step by step.
Step 1. Install:
curl -fsSL https://raw.githubusercontent.com/SyedSibtainRazvi/context0/main/install.sh | shStep 2. Install rule files (once per project):
context0 init-rulesThis writes agent instruction files (CLAUDE.md, .cursor/rules/context0.mdc, AGENTS.md) into your project. They tell the agent when to save and load context automatically. No manual prompting needed.
Step 3. Configure MCP for your tool:
claude mcp add context0 context0 mcp-serverCursor does not inherit your shell PATH, so use the full binary path. Find it with which context0, then add to ~/.cursor/mcp.json:
{
"mcpServers": {
"context0": {
"command": "/Users/your-username/.local/bin/context0",
"args": ["mcp-server"]
}
}
}Restart Cursor after editing.
Add to ~/.codex/config.json using the full path from which context0:
{
"mcpServers": {
"context0": {
"command": "/Users/your-username/.local/bin/context0",
"args": ["mcp-server"]
}
}
}That's it. After MCP is configured, you can talk to the agent normally. You do not need to manually run context0 commands inside Claude Code, Cursor, or Codex.
Use these commands only if you want to work without MCP, or prefer to save and resume manually from the terminal:
# Save a checkpoint
context0 save \
--done "implemented OAuth flow" \
--next "add refresh token logic" \
--files src/auth.rs --files src/middleware.rs
# Resume latest checkpoint
context0 resume
# Resume as JSON
context0 resume --json
# Show recent checkpoints
context0 log --limit 20
# Delete checkpoints for current branch
context0 clearhttps://syedsibtainrazvi.github.io/context0
- Key is
git repo root + branch.feature/authandmainstay completely separate. - Stored in local SQLite at
~/.context0/context0.db. Nothing leaves your machine. - No cloud, no auth, no runtime dependencies.
| Setting | Default |
|---|---|
| Database | ~/.context0/context0.db |
| Override | context0 --db /path/to/custom.db <command> |
| SQLite busy timeout | 30000 ms (CONTEXT0_BUSY_TIMEOUT_MS) |
See CONTRIBUTING.md.
MIT