AI project context recovery CLI for Claude Code, Codex, and Cursor
Project description
mind
Come back to an AI-assisted coding project after a week and recover the thread in minutes.
AI coding tools remember a session.
mindhelps you remember the project.
When you reopen a repo after time away, mind helps you recover:
- what the project is trying to do
- what already shipped
- what was in progress
- what is blocked
- what to do next
mind rebuilds that picture from your real Claude Code, Codex, and Cursor history plus the repo itself, then gives you a restore brief in the terminal.
mind sync
# leave the project for a week
mind restore
See the shape
If you want to preview the experience before using your own data:
mind doctor --demo
Example restore brief
Goal & Vision
SampleCo is a CLI that turns scattered AI session history into a two-minute
re-entry brief after time away.
Current Status
- mind sync ingests Claude Code, Codex, and Cursor artifacts for a repo.
- mind restore prints an AI digest plus a live git snapshot.
Active Work
- Hardening first-run diagnostics.
- Adding --inspect so users can see exactly which files feed a digest.
Next Actions
1. Run mind doctor after install.
2. Export ANTHROPIC_API_KEY or OPENAI_API_KEY.
3. mind sync in your repo, then mind restore.
The problem
If you bounce between projects, context loss becomes a hidden tax: rereading diffs, reopening tabs, scanning chats, rediscovering blockers, and asking the model to infer what you already knew last week.
mind is for that re-entry moment.
Who this is for
Use mind if you:
- work across several projects at once
- return to repos after days or weeks away
- use Claude Code, Codex, Cursor, or more than one AI coding tool
- lose time reconstructing project state before you can make progress again
What you get
- one restore brief instead of a chat-log archaeology session
- one recap across tools instead of separate Claude Code, Codex, and Cursor histories
- live git facts kept separate from AI-generated summaries
- an inspectable trust boundary before anything is sent to a model
- a compact social handoff when you want to share project status
Quick start
curl -LsSf https://raw.githubusercontent.com/matheusbuniotto/mind-cli/main/install.sh | sh
The installer adds uv if needed, installs mind-cli with uv tool install, then prints the next command to run.
Or install it directly:
# recommended
uv tool install mind-cli
# alternatives
uvx mind-cli --help
pip install mind-cli
# from source (dev / latest)
git clone https://github.com/matheusbuniotto/mind-cli
uv tool install ./mind-cli
mind init # first time: config wizard + skill + hooks
# after upgrading mind:
mind install -y # refresh skill + hooks only
Then, inside a repo:
mind sync
mind restore
What it reads
mind collects context from:
- Claude Code sessions
- Codex sessions
- Cursor workspace chat history
- recent git history
- uncommitted changes
- open GitHub issues
- project docs like
README.md,CLAUDE.md,AGENTS.md .spec/log.md- Claude memory files under
~/.claude/projects/.../memory
It then builds a restore brief that answers:
- What is this project trying to do?
- What is already done?
- What was in progress when work paused?
- What should I do next?
Built for trust
mind restore --inspectshows what would be read before any model call- the restore view separates AI summaries from live git facts
- session transcripts and project context are redacted for common secret patterns before provider calls
- API keys stay out of
config.yml
See Trust, privacy, and provenance for the full boundary.
Agent integrations
mind ships a mind-recap skill and a session-start hook that runs mind check (no LLM — only git/session staleness).
| Command | When |
|---|---|
mind init |
First run — config wizard + install skill/hooks |
mind install -y |
After uv tool install upgrade — refresh skill/hooks only |
mind install -y # refresh skill + hook (auto-detect agents)
mind install --skill # skill only
mind install --hook # hook only
mind init --no-agents # config only, skip skill/hooks
| Agent | Skill path | Hook |
|---|---|---|
| Claude Code | ~/.claude/skills/mind-recap/ |
SessionStart → ~/.claude/hooks/mind-check.sh |
| Cursor | ~/.cursor/skills/mind-recap/ |
sessionStart → ~/.cursor/hooks/mind-check.sh |
| Codex | ~/.codex/skills/ + ~/.agents/skills/ |
SessionStart → ~/.codex/hooks/mind-check.sh |
Without the mind CLI — install the skill from matheusbuniotto/skills-library:
npx skills add matheusbuniotto/skills-library --skill mind-recap -a claude-code -a cursor -a codex -g -y
When the user asks for a recap, the skill runs mind restore and asks before mind sync.
Hooks nudge on session start when the digest is missing, old, or git/sessions drifted (run /hooks in Codex to trust new hooks).
Core commands
Restore context
mind restore
mind restore /path/to/project
mind restore --force
mind restore -f
mind restore --inspect
restore is the main command. If a cached digest exists, it is shown immediately. If not, mind performs a sync first.
--inspect lists the local files mind would read for a digest and shows whether a cached digest exists, without calling a model or syncing.
Sync sessions
mind sync
mind sync /path/to/project
mind sync --all
mind sync -n 5
mind sync --inspect
By default, sync summarizes the 2 most recent sessions, plus all Claude compaction summaries, then regenerates the digest.
--all processes every discovered session instead of only the recent subset.
--inspect prints the same local file inventory sync would use, without writing SQLite rows or calling a model.
Check context freshness (no API)
mind check
mind check --quiet # for scripts / hooks
mind check --json
Share a social brief
mind share --social
mind share --social --no-clip
mind share --social creates a compact markdown update designed for Slack, Discord, GitHub, or social posts.
It keeps only the high-signal status, next steps, blockers, and a short change summary since the last sync.
First-run diagnostics
mind doctor
mind doctor --demo
mind doctor checks for a configured API key, git / gh, Claude Code / Codex / Cursor session directories, and your ~/.mind layout, then prints a single suggested next step.
--demo prints a bundled sample restore brief so you can see the output shape before any real project data exists on disk.
Releases
Tagged releases are built and validated in CI, published to PyPI through GitHub trusted publishing, and mirrored to GitHub Releases.
See RELEASING.md for the release process.
How the project is organized
The main code paths are small and easy to follow:
mind/main.py— thin Typer app wiringmind/commands/— command handlers split by workflow areamind/cli_helpers.py— shared CLI root-detection and API-key helpersmind/doctor.py— first-run environment diagnosticsmind/read_sources.py— local source enumeration for--inspectand provenancemind/redact.py— secret redaction before model callsmind/sync.py— session discovery, card creation, digest assemblymind/summarizer.py— AI calls for session cards and restore digestsmind/store.py— SQLite storage for session cards, digests, and notesmind/display.py— Rich output for restore views and progressmind/adapters/base.py— shared session adapter contractmind/adapters/registry.py— built-in adapter registrationmind/adapters/claude_code.py— Claude Code JSONL session parsingmind/adapters/codex.py— Codex JSONL session parsingmind/adapters/cursor.py— Cursor workspace storage parsingmind/adapters/project_files.py— static docs, git snapshot, and GH issue extractionmind/config.py— config file and environment loading
See ADAPTERS.md for the extension contract and the steps to add a new session source.
If you want to contribute, start with CONTRIBUTING.md. It covers local setup, tests, linting, adapter extensions, and a short list of good first issues.
Configuration
mind writes its config to:
~/.mind/config.yml
Important rules:
- API keys are never stored in
config.yml. - Keys can come from shell environment variables and/or dotenv files:
~/.mind/.env(global)<project>/.env(merged whenmindresolves a project path)
- Set
api_key_sourcein~/.mind/config.yml:env_first(default) — shell wins, then dotenv filesdotenv_first— dotenv files win, then shell
- supported env vars / dotenv keys:
ANTHROPIC_API_KEYOPENAI_API_KEYMIND_BASE_URLMIND_MODEL
Example:
export ANTHROPIC_API_KEY=sk-ant-...
# or, for an OpenAI-compatible provider
export OPENAI_API_KEY=sk-or-...
export MIND_BASE_URL=https://openrouter.ai/api/v1
export MIND_MODEL=claude-haiku-4-5-20251001
Data model
mind stores local state in SQLite under ~/.mind/mind.db.
Tables:
session_cards— summarized session artifacts keyed by source and file hashproject_digests— restore briefs for each project cwdproject_notes— manual notes attached to a project
This makes repeated restores cheap: if the underlying session file has not changed, the card can be reused.
Restore output
mind restore combines two layers:
- AI digest — a structured brief built from sessions, docs, notes, and static context
- Deterministic git snapshot — recent commits, recently edited files, dirty-tree count, and GH issues
That split matters because the AI layer restores intent, while the deterministic layer restores facts.
Each restore also prints a short Sources & trust boundary section that explains which artifacts came from SQLite, which project files are re-read on sync, and what is recomputed live from git / gh.
It also calls out the freshness boundary explicitly: the AI digest is cached from the last sync, while the live Git snapshot is recomputed on every restore.
The restore view now also adds a compact Since last sync diff and a Restore Highlights panel so blockers and next actions are visible before you scroll.
Trust, privacy, and provenance
What stays on disk locally
- Session cards and digests in
~/.mind/mind.db(see Data model). - Optional API key material in
~/.mind/.envand/or a project-level.env(never inconfig.yml). - Your agent tools’ own session files under
~/.claude/projects,~/.codex/sessions, and Cursor workspace storage. mindnever writes back into those agent session files.
What leaves your machine
- Only the summarization and digest prompts sent to your configured provider (Anthropic by default, or an OpenAI-compatible
base_url). - Before those calls,
mindapplies best-effort redaction for common secret patterns (API keys, GitHub tokens,Bearerheaders, AWS access key ids, PEM private-key headers, etc.). This is not a guarantee against all leaks — treat transcripts like sensitive source code.
How to verify before you run anything costly
mind sync --inspect/mind restore --inspect— enumerate inputs with no model calls.mind doctor— confirm tooling and session directories exist.
Manual notes
mind note "remember to revisit this API"
mind note
mind note --clean
mind notes
mind note "..." appends a timestamped project note.
mind note opens an interactive menu so you can add a note, view existing notes, or delete selected notes.
mind note --clean deletes all notes for the project after confirmation.
mind notes prints the current note list.
Development notes
- Python requirement:
>=3.11 - CLI entry point:
mind = "mind.main:app" - depends on
typer,rich,anthropic,openai,pyyaml,questionary
Practical workflow
- Work on a project in Claude Code, Codex, or Cursor.
- Run
mind sync <project>when you want to capture the current state. - Later, run
mind restore <project>to recover the mental model quickly.
Project intent
The goal is not to create a generic note-taking system.
The goal is to make project re-entry cheap enough that context loss stops being a real cost.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mind_cli-0.1.1.tar.gz.
File metadata
- Download URL: mind_cli-0.1.1.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4cfaa2833633dcc8092afe93efbbc4491887ed9f3a46e7ad202573ce06ebf33
|
|
| MD5 |
448400f2132f4a773e330f0e11bf0119
|
|
| BLAKE2b-256 |
34aa11d9c7a9485b4e76d7f8bbb50fae53d6792ceda7c0e03dab096e87b9d1eb
|
Provenance
The following attestation bundles were made for mind_cli-0.1.1.tar.gz:
Publisher:
release.yml on matheusbuniotto/mind-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mind_cli-0.1.1.tar.gz -
Subject digest:
e4cfaa2833633dcc8092afe93efbbc4491887ed9f3a46e7ad202573ce06ebf33 - Sigstore transparency entry: 1564847000
- Sigstore integration time:
-
Permalink:
matheusbuniotto/mind-cli@bb46a743df242bbe35f63ed00d72153e2d5cddef -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/matheusbuniotto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bb46a743df242bbe35f63ed00d72153e2d5cddef -
Trigger Event:
push
-
Statement type:
File details
Details for the file mind_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mind_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 58.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5f38755823cfcee70e1c0eba01d56258a40a4e50500539685a00f833d15d3bf
|
|
| MD5 |
81d2594d41b912298b4cafa1019b0efd
|
|
| BLAKE2b-256 |
6577ffa612196dc8a1734513700a6664808bc91111faa6b59b4c70f5372ac1b3
|
Provenance
The following attestation bundles were made for mind_cli-0.1.1-py3-none-any.whl:
Publisher:
release.yml on matheusbuniotto/mind-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mind_cli-0.1.1-py3-none-any.whl -
Subject digest:
e5f38755823cfcee70e1c0eba01d56258a40a4e50500539685a00f833d15d3bf - Sigstore transparency entry: 1564847397
- Sigstore integration time:
-
Permalink:
matheusbuniotto/mind-cli@bb46a743df242bbe35f63ed00d72153e2d5cddef -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/matheusbuniotto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bb46a743df242bbe35f63ed00d72153e2d5cddef -
Trigger Event:
push
-
Statement type: