TJ's Desk

How My Sessions Walk the Tree: graphify, tokensave and PANTRY

How a session steps through skills, two code graphs and a project index to reach one section instead of a whole file.

ai retrieval tooling graphify tokensave pantry

The companion to My AI Loop Runs on Vectorless RAG and I Didn't Call It That. Read that one first. This is the part for the reader who wants to see how it is wired.

What RAG gets used for

The lead note says RAG is for any pile of documents that is too big to paste and too specific for the model to know. Here is the longer list.

UseWhat gets looked up
A support botThe help center, and past answers
A company assistantThe wiki, the policies, old tickets
Reading a contract or a financial filingOne long document with real structure
A coding assistantThe repository
An AI loop that builds software (mine)The standards, the plans, the code and the state of the project

Anthropic says a library under about 200,000 tokens, roughly 500 pages, can simply go in the prompt, so RAG is for the libraries that do not fit. It took off for a boring reason. Retraining a model on your documents is slow and goes stale the day a policy changes. Retrieval only needs the pages updated, and the answer can point back at its source.

The usual way, step by step

The lead note describes similarity retrieval in a paragraph. Here it is in three steps: chop, turn into numbers, fetch the nearest.

chunk 1 chunk 2 chunk 3 chunk 4 0.12 -0.40 0.77 ... 0.09 -0.35 0.80 ... -0.51 0.22 0.04 ... 0.60 0.31 -0.18 ... a few paragraphs each similar meaning, similar numbers the closest few come back 1. Chop 2. Turn into numbers 3. Fetch the nearest

The usual way, start to finish. The numbers are called an embedding, and a vector database stores them. The ringed dots are the chunks that go into the prompt.

The numbers are positions in a very large space, and close together means close in meaning. A tree gives up that space and gets something in return: a reason the model can say out loud.

The vector camp keeps improving. Anthropic's contextual retrieval adds a note about where each chunk came from before it is embedded, and with keyword search and a reranker it cut missed chunks in the top twenty from 5.7 percent to 1.9 percent in their tests.

The tree, one layer at a time

The standards are the named sections. Each session gets 29 of them as skills, among them voice, figures and the note standard. (That is a snapshot, since the number grows.)

Every skill carries one line of description, and that line is all the model sees until it opens the file. So I wrote the lines to do one job: say when to read it. Nearly all of them start with "Read this BEFORE". That is a node summary in a section tree, and I was tuning it without knowing it was a retrieval index.

The tree has taught me one classic lesson already. My loop standard shared a name with a built-in skill, and mine was shadowed without a sound. In a vector store a duplicate title is a non-event. In a tree it means one branch can never be picked.

PANTRY mounts them. The standards live once, in this repo's standards folder. PANTRY mounts them as skills in the other repos, so a session in GRAIN reads the same sections as one here. The mount is a sync I still run by hand, which means a repo I forgot is reading last week's tree.

Every folder carries its own subtree. The standards folder has its own CLAUDE.md, and a subtree loads when a session first reads a file inside it. That happened while I drafted this note. The session opened the note standard and the standards folder's rules arrived with it, unasked. They were on the branch.

graphify and tokensave index the code

Two tools index the code, and neither ranks by closeness. graphify reads the repo by static analysis, with no model, and writes a graph with a node for each function, file and Markdown heading. Here that is about 6,400 nodes and 7,500 edges. tokensave keeps a code-only graph in a database that the session queries through tools: find a symbol, ask who calls it, ask what a change would touch. Here it holds about 10,700 nodes and 5,450 edges over 2,455 files, and a re-sync after an edit took under a second. (Snapshots from 2026-11-26.)

toc() read() find() standards-index.ts seo.ts buildIndex() summarize() indexStandard() fixture (test) folder test buildIndex() indexStandard() 31 nodes within two hops dashed: a stray, not an answer who calls it, what it calls small and exact graphify: a neighborhood tokensave: a call chain calls

The same question, asked of both: where does the standards index live and what touches it. These are real answers from today's repo, trimmed to the interesting nodes.

Both fail honestly. Ask graphify with a partial name and it says it found no matching nodes, a lookup refusing to guess where a vector store would have handed back something close. So the rule is to ask with names the code contains, never with a description of an idea. A hook refreshes graphify after every edit in a few seconds, and nothing in the loop calls a model.

I measured the limits in August 2026. graphify does not node methods or non-exported functions, so checking my docs against it flagged 7 symbols, 3 of them truly dead, about 43 percent precision. Labels collide, and a graph of one repo cannot see the symbols of its siblings, so PANTRY builds a merged one. A neighborhood is a lead, never a verdict.

My global rule for which tool gets which question:

The questionGoes toWhat kind of retrieval
Where is this defined, what calls it, what would a change touchtokensaveAn exact lookup, no similarity
How do the modules, docs and plans connectgraphify, or PANTRY's mapA walk over a structure
Where does this literal string appeargrepExact text
How do I work in this repoCLAUDE.md, the skills, PANTRY's indexRead the contents page

PANTRY is the project's contents page

CLAUDE.md says how to work. It does not say what is going on in the project today. That is PANTRY, the app I run beside the chat: one small server that serves a project's plan board, its docs, a map of the codebase and some machine-readable pages for an agent. It runs no model of its own.

A session's first call is to PANTRY. It returns a short brief (what is in flight, what waits on me, what drifted) and then an index file, llms.txt: a Markdown list with one line and one link for every plan, document, standard and run. That is 18,203 characters here today, built by a program from files I wrote anyway. It has the same shape as CLAUDE.md, one level up. After that a session asks for one named surface, such as the map, the run ledger or token use by plan, and leaves the rest closed.

PANTRY is also where I find out the tree went stale. Its check at the start of this session reported that the merged graph was older than the repo's own extraction and that two mounted skills were behind their source.

One question, walked down the tree

Here is the path for one real question: can I put a backtick in a note? I traced it by hand with the standards index rather than from a log, so read it as the route the setup allows.

Can I put a backtick in a note? the question CLAUDE.md, Start here voice is the standard for prose in my name The skill description for voice read before any prose with my byline The standards index for voice lists the sections, one of them punctuation Open lines 159 to 194 of 677 answer: no, not in prose

Five stops, and the last one reads thirty-six lines.

The lead note puts the cost of that walk against the whole file: 5.8 percent of the voice standard, 94 percent never read.

Two real versions of the contents-page idea

The best-known version is PageIndex, an MIT-licensed project from Vectify AI. It builds a tree index for each document and lets a model search the tree and read the pages it lands on. Its README adds a complaint about vectors, that you cannot see why a chunk was chosen, and a number: 98.7 percent on FinanceBench against 50 percent for vector RAG. Treat that as a claim. It is self-reported, the README does not name the vector system it beat, and I did not run the evaluation. Shivani's post quotes the same figure.

A close cousin has no index at all. In a Latent Space interview in May 2025, Boris Cherny, who leads Claude Code, said early versions used off-the-shelf RAG and that "eventually, we landed on just agentic search as the way to do stuff," meaning glob, grep and file reads. An index has to be built, the code drifts out of sync with it, and it has to live somewhere.

So there are three answers to the ink box. Vectors pick by distance. PageIndex reasons over a tree built ahead of time. Claude Code searches live with no index. Mine is closest to the second, with the tree written by hand.

Which one to reach for

My read, not a benchmark. Nobody has run these head to head on my files, and the one benchmark number I quoted in the lead note is a vendor's own.

Does it fit in the prompt? under about 500 pages Is it code? a repository Does it have real headings? manuals, filings, standards Vectors with keyword search beside them Paste it all skip retrieval Search it live grep, read files A tree the model reads the headings say where yes yes yes no no no

Where a pile of documents lands. The ink box is where my own setup sits.

What landed since the first draft

The first draft listed three pieces of work as in flight. Two landed on 2026-11-17 and one is half done.

  • A standards index. A tool lists every standard with its sections, 31 standards and 279 sections today, so a session reads one section by name. The walk above runs on it.
  • A staleness check. It warns at session start when a skill or the graph is behind its source, which is the warning PANTRY showed me this morning. A tree pointing at a file that changed underneath it is worse than no tree.
  • A retrieval trace, half done. A run report from 2026-11-21 lists the files the session read, with a catch: the session writes it and no tool captures it, so it is a claim a session makes about itself. A mechanical version is an idea and not a build.

Sources

What the figures above rest on.

  • Vectify AI, PageIndex. I read the README. The FinanceBench claim links to a write-up and an evaluation repo that I did not open.
  • Boris Cherny on Latent Space, 2025-05-07. The agentic search passage is about forty-five minutes into the transcript, and I checked the quoted words against it.
  • Anthropic, Introducing Contextual Retrieval, 2024-09-19. The 200,000 token rule and the 5.7 to 1.9 percent figures are theirs. I read the page and did not reproduce the results.
  • graphify, tokensave and PANTRY. The figures are counted from my own repository, my own tokensave and my own running PANTRY on 2026-11-26, and the August figures are from my notes on measuring graphify. None of them comes from a vendor.
  • The RAG paper, the AGENTS.md convention and Shivani Virdi's post are listed in the lead note.

The judgment is human. The typing, by design, is not.