-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestpriority-criticalCritical priority - implement firstCritical priority - implement first
Description
Summary
Respect .gitignore patterns when listing files, loading context, and showing file picker.
Why It's Needed
- Context Quality: Don't waste tokens on node_modules, build artifacts
- File Picker UX: Don't show irrelevant files in @ picker
- Search Quality: Grep/glob results exclude ignored files
- Performance: Skip large ignored directories
Current Problem
@ file picker shows:
├── node_modules/ # 50,000+ files
├── dist/ # Build artifacts
├── .git/ # Git internals
├── coverage/ # Test coverage
└── src/ # Actual source
Proposed Behavior
@ file picker shows:
└── src/ # Only relevant files
├── index.ts
├── services/
└── utils/
Implementation
import ignore from "ignore"
async function loadIgnorePatterns(cwd: string): Promise<Ignore> {
const ig = ignore()
// Load .gitignore
const gitignore = await readFile(path.join(cwd, ".gitignore"), "utf-8").catch(() => "")
ig.add(gitignore)
// Load .codetyperignore (custom ignore)
const codetyperignore = await readFile(path.join(cwd, ".codetyperignore"), "utf-8").catch(() => "")
ig.add(codetyperignore)
// Always ignore these
ig.add([
"node_modules",
".git",
"dist",
"build",
"coverage",
".codetyper-backup",
])
return ig
}
function filterFiles(files: string[], ig: Ignore): string[] {
return files.filter(f => !ig.ignores(f))
}Apply To
- File picker (
@mentions) - Glob tool results
- Grep tool results
- Context file loading
- Directory listings
Configuration
{
"ignore": {
"useGitignore": true,
"useCodyterignore": true,
"additional": ["*.log", "tmp/"]
}
}Acceptance Criteria
- Parse and respect .gitignore
- Support .codetyperignore for custom patterns
- Filter file picker results
- Filter glob results
- Filter grep results
- Always ignore node_modules, .git, dist, build
- Configurable additional ignore patterns
Effort Estimate
0.5 days
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority-criticalCritical priority - implement firstCritical priority - implement first