claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] Add git submodule path support for LS, Grep, and Glob tools

Open tim-watcha opened this issue 3 months ago • 4 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Currently, when Claude Code uses tools like LS, Grep, and Glob, it ignores git submodules within the project. I discovered this issue while using the CC SDK - the tool output excludes paths from git submodules entirely. Since submodules often contain critical dependencies and related code, having access to them is essential for Claude Code to properly understand and navigate the full project structure.

Proposed Solution

Enable Claude Code tools (LS, Grep, Glob, etc.) to traverse and include git submodules in their operations. This would allow CC to access and analyze code within submodules, providing a more comprehensive understanding of the entire project ecosystem.

Alternative Solutions

No response

Priority

High - Significant impact on productivity

Feature Category

File operations

Use Case Example

  1. Monorepo with shared libraries: Many projects use git submodules to manage shared code libraries. For instance, a project might have a shared-utils submodule that contains common utilities used across multiple services. Without submodule access, Claude Code cannot analyze dependencies, understand function implementations, or refactor code that relies on these shared components.

  2. Third-party dependencies as submodules: Some projects vendor their dependencies as git submodules for better version control and customization. When Claude Code cannot access these submodules, it's unable to:

    • Trace function calls into vendored libraries
    • Understand the full context of API usage
    • Debug issues that span across the main project and its dependencies
  3. Cross-project configuration and schemas: Projects often maintain shared configuration schemas, protobuf definitions, or API contracts in submodules. Without access to these, Claude Code cannot properly validate configurations or understand the data structures being used.

  4. Microservices architecture: In a microservices setup where each service is a submodule, Claude Code currently cannot navigate between services, making it difficult to understand inter-service communication, shared interfaces, or perform project-wide refactoring.

Example scenario:

my-project/
├── src/
│   └── main.py  # imports from libs/shared-auth
├── libs/
│   ├── shared-auth/  # <-- git submodule (currently invisible to CC)
│   └── shared-db/    # <-- git submodule (currently invisible to CC)
└── services/
    └── api-gateway/   # <-- git submodule (currently invisible to CC)

In this structure, Claude Code cannot currently analyze any code within the submodules, significantly limiting its understanding of the project.

Additional Context

No response

tim-watcha avatar Sep 19 '25 04:09 tim-watcha

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 06 '25 10:12 github-actions[bot]

I am experiencing same issue.

dominea-dev avatar Dec 07 '25 21:12 dominea-dev

Claude is able to read submodules in windows, but when it tries to edit a file constantly gets:

Error: File has been unexpectedly modified. Read it again before attempting to write it.

lnenad avatar Dec 08 '25 19:12 lnenad