Skip to content

🎯 Using .snaprignore to control context window

Snapr offers advanced configurability through the .snaprignore file — a mechanism similar to .gitignore — allowing you to exclude files, folders, or patterns from being considered during AI-driven tasks.

This helps reduce noise, improve performance, and focus Snapr's attention where it matters most.

🧠 Why Use .snaprignore?

By default, Snapr can analyze all files in your repository to provide contextual understanding for tasks like refactoring, generating code, or reviewing pull requests.

However, not all files are relevant. For example:

  • node_modules/, dist/, or build/ folders
  • Generated files or minified assets
  • Legacy code or vendor libraries
  • Large datasets or docs irrelevant to code generation

Ignoring these improves:

  • Processing time
  • Context relevance
  • Accuracy of AI suggestions

📄 File Location

The .snaprignore file must be placed in the root of your repository, just like .gitignore.

your-repo/
├── .snaprignore
├── src/
├── README.md
└── ...

✍️ Syntax Overview

The syntax follows the same rules as .gitignore . Check the documentation there for a detailed explanation.