Skip to content

Consolidate file exclusion patterns between glob tool and read-many-files tool #6414

@Han5991

Description

@Han5991

What would you like to be added?

Merge duplicate file exclusion logic between read-many-files.ts and glob.ts into a shared utility

What to add:

  • Shared FileExclusions utility class
  • Both tools use same exclusion patterns
  • Extensible structure for future CLI configuration

Why is this needed?

Current problems:

  • Code duplication: Two tools maintain separate exclusion lists (35+ patterns vs 2 patterns)
  • Inconsistent behavior: glob.ts only excludes node_modules and .git, while read-many-files.ts excludes build dirs, binaries, coverage files, etc.
  • Maintenance burden: Pattern updates require changes in multiple files
  • Poor UX: Users get different results from different tools for the same operation

Business impact:

  • Developers waste time on inconsistent tool behavior
  • Risk of exposing sensitive files through incomplete exclusions
  • Technical debt increases maintenance costs

Already identified: TODO comment at line 104 shows this consolidation was planned but never implemented.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitypriority/p2Important but can be addressed in a future release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions