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.
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.
| Use | What gets looked up |
|---|---|
| A support bot | The help center, and past answers |
| A company assistant | The wiki, the policies, old tickets |
| Reading a contract or a financial filing | One long document with real structure |
| A coding assistant | The 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.
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.)
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 question | Goes to | What kind of retrieval |
|---|---|---|
| Where is this defined, what calls it, what would a change touch | tokensave | An exact lookup, no similarity |
| How do the modules, docs and plans connect | graphify, or PANTRY's map | A walk over a structure |
| Where does this literal string appear | grep | Exact text |
| How do I work in this repo | CLAUDE.md, the skills, PANTRY's index | Read 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.
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.
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.