Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-context

A CLI tool that saves context from Claude Code sessions, git history, and manual notes for reuse across sessions and code reviews.

Why

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.

Install

go build -o ai-context .

Commands

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

Usage

Capture context from a Claude Code session

# 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"

Capture context from git history

ai-context capture --from-git "HEAD~5..HEAD" --title "Recent changes" --tags "git"

Manually add context

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" --editor

List and filter contexts

ai-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-cli

View a context

ai-context show ctx_3dc9d373

# Prefix match works too
ai-context show ctx_3dc

Generate a code review document

# 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 --pr

Export a context

ai-context export ctx_3dc --format md
ai-context export ctx_3dc --format json
ai-context export ctx_3dc --format clipboard

Delete a context

ai-context delete ctx_3dc

Storage

Contexts 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

Global Flags

--config-dir   config and storage directory (default: ~/.ai-context)
--claude-dir   Claude Code data directory (default: ~/.claude)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages