A CLI tool that saves context from Claude Code sessions, git history, and manual notes for reuse across sessions and code reviews.
When reviewing code changes — especially migrations like Python → Java — the diff alone doesn't give enough context. This CLI captures decisions, rationale, and changes so reviewers (and future you) have the full picture.
go build -o ai-context .| Command | Description |
|---|---|
add |
Manually add a context entry |
capture |
Extract context from a Claude Code session or git history |
list |
List saved contexts with filtering |
show |
Display a saved context |
delete |
Delete a saved context |
review |
Generate a code review document from one or more contexts |
export |
Export a context as markdown, JSON, or clipboard |
sessions |
List available Claude Code sessions |
# List available sessions
ai-context sessions
# Capture by session ID (prefix match supported)
ai-context capture 6725b0f0 --title "Building ai-context CLI" --tags "cli,golang"ai-context capture --from-git "HEAD~5..HEAD" --title "Recent changes" --tags "git"ai-context add --title "Python to Java auth migration" --tags "migration,review" \
--body "Migrating Flask auth middleware to Spring Security. Using JPA instead of raw JDBC."
# Or use your editor
ai-context add --title "Design notes" --editorai-context list
ai-context list --tag migration
ai-context list --source session
ai-context list --since 2026-03-01
ai-context list --search "auth"
ai-context list --project ai-context-cliai-context show ctx_3dc9d373
# Prefix match works too
ai-context show ctx_3dc# Print to stdout
ai-context review ctx_aaa ctx_bbb
# Update the current branch's GitHub PR description
ai-context review ctx_aaa ctx_bbb --prai-context export ctx_3dc --format md
ai-context export ctx_3dc --format json
ai-context export ctx_3dc --format clipboardai-context delete ctx_3dcContexts are stored as markdown files with YAML frontmatter under ~/.ai-context/contexts/.
~/.ai-context/
contexts/
2026-03-13-session-building-ai-context-cli.md
2026-03-13-manual-python-to-java-auth-migration.md
--config-dir config and storage directory (default: ~/.ai-context)
--claude-dir Claude Code data directory (default: ~/.claude)