Use ignorePatterns to Keep Build Artifacts and Vendor Folders Out of Claude's View
Claude Code scans your project to understand the codebase, but it doesn't need to read your node_modules, build output, or vendored dependencies. The ignorePatterns setting tells Claude to skip directories and files that would just waste context and slow things down.
claude config add -s project ignorePatterns "dist/**"
claude config add -s project ignorePatterns "build/**"
claude config add -s project ignorePatterns ".next/**"
claude config add -s project ignorePatterns "coverage/**"
claude config add -s project ignorePatterns "*.min.js"
Claude already ignores common patterns like node_modules and .git by default, but your project probably has others — compiled output, generated files, large data fixtures, or vendored assets that shouldn't be part of Claude's search space.
Common patterns worth adding:
# Build artifacts
claude config add -s project ignorePatterns "dist/**"
claude config add -s project ignorePatterns "build/**"
claude config add -s project ignorePatterns ".next/**"
claude config add -s project ignorePatterns "out/**"
# Generated code
claude config add -s project ignorePatterns "*.generated.ts"
claude config add -s project ignorePatterns "src/graphql/__generated__/**"
claude config add -s project ignorePatterns "prisma/client/**"
# Large data files
claude config add -s project ignorePatterns "fixtures/**/*.json"
claude config add -s project ignorePatterns "seeds/**/*.sql"
# Compiled assets
claude config add -s project ignorePatterns "public/assets/**"
claude config add -s project ignorePatterns "*.min.css"
This makes a real difference in three ways:
- Faster searches — Claude greps fewer files, so code searches return quicker.
- Better context — Claude's context window fills with your actual code, not generated boilerplate.
- Fewer false positives — when searching for function references, Claude won't find matches in compiled bundles or vendored code.
Set patterns at the project level so they're shared with your team via .claude/settings.json, or at the user level for personal preferences.
Claude doesn't need to read your build output to understand your source code — exclude the noise and let it focus on what matters.
via Claude Code
Log in to leave a comment.
When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.
Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.
Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.