Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I Built My Own Context Index Before Claude Code Had Skills and Memory

Description and use

The author built a tree‑structured index to reduce token usage in Claude Code, keeping the system simple and deterministic, and compared it to RAG and built‑in skills.

Problem

Managing a growing set of project documents in Claude Code’s context window was inefficient; reading the entire collection for every task wasted tokens and time.

Outcome

The tree‑structured index dramatically reduced token usage per task, improved efficiency, and remained simple, deterministic, and portable across AI tools.

Workflow

  • 1. Create a flat index file listing each document with a short description and file path.
  • 2. Organize the index into balanced folders (e.g., 10 top‑level folders, each with 10 subfolders, each containing ~10 entries).
  • 3. When a task arrives, Claude Code scans only the relevant folder hierarchy to find the matching line.
  • 4. Open the referenced file and load its full content only when needed.
  • 5. Maintain the folder balance to keep search depth minimal.
  • 6. Use the index for any document that is read, while keeping Skills and Memory separate for executable actions and personal preferences.

Evidence

The fix is something most people already do without thinking about it: folders. Nobody keeps a thousand files loose in one folder, they get split into subfolders...

Source

At 1,000 lines, it stops being nothing. Reading the whole list at that size runs into the tens of thousands of tokens...

Source

  • Record date: 2026-09-05T18:45:00.117Z