.crignore
Control which files CodeRadius analyzes during ingestion. Exclude frontend noise, vendored dependencies, generated code, and non-architectural assets.
.crignore
The .crignore file controls which files and directories CodeRadius excludes from analysis during cr analyze code. It uses the same glob syntax as .gitignore — any path matching a pattern in .crignore is skipped entirely, saving LLM tokens, reducing ingestion time, and keeping the architecture graph free of non-architectural noise.
Why It Exists
CodeRadius ingests source code to build an architecture graph. But not all files in a repository are architecturally relevant:
- Frontend assets (
*.css,*.svg,*.png) carry no I/O behavior - Vendored dependencies (
vendor/,node_modules/) duplicate information already captured from package manifests - Generated code (
*.generated.ts,*.pb.go) is derivative of source-of-truth definitions - Test fixtures and mocks contain synthetic data that pollutes the graph
- Build artifacts (
dist/,build/) are compiled output
Without .crignore, these files enter the taint analysis pipeline, consume LLM tokens during extraction, and create noise in the graph. A well-tuned .crignore typically reduces ingestion time by 40–70%.
File Location
Place .crignore in the root of each repository:
your-repo/
├── src/
├── .crignore ← here
├── .gitignore
└── package.jsonGenerating .crignore with AI
During cr init, CodeRadius offers to auto-generate a .crignore file by analyzing your directory tree with an LLM:
cr init
# ... provider setup ...
# ◆ Do you want to run the AI now to generate a .crignore?
# Yes / NoThe AI examines your project structure — framework conventions, language ecosystem, build tool output directories — and produces a tailored .crignore that excludes the right patterns for your stack. This is the recommended starting point.
Syntax
.crignore follows the .gitignore pattern format:
| Pattern | Matches | Example |
|---|---|---|
*.css | All CSS files anywhere in the tree | src/styles/main.css |
dist/ | The dist directory and everything inside it | dist/bundle.js |
**/vendor/** | Any vendor directory at any depth | lib/vendor/sdk.php |
!src/api/generated.ts | Negation — re-include a previously excluded file | — |
*.test.ts | All TypeScript test files | src/orders/OrderService.test.ts |
# | Comment line (ignored) | — |
Key Rules
- Patterns are matched relative to the repository root
- A trailing
/matches directories only **matches zero or more directories!negates a pattern (re-includes a previously excluded path)- Empty lines and lines starting with
#are ignored
Recommended Patterns
TypeScript / JavaScript
# Build output
dist/
build/
.next/
.nuxt/
out/
# Dependencies (captured from package.json)
node_modules/
# Test files and fixtures
**/*.test.ts
**/*.test.tsx
**/*.spec.ts
**/*.spec.tsx
**/__tests__/
**/__mocks__/
**/__fixtures__/
**/test-utils/
# Frontend assets
**/*.css
**/*.scss
**/*.less
**/*.svg
**/*.png
**/*.jpg
**/*.gif
**/*.ico
**/*.woff
**/*.woff2
**/*.ttf
# Generated code
**/*.generated.ts
**/*.d.ts
# Config noise
.eslintrc*
.prettierrc*
jest.config.*
vitest.config.*
tsconfig.*.json
!tsconfig.jsonPHP
# Vendored dependencies
vendor/
# Cache and build
var/cache/
var/log/
storage/
bootstrap/cache/
# Frontend (Laravel Mix, Webpack)
public/css/
public/js/
public/mix-manifest.json
resources/css/
resources/js/
# Tests
tests/
phpunit.xmlPython
# Virtual environments
.venv/
venv/
env/
# Build artifacts
__pycache__/
*.pyc
*.egg-info/
dist/
build/
# Tests
tests/
test_*.py
*_test.py
conftest.py
# Jupyter
*.ipynb
.ipynb_checkpoints/Go
# Binary output
bin/
/main
# Test files
*_test.go
testdata/
# Generated protobuf
*.pb.go
# Vendor (if not using go modules)
vendor/What Happens Without .crignore
If no .crignore file exists, CodeRadius applies built-in heuristics that exclude common non-architectural paths. However, these heuristics are necessarily conservative — they won't know about your team's specific conventions, vendored SDKs, or generated code directories.
Without .crignore, you will likely see higher LLM token consumption and longer ingestion times. The built-in heuristics cover the basics, but a project-specific .crignore is strongly recommended for production use.
Re-ingesting After Changes
After adding or modifying .crignore, you must re-ingest with the --fresh flag to bypass the Merkle hash cache:
cr analyze code --forceWithout --fresh, the incremental cache may skip files that were previously analyzed — including files that should now be excluded. The --fresh flag forces a complete re-analysis from scratch.
Verifying Exclusions
To verify which files are being excluded, run ingestion in verbose mode:
cr analyze code -vVerbose mode prints per-file decisions, including which files were skipped due to .crignore patterns.
Further Reading
- CLI Reference —
cr init— The interactive setup that generates.crignore - CLI Reference —
cr analyze code— The sync command that respects.crignore - coderadius.yaml — Per-repository configuration for database scoping and custom SDK knowledge
coderadius.yaml
Configure CodeRadius per-repository. Teach the AI about proprietary SDKs, map database identities, and tune taint propagation — without writing any code.
Architecture Dashboard
The unified visual intelligence layer — a single-page report for architectural health, AI adoption, dependency governance, and blast radius analysis.