Pensieve, a free local search tool, aims to cut coding agents' tool calls

Pensieve, a free local search tool, aims to cut coding agents' tool calls

Pensieve is a free, open-source tool (MIT license) that indexes the files, folders, git repositories and coding-agent sessions on a Mac, then lets both the user and their coding agents search all of it from one place. The page describing it is a product page from the tool's makers, and the headline pitch is that an agent asks Pensieve one question and gets back the few relevant passages with file and line, instead of grepping the repo and reading many whole files. The page promises fewer tool calls and lower cost.

For people, Pensieve opens a glass search panel with Control+Shift over documents, folders, repos and agent conversations. Search works by meaning or by exact words; quotes match a phrase exactly, a minus sign excludes a word or phrase, and filters narrow results to files, code or sessions, a file type, or a folder or repo with in:. It watches folders, repos and sessions and re-indexes changes, including uncommitted edits, tracking every worktree by branch.

For agents, it connects over MCP (stdio with pensieve mcp, or HTTP). The command pensieve integrate recommended wires up Claude Code, Codex, Cursor, Gemini CLI, Windsurf, Claude Desktop and VS Code, and adds a "search before you grep" block to instruction files, plus a search skill and two hooks for Claude Code. An agent started in a repo sees that repo, its worktrees and its sessions, and a scope can be named to include a few repos and a folder of specs. Agents that are already open must be restarted to load the MCP server.

The page backs the pitch with a benchmark. It ran Claude Sonnet headless through Claude Code on the same 72 held-out tasks across four real repos (504, 1,783, 2,383 and 34,847 files), twice each, in one batch, with Pensieve 0.5.6. "With Pensieve" means the default agent tool set plus the instructions block from pensieve integrate. Tasks were generated from the code and graded on the file found. The makers say these tasks were never used to tune Pensieve.

Reported results: Claude Code with Pensieve found the right file in 131 of 144 runs, against 123 with grep alone, with 43% fewer tool calls. Each lookup cost 18% less overall and 6 to 28% less in each of the four repos, with the largest saving in the biggest repo. Pensieve used 16% fewer tokens, and the FAQ says lookups were 21% faster. Once the integration instructions were installed, the agent used Pensieve in all 144 runs. An illustrative example on the page cites an average of 2.0 tool calls per lookup against 3.4 with grep, with a single-call answer in 82 of 144 runs. Each search takes 0.1 to 0.2 seconds. The one place grep wins, per the page, is exact error messages. Costs are Claude Code's reported API costs at list prices, and the benchmark scripts are open source in bench/.

Beyond search, Pensieve builds ownership views from git blame, weighted by lines still present. It can answer "who knows this topic", show what each teammate shipped in the last 90 days, and flag areas where most lines were written by people with no recent commits there (a bus-factor or knowledge-gap view), with how many active people still know the area and who knows it best.

On privacy, the makers say indexing and search run locally with an on-device embedding model and a local index in ~/.pensieve; the local server answers only the same Mac, and there is no account and no cloud service. Pensieve itself only downloads its models and checks GitHub for updates, which can be turned off. Password-manager exports, keys, .env files and credentials are never indexed, and each source (agents, folders, repos, apps) has an off switch that also removes what it indexed. AI summaries and insights are optional: the choices are the built-in Qwen 3.5 9B, LM Studio, Claude Code or Codex, or none. Choosing Claude Code or Codex is the one case where data leaves the machine, and those insights are labelled Cloud.

Setup is done by pasting a prompt into a coding agent, which installs the app and then Pensieve for every agent on the Mac; nothing is indexed until the user chooses what to index. The app needs Apple Silicon and is not yet notarized, so macOS asks for confirmation before opening it. On Linux and Intel Macs the same prompt installs the backend and the browser visualizer.

Key facts

  • Pensieve is a free, MIT-licensed local index of a Mac's files, git repos and Claude Code, Codex and Qwen Code sessions, exposed to coding agents as one search over MCP.
  • In the makers' benchmark (Claude Sonnet in Claude Code, 72 tasks, four repos of 504 to 34,847 files, twice each), Pensieve found the right file in 131 of 144 runs against 123 for grep alone.
  • The same benchmark reports 43% fewer tool calls, 18% lower cost per lookup overall (6 to 28% per repo) and 16% fewer tokens.
  • Indexing and search run on the machine with no account or cloud service; data leaves only if the user picks Claude Code or Codex for optional AI insights.
  • The app needs Apple Silicon and is not yet notarized; Linux and Intel Macs get the backend and a browser visualizer.

Why it matters

Coding agents often grep a repo and read many whole files to find the right code, and every file read costs tokens. Pensieve targets that habit by giving the agent one search that returns a few passages with file and line. The page frames it as cutting tool calls and cost, and its benchmark reports 43% fewer calls and 18% lower cost per lookup. The tool also reaches past code: it indexes documents and past agent sessions, and adds ownership and bus-factor views from git blame.

Who it affects

Developers who use Claude Code, Codex, Cursor, Gemini CLI, Windsurf, Claude Desktop, VS Code or any MCP client on a Mac, especially in large repos where the benchmark's saving was largest. Teams may care about the ownership, team-activity and knowledge-gap views, which flag areas where the people who wrote most of the code are no longer active. Linux and Intel Mac users get only the backend and a browser visualizer, with an Intel Mac also getting the search panel if the Xcode command-line tools are installed.

How to use it

It is free and open source under the MIT license, with the code on GitHub. Paste the install prompt into your coding agent; the agent installs the app and then Pensieve for every agent on the Mac, and asks what to index before anything is indexed. The prompt runs pensieve integrate recommended, which connects the supported agents and adds the "search before you grep" instructions; agents that are already open need a restart to load the MCP server. Press Control and Shift to search. Indexing uses a lot of energy, so plug in. If macOS blocks the app, open System Settings → Privacy & Security and click Open Anyway. To remove it, run pensieve integrate all --remove, quit and trash the app, and delete ~/.pensieve, ~/.local/share/uv/tools/pensieve and ~/.local/bin/pensieve.

How solid is it

This is a vendor page with the makers' own benchmark, so treat the numbers as claims. The test used one model (Claude Sonnet) in one agent (Claude Code) against one baseline, the default tool set with grep; no results are given for other agents or other indexers, and no independent verification is mentioned. The method is described openly: 72 held-out tasks, four repos, two runs each, graded on the file found, with scripts in bench/ that you can run on your own repos. The page labels the 2.0 vs 3.4 tool-call example as illustrative. The page names no author, company or developer behind Pensieve.

Risks and caveats

Cost savings depend on Claude's prompt cache at the time, which is why both setups ran in one batch; costs are reported API costs at list prices, and the text gives only percentages, not dollar amounts. The page itself says a single grep wins on exact error messages. Results depend on the agent actually calling Pensieve; the 144-of-144 usage figure comes with the integration instructions installed, and the page says agents grep by habit. The app is not yet notarized and indexing is energy-hungry. Local-only operation holds unless you choose Claude Code or Codex to write optional insights, which are labelled Cloud. The app itself needs Apple Silicon.

“Agents grep by habit.”

— Pensieve product page