deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

Pensieve adds local semantic search for MCP coding agents and reports 43% fewer tool calls

The free, open-source macOS tool indexes code, docs and past agent sessions locally and serves results to agents over MCP; its own benchmark reports 43% fewer tool calls and 18% lower cost per code lookup.

Pensieve adds local semantic search for MCP coding agents and reports 43% fewer tool calls

What the tool does

Pensieve is a free, open-source indexing and search tool for Apple Silicon Macs running macOS 14 or later, aimed at AI coding agents and the developers who supervise them. Its project page, which reached the Hacker News front page, describes software that indexes your files, folders, git repositories and saved agent sessions locally, then exposes that index both to you, through a keyboard-driven overlay summoned with Control+Shift, and to agents over the Model Context Protocol.

Searches can run by meaning, by exact phrase, or a mix of the two, with support for exclusions via a leading minus sign and filters such as kind:code, ext:pdf, or scoping with in: to a specific folder or repository. The page lists integrations for Claude Code, Codex, Cursor, Gemini CLI, Windsurf, Claude Desktop and VS Code, and says any MCP client can connect, either over stdio via pensieve mcp or over HTTP. A single command, pensieve integrate, configures the agents found on a Mac and appends a "search before you grep" instruction block so agents reach for the index before falling back to raw grep.

The core pitch is narrow context: the agent asks one question and receives a few relevant passages with file and line numbers, instead of running a grep that fans out into dozens of file reads.

The benchmark, as reported by the project

The headline numbers come from the project's own benchmark, so they should be treated as self-reported. According to the page, Claude Sonnet ran headless through Claude Code on 72 held-out code-finding tasks across four real repositories ranging from 504 to 34,847 files, with each task phrased five ways, from plain descriptions to exact names and error messages, and each setup run twice for 144 runs per configuration.

With Pensieve 0.5.6 enabled, the project reports:

  • 131 of 144 runs found the right file, versus 123 of 144 with grep alone.
  • 2.0 tool calls per lookup versus 3.4, a 43% reduction, with the agent answering after a single call in 82 of 144 runs.
  • $0.041 per lookup versus $0.050, an 18% saving that held in all four repositories.
  • 8.6 seconds per lookup versus 10.9, or 21% faster, on searches that complete in 0.1 to 0.2 seconds.
  • 16% fewer tokens consumed.

The project says the tasks were never used to tune the tool, that costs reflect Claude Code's reported API charges at list prices, and that the benchmark scripts are open source in the repository's bench/ directory so anyone can rerun them on their own code. One caveat sits in the fine print: a single plain grep still beat the index on tasks involving exact error messages.

Beyond search

Two other feature groups round out the tool. The index stays current by watching folders, repositories and agent sessions and re-indexing on change; uncommitted edits are included and each git worktree is tracked by branch, so agents are not working from stale context.

The project also maps code ownership using git blame, weighted by lines that still exist today, and lets you ask about a topic rather than a file to surface the teammates with the most domain knowledge, plus each person's activity over the last 90 days. A related view flags knowledge gaps: areas of a repo where the original authors are no longer active, how many people still know that code, and who knows it best, with the stated goal of planning handovers before an incident forces one. The page notes its worked example uses fictional names and numbers.

Why it matters

Agent cost is increasingly a retrieval problem. Every grep-and-read chain burns tokens, tool-call round trips and latency, and on large codebases those loops dominate both the bill and the response time. Pensieve's reported 18% saving per lookup is modest on its own, but it compounds across thousands of lookups and points at a broader pattern: giving agents a purpose-built local search layer instead of letting them simulate one with shell tools.

The local-first design also means code and session histories stay on the machine rather than being shipped to a cloud indexing service, which matters for teams with restrictive code policies. The caveats are real, though. The numbers are the project's own, measured on one model in one agent harness, and availability is currently limited to Apple Silicon Macs. The benchmark scripts being open source is the right move; anyone considering the tool should run them against their own repositories before trusting the percentages.

  • #ai-agents
  • #mcp
  • #developer-tools
  • #open-source
  • #code-search

Related posts