Skip to content

Ignore Patterns

Ignore patterns exclude files and directories from agent context. When an agent indexes your repository or reads files, ignored paths are filtered out before anything reaches the context window. This keeps the agent’s context focused on signal rather than noise — build artifacts, lock files, and generated code rarely provide useful information for coding tasks.

interface IgnorePattern {
pattern: string;
scope: Exclude<Scope, "enterprise" | "local">;
}

Note that the scope for ignore patterns is restricted to project and user only. The enterprise and local tiers are not supported for this entity type.

Ignore patterns are defined in the ignore section of .ai/config.yaml. Patterns use gitignore-style glob syntax.

ignore:
- pattern: "dist/**"
scope: project
- pattern: "node_modules/**"
scope: project
- pattern: "*.lock"
scope: project
- pattern: ".cache/**"
scope: project

Each tool has its own native mechanism for file exclusion. dotai translates ignore patterns into whichever format the target tool uses.

AspectClaude CodeCursorCodexOpenCodeCopilotAntigravity
Config.claude/settings.json (deny Read/Edit).cursorignore.codex/config.toml (protected_paths)opencode.json (watcher.ignore)Not supportedNot supported
FormatPermission deny rulesGitignore-style fileTOML arrayJSON arrayN/AN/A

Claude Code does not have a native ignore file, so dotai emits ignore patterns as deny permission rules targeting the Read and Edit tools. The effect is equivalent — the agent cannot read or edit matched paths — but the mechanism differs from the other tools.

Exclude paths that generate noise in the agent context window without contributing useful information:

  • Build artifactsdist/**, build/**, out/**
  • Lock files*.lock, package-lock.json, yarn.lock
  • Generated code**/*.generated.ts, **/generated/**
  • Caches and temp dirs.cache/**, tmp/**, .turbo/**
  • Large binary or data dirs**/*.wasm, data/**

Keeping ignored paths lean maximizes the portion of the context window available for source code, tests, and documentation that the agent actually needs.

  • Copilot — Does not support ignore pattern configuration via files. All ignore patterns are skipped with a warning during ai sync.
  • Antigravity — Does not support ignore pattern configuration via files. All ignore patterns are skipped with a warning during ai sync.