Skip to content

Ignore Patterns

The .agentsmesh/ignore file uses gitignore-style syntax to tell AI tools which files and directories to exclude from indexing, reading, and context loading.

File format

# Dependencies
node_modules
.pnp
.pnp.js
# Build output
dist
build
out
.next
.nuxt
# Environment and secrets
.env
.env.*
*.pem
*.key
*.cert
# Logs
*.log
npm-debug.log*
# OS artifacts
.DS_Store
Thumbs.db
# Coverage and caches
coverage
.nyc_output
.cache
.turbo
# Large generated files
*.min.js
*.min.css

Syntax

The syntax is identical to .gitignore:

PatternMatches
node_modulesDirectory named node_modules anywhere in the tree
*.logAny file ending in .log
dist/Directory named dist at any level
/buildDirectory named build at the root only
!important.logUn-ignore important.log (negate a previous pattern)
src/**/*.test.tsAll .test.ts files under src/

Why this matters

AI tools use the ignore list to decide what to index into their context and what to suggest in completions. A well-tuned ignore file:

  • Prevents secrets and environment files from leaking into AI context
  • Reduces noise from build artifacts and large generated files
  • Improves response quality by focusing context on source files

Patterns from packs and extends

Installed packs and extends sources can ship an ignore file too. Their patterns join yours only when your own .agentsmesh/ignore has at least one pattern. The file counts as empty when it is missing, blank, or has only comments, like the one init creates.

While your file is empty, AgentsMesh does not manage your tools’ ignore files. generate skips the patterns from packs and extends and prints a warning, so it does not replace an ignore file you wrote by hand, such as .cursorignore or .claudeignore. An ignore file that AgentsMesh wrote earlier only from those patterns is removed, so the paths it hid (for example .env) are visible to your tools again. Global mode (~/.agentsmesh/ignore) works the same way.

To use the shared patterns, run agentsmesh import --from <tool> (add --global for ~/.agentsmesh) to copy in the patterns your tools already have, or add the patterns you want to .agentsmesh/ignore, then run agentsmesh generate. Each tool then gets the patterns from extends first, then from packs, then your own. A pattern listed twice is written once.

Tool-specific behavior

See the Ignore row in the supported tools matrix for per-target support levels (native or unsupported).

Relationship to .gitignore

The AgentsMesh ignore file is separate from .gitignore. This lets you have different exclusion rules for AI tools vs. git tracking. For example, you might want git to track dist/ for a published library, but you don’t want dist/ loaded into AI context.

Common practice is to start with your .gitignore patterns and extend them with AI-specific exclusions like minified files, large data files, and auto-generated documentation.