cd /news/ai-agents/local-code-index-for-coding-agents-p… · home › topics › ai-agents › article
[ARTICLE · art-152817] src=stackness.dev ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Local code index for coding agents: Pensieve vs Graphicle vs plain ripgrep

As of 19 October 2026, no benchmark has shown that a local code index reliably cuts token use for coding agents, though Pensieve's own benchmark measured 43% fewer tool calls than grep (1.97 versus 3.44 per lookup) while tying grep on accuracy, and Graphicle's own tests tied plain Claude Code and used 16% more tokens when the agent never called it. Pensieve, a local semantic-plus-lexical index by Ted Haley released as v0.11.0 on 18 October 2026 under the MIT licence, ran its benchmark on Claude Sonnet across 72 tasks in four repositories of 504 to 34,847 files at $0.041 per lookup versus $0.050 for grep. A PointFive paper analyzing 1,212 Claude Code sessions found the system prompt and tool definitions made up 74.7% of cost, tool outputs 3.3% and files read 0.8%, so the article's recommendation is to keep the agent's built-in grep on a frontier model and try Pensieve only on large repositories searched by description rather than by name.

by read10 min views4 publishedOct 19, 2026
Local code index for coding agents: Pensieve vs Graphicle vs plain ripgrep
Image: Stackness (auto-discovered)

A local code index cuts the number of search calls a coding agent makes, and as of 19 October 2026 nobody has shown that it reliably cuts tokens. Pensieve's own benchmark measured 43% fewer tool calls than grep, then tied grep on accuracy in its clean runs. Graphicle's own tests tied plain Claude Code and used 16% more tokens when the agent never called it. On a frontier model, keep the agent's built-in grep. Try Pensieve on a large repository you search by description rather than by name.

Pensieve Graphicle ripgrep
Kind of index Semantic plus lexical hybrid (embeddings and a trigram index in SQLite) Code graph of files, functions, calls and imports, plus agent memory None: scans files at query time
Reaches the agent through MCP server, skills, a CLAUDE.md block, hooks MCP server, CLI, hooks, an AGENTS.md section The agent's own search tool or shell
Licence MIT Apache-2.0 MIT or Unlicense
Platform Mac app on Apple Silicon, macOS 14+; backend and browser app on Linux macOS, Linux, Windows preview Everywhere
First index About 500 files a minute; a little over an hour for 35,000 files Kubernetes code in 1 min 8 s None
Vendor's headline 43% fewer tool calls, 18% cheaper "No token saving against plain Claude Code" n/a
Latest release v0.11.0, 18 October 2026 v0.1.2, 18 October 2026 15.2.0, 15 July 2026

Release dates and licences are from each GitHub repository on 19 October 2026.

Does a local code index cut your coding agent's tokens? #

A local code index for coding agents mostly cuts tool calls, and tokens only sometimes. Each search an agent skips saves a model turn, and every turn re-sends the cached prefix. But the index adds its own tool definitions and setup text to every request, and its results can be longer than a grep hit. In Pensieve's and Graphicle's own benchmarks, the two effects roughly cancelled.

Without an index, an agent loops: search, read a file, search again. ripgrep is the usual engine. Claude Code's Grep tool "is built on ripgrep", though on macOS, Linux and WSL the tools reference says Claude Code now leaves Glob and Grep out by default and searches with find and grep through Bash, which run embedded bfs and ugrep. OpenAI Codex's system prompt tells the model to "prefer using rg". Anthropic tried the other way first. Boris Cherny wrote on 1 February 2026 that early Claude Code "used RAG + a local vector db, but we found pretty quickly that agentic search generally works better".

Search output is a small share of the bill. A PointFive paper split the cost of 1,212 Claude Code sessions: the system prompt and tool definitions made up 74.7%, tool outputs 3.3% and files read 0.8%. An index pays off by removing turns, not by shrinking text. That is where it differs from the context compression tools, which shrink what was already fetched. The same paper found that the heaviest compression cut tool-output tokens 38.4% and raised the bill 6.8%, through extra diagnosis, testing and re-retrieval turns.

Pensieve cuts tool calls by 43% and ties grep on accuracy #

Pensieve, a local index by Ted Haley that reached the Hacker News front page on 12 October 2026, measured 1.97 tool calls per lookup against 3.44 for grep, glob and read. That is 43% fewer. The run used Claude Sonnet, with no version stated, on 72 tasks in four repositories of 504 to 34,847 files, each run twice. It cost $0.041 per lookup against $0.050.

The author's README also reports tasks solved: 131 of 144 against 123 for grep. His own strategy notes undercut that gap, tracing it to runs that loaded his personal settings. Runs that loaded only repository settings on 13 October tied at 129 of 144: "Accuracy is level with grep; cost and time are not." Those clean runs were 23-25% cheaper and 25-29% faster with Pensieve.

Tokens are less clear. The README's headline run reports 16% fewer tokens per lookup, 57k against 67k. In the first two strategy batches, median tokens per answer rose from 46k with grep to 51k with Pensieve. Only a hook that injects search results into the prompt brought them down, to 30k, and it cost the same per answer as the recommended Pensieve setup without the hook ($0.0374 each), since the tokens it saved were cheap cache reads. In the README's headline run, the savings were largest in the 34,847-file monorepo (28% cheaper), 15% in the 504-file repository and 6-14% in the two mid-size ones. I found no outside repeat of the test.

Graphicle ties plain Claude Code and costs 16% more tokens when unused #

Graphicle, a Rust port of the Graphify code graph by KarLex AI released on 14 October 2026, ran the most careful benchmark of the three. It registered every test before scoring and reported 95% confidence intervals, using Claude Code 2.1.287 and Claude Opus 5.5. Its results show a tie.

On 100 SWE-bench Verified tasks, Graphicle and plain Claude Code each found every file to change in 95. Graphicle used 27,133 tokens per task against 23,348, 16% more. The benchmark notes say why: "In none of the 100 Graphicle runs did the agent call a Graphicle tool, so its extra tokens are the text that setup adds to every request."

On 30 questions about Graphify's showcase corpus, Graphicle found 99.2% of the facts against 94.7% for plain Claude Code, which the vendor counts as a tie. It used a median of 69.2k tokens against 60.8k. Graphify itself found 87.8% at 87.1k. The benchmark notes state it outright: "No token saving against plain Claude Code."

Graphicle 0.1.1 benchmark summary. Image: graphicle-ai/graphicle by KarLex AI, Apache-2.0.

Semantic search finds what you cannot name, a code graph finds who calls it #

Semantic search and a code graph answer different questions. Semantic search, Pensieve's kind, finds code from a plain-English description when you do not know the identifier. A code graph, Graphicle's kind, answers relational questions: who calls this function, what breaks if it changes, how two modules connect. Grep answers neither well, and both lose to grep on an exact string.

Pensieve's retrieval test on 2,377 queries shows the split. On plain-English questions, grep put the right file first 0% of the time and Pensieve 47.9%. On exact strings they were level, 85.2% against 84.6%. Embeddings alone did no better than grep overall (36.6% against 37.1%); the hybrid with lexical matching reached 65.9%.

For graphs, the Codebase-Memory paper, written by that tool's own authors, found the graph matching or beating an agent that explores files in 19 of 31 languages, mostly on ranking callers and hubs. Its answers, graded by the first author, scored 0.83 against 0.92, at about a tenth of the tokens. An independent CodeGrep paper puts a number on when retrieval saves money at all. BM25 at 0.375 precision made the agent worse. A retriever at 0.677 precision was the first to cut rollout cost.

Both indexes reach the agent through MCP, and the agent ignores both without a push #

Pensieve and Graphicle both run as local MCP servers, and both vendors found that connecting the server is not enough. Agents keep grepping by habit. Pensieve's pilot recorded 0 index calls in 10 tasks without instructions, and Graphicle's agent never called its tools in 100 runs. What worked was text: an instructions block, or a hook that puts results in the prompt.

So each tool edits your configuration. Pensieve writes a "search before you grep" block into ~/.claude/CLAUDE.md and ~/.codex/AGENTS.md, plus hooks and skills, and pensieve integrate claude --remove takes them out. Graphicle writes .mcp.json, hooks and an AGENTS.md section, backs each file up as <file>.graphicle-bak, and graphicle disconnect undoes it. The layers post covers where such instructions belong.

One gap follows from the docs, though I have not tested it: Claude Code's docs say "Explore and Plan start without your CLAUDE.md files" (subagents), so a block written there does not reach the subagent Claude hands codebase searches to.

When is ripgrep still the right answer? #

ripgrep, or whatever grep the agent already has, is the right answer when you know the identifier or the error string, when you need every occurrence for a rename, and on small repositories. It needs no index, never goes stale after a branch switch, and adds nothing to the prompt. On a frontier model, the vendor tests above found no accuracy gain over it.

The evidence lines up. A preliminary single-author language server paper found that grep made up 94-100% of agents' search calls on localization tasks, and that a language server cost 6% to 118% more tokens when the symbol was named. Grep handled multi-file renames perfectly. Pensieve's overview test found that with a CLAUDE.md in place, grep needed no extra tool to describe a repository. With Haiku 5.5, Graphicle's prototype card, a hook that has not shipped, found the files on 4.3 points more tasks, which the vendor scores as a tie; with Opus 5.5 it found as many as plain Claude Code. That fits one Hacker News commenter's view that such tools "can help weak models but on the frontier they just make it slower and more expensive".

Speed is the case against grep on very large repositories. Pensieve measured 6-11 seconds per ripgrep search on its 34,847-file repository against 0.1-1 second for an experimental indexed grep tool. Cursor reported rg calls over 15 seconds in monorepos and built a local regex index next to its semantic one. In July 2026 its staff said that "Semantic/embeddings indexing is being turned down in favor of grep-based retrieval."

Switching to an index costs an hour of indexing and a changed instruction file #

Switching from grep to a local index costs setup time, disk and attention. Pensieve indexes about 500 code files a minute on Apple Silicon and downloads a 550 MB embedding model; a 35,000-file repository takes a little over an hour. One Hacker News user reported it made a 24 GB M4 MacBook Pro unusable. Graphicle is lighter: one SQLite store, limits of 100,000 text files and 1 GiB.

The ongoing cost is the prompt. Graphicle's measured overhead was 3,784 extra tokens per task from setup text alone, and its prototype hooks added 3.5-6.2 seconds per run. Switching back is cheap for both, since each ships an uninstall command. Among the AI tools developers run beside their agents, Claude Code is on eight public Stackness stacks without bots as of 19 October 2026 (data sources), and no real profile lists Pensieve, Graphicle or ripgrep yet.

Pick Pensieve if, pick Graphicle if, stay on ripgrep if #

Pick Pensieve if:

  • Your repository has tens of thousands of files and searches take seconds.
  • You often look for code by what it does, not by its name.
  • You work on an Apple Silicon Mac and accept an hour of first indexing.
  • You will keep the instructions block or the prompt hook on, since the agent ignores the index otherwise.

Pick Graphicle if:

  • Your questions are relational: callers, blast radius, paths between modules.
  • You already use Graphify and want the same graph built faster, plus agent memory.
  • You run a smaller model and will test it yourself: its Haiku run was a tie, with a prototype that has not shipped.

Stay on ripgrep if:

  • You run Opus 5.5 or another frontier model, where neither vendor measured an accuracy gain.
  • You search by identifiers and error strings, or do renames.
  • Your repository has a good CLAUDE.md and a few thousand files.
  • You switch branches often and do not want a stale index.

New posts by email #

About one email a week with what we published. No account needed.

Which of these do you use? #

Nobody on Stackness runs Pensieve yet. Tick what you use and be the first.

Play Lonny Eagle Amateur Skater 4A pixel art skateboarding game. Signing up opens it straight away.Sign up to play

── more in #ai-agents 4 stories · sorted by recency
── more on @pensieve 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/local-code-index-for…] indexed:0 read:10min 2026-10-19 · —