BS

braincompany/sessiongrep

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

43 stars 5 forks 质量 63 趋势 27Apache-2.0

CLI代理的本地优先内存层。将Claude代码、Codex CLI和光标会话历史索引到SQLite + FTS5中——可从CLI、TUI或MCP服务器搜索,方便下一次代理会话......

概览

为CLI代理提供本地优先的内存层。sessiongrep将你的Claude Code、Codex CLI、Cursor、Antigravity和Pi会话历史索引到一个SQLite + FTS5数据库中,然后给你一个CLI/TUI,方便你按主题、仓库、提供者或最新时间查找旧作品。它还附带一个MCP服务器,让你的代理可以搜索自己的历史记录。 真正的回报是可移动的上下文:你的会话历史不再局限于一个工具。你在Claude Code中开始的工作可以在Codex中继续,代理也能恢复——甚至批评——你使用的所有工具中自己的先前推理。 请阅读公告:Sessiongrep:一个本地优先的CLI代理内存层。 会话文字记录已经存在你的机器上——散布在 ~/.claude/projects、~/.codex/sessions、~/.cursor/projects 上,作为带有不透明文件名的嘈杂 JSONL 格式。信息不是丢失,而是被困住了。人类不想阅读;代理也不知道如何获取它。通过 JSONL 进行 Grep 淹没在工具负载中。

概述(AI 翻译)

你上周已经破解了那个漏洞。你下一次特工会议完全不知道。

CLI代理的本地优先内存层。sessiongrep将你的Claude Code、Codex CLI、Cursor、Antigravity和Pi会话历史索引到单一SQLite + FTS5数据库中,然后给你一个CLI/TUI,按主题、仓库、提供者或最新时间查找旧作品。它还附带MCP服务器,方便代理自行搜索历史。

真正的回报是可移动的上下文:你的会话历史不再局限于一个工具。你在Claude Code中开始的工作可以在Codex中继续,代理也能恢复——甚至批评——你使用的所有工具中自己的先前推理。

请阅读公告:Sessiongrep:一个本地优先的CLI代理内存层。

为什么

会话文字记录已经存在你的机器上——散布在~/.claude/projects、~/.codex/sessions、~/.cursor/projects中,作为带有不透明文件名的嘈杂JSONL格式。信息不是丢失,而是被困住了。人类不想阅读它;代理们不知道如何获取它。JSONL上的Grep淹没在工具负载中。shell历史记录捕获命令,但无法进行推理。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

sessiongrep

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.

Why

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.

How it works

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.

Only the conversation is indexed: your prompts and the agent’s replies. Tool calls and their output, injected context (AGENTS.md, skill bodies, system reminders), and sub-agent transcripts are left out, so a hit points at what was discussed rather than at every file an agent happened to read. Titles come from each tool’s own session names where they exist (Claude Code’s /rename and generated titles, Codex thread names), falling back to the first prompt.

Installation

You need session history from at least one of Claude Code, Codex CLI, Cursor, Antigravity, or Pi.

Prebuilt binaries (macOS, Linux)

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →