
My codebase was 83% of Cursor's context window and I didn't know it
My codebase was 83% of Cursor's context window and I didn't know it. I found out because I wrote a script to check. Took about an hour. Here's what it found. The problem When Claude Code or Cursor loses track of your conventions mid-task, the usual advice is "your codebase is too big for the context window." But that's vague. How big is too big? Which files are the problem? I wanted actual numbers, not vibes. The script context-scanner.py walks your project directory, estimates tokens per file (1 token per 4 characters, rough but useful), and shows where you land against each model's context limit. python3 context-scanner.py . Output on my project: === Context Scanner === Total tokens (est): 52.9k Files scanned: 34 --- Context window usage --- Claude 3.5 Sonnet █████ 26.4% ✓ fits GPT-4o ████████ 41.3% ✓ fits Cursor default ████████████████ 82.6% ⚠ tight Gemini 1.5 Pro █ 5.3% ✓ fits --- Top files (token hogs) --- 10.4k package-lock.json 6.6k multi-agent-templates.md 6.3k agent-prompt-pl
Continue reading on Dev.to Webdev
Opens in a new tab



