
What to put in .claudeignore (and why most people skip it)
.claudeignore works like .gitignore. Files listed in it don't get loaded into Claude Code's context. Most projects don't have one. They should. Why it matters Claude Code doesn't know which files are useful for your task. Given a project root, it tries to load the whole thing. Build artifacts, lockfiles, test fixtures, and generated code all compete for context budget alongside the files that actually matter. On a medium-sized project, that's often 20-30% waste. Here's what I found when I scanned mine: --- Top files (token hogs) --- 10.4k package-lock.json 6.6k multi-agent-templates.md (generated, not edited) 6.3k agent-prompt-playbook.md (reference doc) 4.2k dist/bundle.js 3.1k .next/build-manifest.json That's 30k tokens that had no reason to be there. Adding three lines to .claudeignore dropped total usage from 82% to around 58% of Cursor's default window. What to ignore Lockfiles first — they're huge, machine-generated, and Claude doesn't need them: package-lock.json yarn.lock pnpm-
Continue reading on Dev.to Webdev
Opens in a new tab




