Skip to content

Feature Request: Auto-detect and suggest ignoring heavy build directories (e.g. .next, dist) #22292

@aniruddhaadak80

Description

@aniruddhaadak80

What would you like to be added?

Add a mechanism to automatically detect and suggest ignoring heavy, generated build directories (like .next, node_modules, dist, build, .out) when they are not explicitly ignored via .gitignore or .geminiignore.

Approach:
Upon CLI initialization or when traversing files (e.g., using read-many-files or globbing), if the tool detects high file counts from known boilerplate directories, it could print a light, transient warning or automatically inject a default ignore template locally.

Why is this needed?

Tokens are precious. If a user runs the CLI in a repository where they haven't properly configured ignore behaviors, the agent might aggressively ingest thousands of minified JS files from dist or chunks from .next. This can:

  1. Instantly blow up the user's token budget constraint.
  2. Severely degrade prompt contextual quality and latency.
  3. Potentially cause the TokenBudgetWarning to fire immediately.

Having a smart, default set of ignored paths out of the box will significantly improve the onboarding experience for JavaScript / TypeScript / Build-heavy project users.

Suggested File Paths / Context

  • packages/core/src/indexing/ignoreUtils.ts
  • Or packages/core/src/tools/read-many-files.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitystatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions