Sessiongrep: Local-first memory layer for CLI agents Sessiongrep, a new local-first memory layer for CLI agents, indexes session histories from Claude Code, Codex CLI, Cursor, Antigravity, and Pi into a single SQLite + FTS5 database, providing a CLI/TUI and MCP server for searching and retrieving past work. The tool, developed by Brain Company, keeps all data local with a static binary and no daemon, enabling agents to recover and critique their own prior reasoning across different tools. You solved that bug last week. Your next agent session has no idea. A local-first memory layer for CLI agents. sessiongrep indexes your Claude Code, Codex CLI, Cursor, Antigravity, and Pi session histories into a single SQLite + FTS5 database, then gives you one CLI/TUI to find old work by topic, repo, provider, or recency. It also ships an MCP server so your agent can search its own history. The real payoff is portable context: your session history isn't trapped in one tool. Work you started in Claude Code can continue in Codex, and an agent can recover — and even critique — its own prior reasoning across every tool you use. Read the announcement: Sessiongrep: a local-first memory layer for CLI agents https://brain.co/blog/sessiongrep-a-local-first-memory-layer-for-cli-agents . Session transcripts already live on your machine — scattered across ~/.claude/projects , ~/.codex/sessions , ~/.cursor/projects as noisy JSONL with opaque filenames. The information is not missing, it's stranded. Humans don't want to read it; agents don't know how to retrieve it. Grep over JSONL drowns in tool payloads. Shell history captures commands but not reasoning. Cloud-synced or vector-backed alternatives bring secrets and URLs into systems that aren't yours. sessiongrep keeps recall local. One static binary, one SQLite file, no daemon, no server. The index is a disposable cache — delete it and rebuild it whenever you want. Provider adapters normalize Claude, Codex, Cursor, Antigravity, and Pi transcripts into a single Session model and write them into SQLite WAL mode with an FTS5 virtual table over transcript text, title, summary, and preview. Every read command runs an incremental reindex first — files whose mtime and size haven't changed are skipped, so search and list stay fast even as your history grows. Rust toolchain https://rustup.rs/ 1.70+ - Claude Code, Codex CLI, and/or Cursor installed for session data git clone git@github.com:braincompany/sessiongrep.git cd sessiongrep Install both binaries cargo install --path . This installs two binaries to ~/.cargo/bin/ : sessiongrep — CLI and TUI sessiongrep-mcp — MCP server Make sure ~/.cargo/bin is in your PATH. Add to your ~/.bashrc or ~/.zshrc if not already present: export PATH="$HOME/.cargo/bin:$PATH" The index updates automatically — every command search, list, tui, etc. runs an incremental reindex before executing. No cron jobs or manual steps needed. To force a full rebuild from scratch: sessiongrep reindex --full sessiongrep list --limit 20 recent sessions auto-indexes on first run sessiongrep search "auth bug" keyword search sessiongrep search "redis" --provider codex sessiongrep search "datadog" --provider cursor sessiongrep search "temporal" --provider pi sessiongrep show claude:79accec8-5bf5-415b-a4a5-fe370eb2c998 sessiongrep resume 79accec8 --dry-run sessiongrep export 79accec8 --format markdown sessiongrep doctor health check sessiongrep tui interactive browser The MCP server lets AI agents search and retrieve your past sessions programmatically — no copy-pasting context from old conversations. claude mcp add --scope user --transport stdio sessiongrep -- sessiongrep-mcp codex mcp add sessiongrep -- sessiongrep-mcp Start a new session and try a prompt like: "Find my previous session where I was setting up Datadog metrics" The agent will call search sessions to find matches and get session to pull in relevant context. | Tool | Description | |---|---| search sessions | Search sessions by keyword, with optional provider filter and limit | get session | Get full transcript and metadata by session ID supports max lines to limit context | list sessions | List recent sessions, filterable by provider and path prefix | timeline for repo | Day-bucketed metadata timeline for a repo path prefix — scoped view of what changed over time | get resume command | Get the CLI command to resume a session in its native tool | Optional config file at ~/.config/sessiongrep/config.toml : providers.claude enabled = true paths = "~/.claude/projects" providers.codex enabled = true paths = "~/.codex/sessions" providers.cursor enabled = true paths = "~/.cursor/projects" providers.antigravity enabled = true paths = "~/.gemini/antigravity/brain" providers.pi enabled = true paths = "~/.pi/agent/sessions" index db path = "~/.local/share/sessiongrep/index.db" cache dir = "~/.cache/sessiongrep" ui preview lines = 30 search default limit = 50 prefer current repo = true - Everything stays on your machine. No network calls, no telemetry, no cloud sync. - The tool is read-only — it never modifies your session files. - The SQLite index is a derived cache. Delete it anytime and reindex --full rebuilds it from your transcripts. - All paths database, cache, config are user-local under ~/.local/share , ~/.cache , and ~/.config . - Resume delegates to the native provider CLI claude --resume