Skip to content

Recommend strict files.exclude and search.exclude to minimize noise in #textSearch results and reduce token consumption #9898

@tamuratak

Description

@tamuratak

Since Copilot has transitioned to usage-based billing, it is recommended to document best practices for controlling token consumption somewhere.

To prevent the built-in tool grep_search, or #textSearch, from returning irrelevant results and filling the context window with noise, it is advisable to strictly configure files.exclude and search.exclude. This is recommended because grep_search respects these settings by default, which can help keep junk out of the search results.

Even if the agent does not read a file in the search results, if the file is in a format like jsonl, the search results alone will consume many tokens.


See:

"Whether to include files that would normally be ignored according to .gitignore, other ignore files and files.exclude and search.exclude settings. Warning: using this may cause the search to be slower. Only set it when you want to search in ignored folders like node_modules or build outputs."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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