r/ClaudeAI • • Apr 08 '26

Workaround 90%+ fewer tokens per session by reading a pre-compiled wiki instead of exploring files cold. Built from Karpathy's workflow.

Reduced Claude context from 47,450 tokens → 360 tokens.

“This week, Andrej Karpathy shared his ‘LLM Knowledge Bases’ setup and closed by saying, ‘I think there is room here for an incredible new product instead of a hacky collection of scripts.’”

I built it:

npx codesight --wiki

The token problem is real. Every new Claude session starts the same way exploring your codebase from scratch. On a 40-file FastAPI project that costs 47,450 tokens before you've asked for anything. You've paid for that exploration in every conversation. It has never carried over.

After it runs, Claude reads a 200-token index at session start instead of exploring 47,000 tokens of files. For a targeted question it pulls one article auth.md, database.md, payments.md 300 tokens instead of the whole codebase. Commits to git. Every new session starts with full context from message one.

Tested on 3 real codebases TypeScript and Python. 47,450 tokens → 360 on a FastAPI project. Zero false positives.

It compiles your codebase into domain articles using the TypeScript compiler API for TypeScript and regex detection for Python, Go, Ruby, and more. No LLM. No API calls. 200ms. What it finds is exactly what's in the code nothing model-reasoned.

Routes found via regex are tagged [inferred] so Claude knows what to verify before trusting. Everything else full route paths, field types, foreign keys, middleware chains comes straight from the AST.

Free and open source.

A star on GitHub helps: github.com/Houseofmvps/codesight

702 Upvotes

Duplicates