CodeRadius LogoCodeRadius Docs

.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.json

Generating .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 / No

The 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:

PatternMatchesExample
*.cssAll CSS files anywhere in the treesrc/styles/main.css
dist/The dist directory and everything inside itdist/bundle.js
**/vendor/**Any vendor directory at any depthlib/vendor/sdk.php
!src/api/generated.tsNegation — re-include a previously excluded file
*.test.tsAll TypeScript test filessrc/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

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.json

PHP

# 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.xml

Python

# 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 --force

Without --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 -v

Verbose mode prints per-file decisions, including which files were skipped due to .crignore patterns.


Further Reading

On this page