
在你的AI编码会话中搜索和记忆——一个索引覆盖在Claude Code、Codex和Pi之上。从CLI中模糊查找和恢复,通过MCP给代理调用,并获取使用报告。
概览
在你的AI编码会话中搜索和记忆。通过Claude Code、Codex、Pi和OpenCode进行索引——模糊地从CLI中查找并恢复过去的会话,通过MCP让代理回忆之前的工作,并查看你的代币去向。 每次AI编程会话都会留下一份文字记录。Claude Code把它们埋在~/.claude/projects/里,Codex和Pi有自己的布局,OpenCode把所有内容都保存在SQLite数据库里——而且里面的所有内容(你尝试过的、你决定的、坏掉的)实际上都是只写入的。 Sessions为所有内容构建了全文检索索引,并使这些历史以三方面实用: - — 模糊地查找所有四个工具的过去会话,按相关性排序,然后重新进入。- — 代理搜索你的历史,回到代码库时拉取仓库范围的上下文入门,并通过捆绑技能回答“我上周做了什么?”。- — 跨工具、模型和项目的代币/成本仪表盘。 编译后的二进制文件在dist/sessions上。
概述(AI 翻译)
会议
在你的AI编码会话中进行搜索和记忆。 一个索引覆盖Claude Code、Codex、Pi和OpenCode——从CLI中模糊查找并恢复过去的会话,通过MCP让代理回忆之前的工作,看看你的代币去了哪里。
为什么
每次AI编码会话都会留下一份文字记录。Claude Code把它们埋在~/.claude/projects/,Codex和Pi有自己的布局,OpenCode把所有内容都保存在SQLite数据库里——而且里面的所有内容(你尝试过的、你决定的、坏掉的)实际上都是只写入的。
sessions 在所有内容上构建了全文检索索引,并使该历史在三方面有用:
- 搜索与恢复(CLI) — 模糊查找四个工具中任意过去会话,按相关性排序,然后重新进入。
- 代理内存(MCP) — 代理会搜索你的历史记录,当你返回代码库时拉取一个仓库范围的上下文入门,并通过捆绑技能回答“我上周做了什么?”。
- 使用报告 — 跨工具、模型和项目的代币/成本仪表盘。
安装
自制
或者,等价地说:
来自源头
编译后的二进制文件位于 dist/sessions。从源代码构建时需要 Bun。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
sessions
Search and memory across your AI coding sessions. One index over Claude Code, Codex, Pi, and OpenCode — fuzzy-find and resume past sessions from the CLI, give agents recall over prior work via MCP, and see where your tokens go.
Why
Every AI coding session leaves a transcript behind. Claude Code buries them in ~/.claude/projects/, Codex and Pi have their own layouts, OpenCode keeps everything in a SQLite database — and everything in them (what you tried, what you decided, what broke) is effectively write-only.
sessions builds a full-text search index over all of it and makes that history useful in three ways:
- Search & resume (CLI) — fuzzy-find any past session across all four tools, ranked by relevance, and jump back in.
- Agent memory (MCP) — agents search your history, pull a repo-scoped context primer when you return to a codebase, and answer “what did I do last week?” via bundled skills.
- Usage reports — a token/cost dashboard across tools, models, and projects.
Install
Homebrew
brew install nicknisi/formulae/sessions
Or, equivalently:
brew tap nicknisi/formulae
brew install sessions
From source
git clone https://github.com/nicknisi/sessions && cd sessions
bun install && bun run build
The compiled binary is at dist/sessions. Requires Bun when building from source. The Homebrew install is a standalone binary — no runtime needed.
Dependencies
- fzf (optional but recommended) — used for fuzzy selection. If fzf is not installed, a built-in numbered list selector is used as a fallback. Install with
brew install fzf. - Ollama (optional) — enables semantic recall (see below). If Ollama is not running, search stays purely lexical. Install from ollama.com.
Semantic recall
Search is lexical by default (full-text ranking over titles, paths, commands, and messages). When an embedding endpoint is available, sessions adds an optional semantic lane that fuses with — never replaces — the lexical results, so a paraphrase like “flaky tests” can surface a session about “intermittent CI failures”.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"sessions": {
"command": "sessions",
"args": ["--mcp"]
}
}
}