claude-code - 💡(How to fix) Fix [BUG] Claude Code hangs on any prompt when opened in specific subdirectory (Windows) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45428Fetched 2026-04-09 08:05:40
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

in a specific subdirectory. No output, no error. Works fine from parent directory. Actual: Infinite hang, no output, no error message

Error Messages/Logs

  1. Claude hangs indefinitely — no output, no error
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Version: 2.1.96 OS: Windows 11 Project path: subdirectory of a larger project

Bug: Claude Code hangs indefinitely on any prompt (even "Hello") when opened in a specific subdirectory. No output, no error. Works fine from parent directory.

What I tried:

  • Created .claudeignore (excluding build/, app/build/, node_modules/, etc.)
  • Renamed CLAUDE.md to rule it out → still hangs
  • No java/gradle/adb processes running
  • claude --verbose produces no output
  • claude "Hello" from parent directory works fine

Directory stats:

  • Total files: 18,462
  • app/build/: 9,642 files (largest offender)
  • .claudeignore present and configured

Expected: Claude responds normally Actual: Infinite hang, no output, no error message

Related: #31239 (different scope — that bug affects all directories, this one is specific to a single subdirectory)

What Should Happen?

Claude Code should respond normally to any prompt, including "Hello", when opened in any subdirectory of a project. It works fine from the parent directory (eCoachingCC) but hangs indefinitely in the android-project subdirectory.

Error Messages/Logs

Steps to Reproduce

  1. Open Windows Terminal
  2. cd "C:\Users<username>\Documents\00_IA\eCoachingCC\android-project"
  3. Type: claude "Hello"
  4. Claude hangs indefinitely — no output, no error

Note: Running the same command from the parent directory C:\Users\User\Documents\00_IA\eCoachingCC works fine.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.96

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

extent analysis

TL;DR

  • The issue can likely be mitigated by optimizing the directory structure or adjusting the .claudeignore file to more efficiently exclude large directories like app/build/.

Guidance

  • Verify that the .claudeignore file is correctly formatted and that the excluded directories are properly specified to ensure Claude Code is not attempting to process an excessively large number of files.
  • Consider temporarily moving the app/build/ directory outside of the project path to see if this resolves the hanging issue, which could indicate if the problem is related to the sheer number of files in that directory.
  • Check for any hidden files or directories that might not be excluded by the .claudeignore file and could be causing Claude Code to hang.
  • Test Claude Code in other subdirectories with fewer files to determine if the issue is specific to the android-project subdirectory or if it's a more general problem related to directory size or complexity.

Example

No specific code example is applicable here, as the issue seems related to directory structure and file quantity rather than code syntax.

Notes

The exact cause of the hang is not specified, but it's implied to be related to the large number of files in the app/build/ directory. The fact that it works from the parent directory but not from the android-project subdirectory suggests a potential issue with how Claude Code handles certain directory structures or file quantities.

Recommendation

  • Apply workaround: Adjust the .claudeignore file or the directory structure to reduce the number of files Claude Code needs to process, as this seems to be the most direct way to address the hanging issue without waiting for a potential fix in a future version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING