cd /news/developer-tools/sessiongrep-local-first-memory-layer… Β· home β€Ί topics β€Ί developer-tools β€Ί article
[ARTICLE Β· art-82297] src=github.com β†— pub= topic=developer-tools verified=true sentiment=Β· neutral

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.

read4 min views1 publishedJul 31, 2026
Sessiongrep: Local-first memory layer for CLI agents
Image: source

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.

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(1.70+)- Claude Code, Codex CLI, and/or Cursor installed (for session data)

git clone git@github.com:braincompany/sessiongrep.git
cd sessiongrep

cargo install --path .

This installs two binaries to ~/.cargo/bin/

:

sessiongrep

β€” CLI and TUIsessiongrep-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 <id>

,codex resume <id>

, orpi --session <id>

). Cursor and Antigravity resume are not currently supported. - Claude, Cursor, and Pi subagent transcripts are excluded from indexing to avoid duplicate records.

Early but usable β€” pre-release, built from source (no tagged release yet). The CLI surface and MCP tool names are likely to stay stable; the on-disk index schema may still change (delete ~/.local/share/sessiongrep/index.db

and let it rebuild if you hit a schema mismatch).

Issues and pull requests are welcome. For bugs, please include your provider versions and a sessiongrep doctor

output. For features, a quick issue to discuss scope before sending a PR keeps things moving.

Apache-2.0. See LICENSE.

── more in #developer-tools 4 stories Β· sorted by recency
github.com Β· Β· #developer-tools
qm
── more on @sessiongrep 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/sessiongrep-local-fi…] indexed:0 read:4min 2026-07-31 Β· β€”