Skip to content

Add support for AI ignore files and smart diff truncation #4916

@eamodio

Description

@eamodio

Adds support for filtering sensitive or unnecessary data from AI prompts.

Summary

  • Adds gitlens.ai.exclude.files setting to exclude files from AI prompts
  • Adds support for .aiignore, .cursorignore, and .aiexclude files
  • Adds priority-based truncation that drops low-value files first when prompts exceed token limits

Impact

Users can now control what data is sent to AI providers, improving privacy and prompt quality. Smart truncation ensures prompts stay within model limits while preserving the most relevant content.

Validation

  1. Create a .aiignore file with patterns
  2. Use an AI feature (e.g., explain changes)
  3. Verify excluded files are not included in the prompt

Risk

Low - additive feature with no changes to existing behavior unless configured.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions