- Published on
Local Indexing to reduce tool calling and token usage
- Authors

- Name
- DeepHorus
Pensieve has introduced a local indexing and search tool designed to reduce tool calling and token usage for AI coding agents. The system searches files, repositories, and agent sessions locally, providing agents with the most relevant context for a given task. Instead of grepping an entire disk, one search points to the few passages that matter. It integrates with popular agents including Claude Code, Codex, Cursor, Gemini CLI, Windsurf, Claude Desktop, VS Code, and any MCP client.
AI coding agents are only as good as the context they receive. Traditional approaches often require multiple grep commands and file reads, which inflate tool calls and token costs. Pensieve connects over the Model Context Protocol (MCP), allowing an agent to ask one question and receive back the few passages that matter, complete with file and line numbers. This enables agents to start on the right code in fewer tool calls.
Benchmark data highlights the efficiency gains. Agents using Pensieve averaged 2.0 tool calls per lookup, compared to 3.4 with grep. In 82 of 144 runs, agents answered after a single call. Each search takes just 0.1 to 0.2 seconds. The benchmarks covered real repositories ranging from 504 to 34,847 files.
The tool offers a glass panel interface activated by Control+Shift, overlaying documents, folders, git repositories, and coding agent conversations. Users can search by meaning or exact words, and mix both to rank exact hits by meaning. A minus sign excludes words or quoted phrases, while filters like in: narrow results to files, code, sessions, file types, folders, or repos. Agents use the same search capabilities, scoped to a repo, its worktrees, and sessions.
The implications for development workflows are significant. Fewer tool calls mean lower costs and faster responses. Pensieve costs less per code lookup in every tested repo, saving the most in the largest repository. It helps agents find the right file first, improving accuracy and reducing wasted tokens. The tool works over stdio with pensieve mcp or over HTTP.
Pensieve integrates with existing agent setups. The command pensieve integrate connects agents on a Mac and adds a "search before you grep" block and skills, including optional ones that point to teammates who know the code. Since agents load MCP servers at startup, any open agents must be restarted to gain Pensieve. The benchmark used Claude Sonnet run headless through Claude Code, with 72 held-out tasks across four repos, twice each, measured with Pensieve 0.5.6.
As codebases continue to grow, local indexing is poised to become a standard layer for AI-assisted development. Pensieve's approach of delivering the right context—not the whole disk—addresses a critical bottleneck in agentic coding. Future updates may expand integrations and further optimize search performance. For now, the tool demonstrates measurable reductions in tool calls and token usage, offering a practical path to more efficient AI agents.