I built a tool that saves ~50K tokens per Claude Code conversation by pre-indexing your codebase
TL;DR Highlight
Pre-built markdown index of the codebase cut Claude Code's exploration calls
Who Should Read
Developers using Claude Code on large Next.js/TypeScript projects who waste tokens on exploration every conversation
Core Mechanics
- Every conversation starts with exploration
- Claude Code spends 10-20 tool calls exploring the codebase each conversation.
- On a large project this burns 30-50K tokens before real work starts.
- ai-codex generates 5 markdown files
- routes.md lists API routes with methods and auth tags.
- pages.md, lib.md, schema.md and components.md are generated too.
- They hold the page tree, library export signatures, key DB fields, and component props.
- Usage takes two steps
- Run npx ai-codex once.
- Add one line to CLAUDE.md telling Claude to read these files first.
- Exploration shrank on the author's project
- The project has 950+ API routes and 255 DB models.
- Understanding the finance module took ~15 Serena/Read calls before.
- With the index it took 5 parallel grep calls in under 2 seconds.
- Scope and license
- Supports Next.js (App Router and Pages Router) and generic TypeScript projects.
- Auto-detects Prisma schemas and is MIT licensed.
Community Reactions
How to Apply
- Run ai-codex on your project
- Run npx ai-codex in the project root.
- Open the 5 generated files and check routes and schema are captured.
- Add a read-first rule to CLAUDE.md
- Write one line telling Claude to read the files first and open source only when needed.
- Compare the number of exploration calls in a new conversation.
- Regenerate the index after changes
- Rerun npx ai-codex when routes or schema change.
- A stale index gives wrong info, so set a refresh routine.
Try It
# Run in your terminal at the project root (for Claude Code)
npx ai-codex
# Then add this line at the top of CLAUDE.md (wording is an example)
# Before working, read routes.md, pages.md, lib.md, schema.md, components.md first and open only the files you need.Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls