-
Notifications
You must be signed in to change notification settings - Fork 0
Ignore System
Arham-Qureshi edited this page Jul 21, 2026
·
1 revision
codebase-vis uses a single source of truth for file filtering: the .agentignore file, with optional runtime additions via the --ignore flag.
┌──────────────────────┐
│ 5-Layer Filter │
│ │
│ 1. Hardcoded skips │
│ 2. Stack defaults │
│ 3. Non-code files │
│ 4. .agentignore │
│ 5. CLI --ignore │
└──────────────────────┘
- Hardcoded skips — Symlinks are always skipped. Files > 2 MB are always skipped.
-
Stack defaults — Already baked into what
initgenerates for each tech stack. -
Non-code files — Only files with
KNOWN_EXTENSIONS(13 extensions) are collected..txt,.md,.json,.png, etc. never reach the ignore check. -
.agentignorefile — User-editable, created byinitwith stack-appropriate defaults. -
CLI
--ignoreflag — Runtime additions passed togenerate.
discoverFiles(targetDir, ig) walks the target directory recursively:
async function discoverFiles(targetDir, ig) {
// For each entry:
// 1. lstat() check
// 2. Skip symlinks
// 3. Check ig.ignores(relPath) ← .agentignore + --ignore
// 4. Skip files > 2MB
// 5. Check KNOWN_EXTENSIONS
// 6. Recurse into directories (concurrency: 32)
}readdir(dir)
│
├── lstat(entry)
│ ├── Is symlink? → SKIP
│ ├── Is directory?
│ │ ├── ig.ignores(relPath)? → SKIP (don't recurse)
│ │ └── Not ignored → recurse (concurrency: 32)
│ └── Is file?
│ ├── ig.ignores(relPath)? → SKIP
│ ├── size > 2MB? → SKIP
│ ├── KNOWN_EXTENSIONS? → NO → SKIP
│ └── Valid → ADD to files[]
│
▼
Return { files[], ignoredCount }
Only these file extensions are recognized as source code:
.js, .jsx, .ts, .tsx, .py, .cpp, .h, .hpp, .html, .css, .rs, .go, .java
When codebase-vis init detects your tech stack, it generates appropriate defaults:
| Stack | Common Ignores |
|---|---|
| Node / JS / TS |
node_modules/, dist/, build/, .next/, .nuxt/, out/, .cache/, coverage/
|
| Python |
venv/, __pycache__/, *.pyc, .pytest_cache/, *.egg-info/, .eggs/
|
| C / C++ |
build/, cmake-build-*/, *.o, *.obj, *.exe
|
| Rust | target/ |
| Go | vendor/ |
| Java |
target/, *.class, *.jar, .gradle/, build/
|
| PHP | vendor/ |
| Ruby |
vendor/bundle/, .bundle/
|
codebase-vis detects your tech stack by checking for marker files and dependencies. The priority order (most specific first):
nextjs > angular > react > vue > svelte > sveltekit > express > node >
django > flask > fastapi > python > cpp > rust > go > php > ruby > java
Detection uses STACK_MARKERS which include file checks (e.g., next.config.js for Next.js) and dependency checks (e.g., "react" in package.json for React).