[BUG] Claude Code hangs on new chats - regular chat works fine
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
Starting a new chat session in one specific project directory hangs indefinitely at "waiting for Claude" (no error, no timeout — just never resolves). Sessions already open in the same project are unaffected and perform normally. The issue is reproducible on every attempt to create a new session in this project.
Environment
- Claude Code version: 2.1.281 (native install,
latestchannel) - OS: macOS (Darwin 27.0.0)
- Project location: inside
~/Documents/...(iCloud Drive "Desktop & Documents" sync enabled)
Symptom
- Creating a new chat session in this project: hangs at "waiting for Claude" indefinitely.
- Switching between/using already-open sessions in the same project: works normally, no lag.
- New chats in other projects: work normally.
- No error message, no crash, no beachball — the UI just never becomes interactive for the new session.
What I ruled out (via elimination testing, each verified by removing/restoring and re-testing)
All of the following were tested by removing the item, testing a new chat, and — if it didn't help — restoring it:
- Project's
CLAUDE.mdsize (79KB→69KB) — renamed the file out entirely; hang persisted. node_modulesdirectories — 7 directories, ~800MB / ~430K files, all gitignored/regenerable — deleted viarm -rf; hang persisted.- A recent
.claude/settings.local.jsonedit (disabling unused plugins) — reverted; hang persisted. - 5 stale git worktrees inside
.claude/worktrees/— 4.5GB, 341,354 files (each with its ownnode_modules), leftover from past agent sessions — relocated out viamv; hang persisted. - 144 session transcripts in
~/.claude/projects/<project>/— 1GB total, several files 50-108MB each — moved out (leaving only the active session's own transcript); hang persisted.
None of these changed the behavior. The project directory went from ~535,893 files down to a small fraction of that with zero effect on the hang, which rules out simple "too many files" / directory-size explanations.
Secondary finding (possibly related, possibly separate bug)
While testing, I found that git status (and even mv) on the git-worktree copies hung indefinitely — both via Claude Code's own sandboxed Bash tool AND via a plain Terminal.app session (not going through Claude Code at all). This is consistent with iCloud Drive file eviction: the worktree files showed a cloud icon in Finder (not fully downloaded locally), and operations requiring file content (git status) stalled, while operations that don't (rm -rf, mv) completed fine. This may or may not be related to the new-chat hang, but seems worth flagging as a separate concern for projects living inside iCloud-synced folders.
Request
Since file-count/size reduction had no effect, the cause is likely something in the app's own new-session initialization path that isn't simply "scan the project directory." I don't have visibility into what the process is doing during the hang (no accessible logs from inside a session). Console.app capture during a live hang may help narrow it down further if needed.
What Should Happen?
A new chat could be performed without the Waiting for Claude Error
Error Messages/Logs
## Summary
Starting a new chat session in one specific project directory hangs indefinitely at "waiting for Claude" (no error, no timeout — just never resolves). Sessions already open in the same project are unaffected and perform normally. The issue is reproducible on every attempt to create a new session in this project.
## Environment
- Claude Code version: 2.1.281 (native install, `latest` channel)
- OS: macOS (Darwin 27.0.0)
- Project location: inside `~/Documents/...` (iCloud Drive "Desktop & Documents" sync enabled)
## Symptom
- Creating a **new** chat session in this project: hangs at "waiting for Claude" indefinitely.
- Switching between/using **already-open** sessions in the same project: works normally, no lag.
- New chats in **other** projects: work normally.
- No error message, no crash, no beachball — the UI just never becomes interactive for the new session.
## What I ruled out (via elimination testing, each verified by removing/restoring and re-testing)
All of the following were tested by removing the item, testing a new chat, and — if it didn't help — restoring it:
1. **Project's `CLAUDE.md` size** (79KB→69KB) — renamed the file out entirely; hang persisted.
2. **`node_modules` directories** — 7 directories, ~800MB / ~430K files, all gitignored/regenerable — deleted via `rm -rf`; hang persisted.
3. **A recent `.claude/settings.local.json` edit** (disabling unused plugins) — reverted; hang persisted.
4. **5 stale git worktrees** inside `.claude/worktrees/` — 4.5GB, 341,354 files (each with its own `node_modules`), leftover from past agent sessions — relocated out via `mv`; hang persisted.
5. **144 session transcripts** in `~/.claude/projects/<project>/` — 1GB total, several files 50-108MB each — moved out (leaving only the active session's own transcript); hang persisted.
None of these changed the behavior. The project directory went from ~535,893 files down to a small fraction of that with zero effect on the hang, which rules out simple "too many files" / directory-size explanations.
## Secondary finding (possibly related, possibly separate bug)
While testing, I found that `git status` (and even `mv`) on the git-worktree copies hung indefinitely — both via Claude Code's own sandboxed Bash tool AND via a plain Terminal.app session (not going through Claude Code at all). This is consistent with iCloud Drive file eviction: the worktree files showed a cloud icon in Finder (not fully downloaded locally), and operations requiring file content (git status) stalled, while operations that don't (rm -rf, mv) completed fine. This may or may not be related to the new-chat hang, but seems worth flagging as a separate concern for projects living inside iCloud-synced folders.
## Request
Since file-count/size reduction had no effect, the cause is likely something in the app's own new-session initialization path that isn't simply "scan the project directory." I don't have visibility into what the process is doing during the hang (no accessible logs from inside a session). Console.app capture during a live hang may help narrow it down further if needed.
Steps to Reproduce
Summary
Starting a new chat session in one specific project directory hangs indefinitely at "waiting for Claude" (no error, no timeout — just never resolves). Sessions already open in the same project are unaffected and perform normally. The issue is reproducible on every attempt to create a new session in this project.
Environment
- Claude Code version: 2.1.281 (native install,
latestchannel) - OS: macOS (Darwin 27.0.0)
- Project location: inside
~/Documents/...(iCloud Drive "Desktop & Documents" sync enabled)
Symptom
- Creating a new chat session in this project: hangs at "waiting for Claude" indefinitely.
- Switching between/using already-open sessions in the same project: works normally, no lag.
- New chats in other projects: work normally.
- No error message, no crash, no beachball — the UI just never becomes interactive for the new session.
What I ruled out (via elimination testing, each verified by removing/restoring and re-testing)
All of the following were tested by removing the item, testing a new chat, and — if it didn't help — restoring it:
- Project's
CLAUDE.mdsize (79KB→69KB) — renamed the file out entirely; hang persisted. node_modulesdirectories — 7 directories, ~800MB / ~430K files, all gitignored/regenerable — deleted viarm -rf; hang persisted.- A recent
.claude/settings.local.jsonedit (disabling unused plugins) — reverted; hang persisted. - 5 stale git worktrees inside
.claude/worktrees/— 4.5GB, 341,354 files (each with its ownnode_modules), leftover from past agent sessions — relocated out viamv; hang persisted. - 144 session transcripts in
~/.claude/projects/<project>/— 1GB total, several files 50-108MB each — moved out (leaving only the active session's own transcript); hang persisted.
None of these changed the behavior. The project directory went from ~535,893 files down to a small fraction of that with zero effect on the hang, which rules out simple "too many files" / directory-size explanations.
Secondary finding (possibly related, possibly separate bug)
While testing, I found that git status (and even mv) on the git-worktree copies hung indefinitely — both via Claude Code's own sandboxed Bash tool AND via a plain Terminal.app session (not going through Claude Code at all). This is consistent with iCloud Drive file eviction: the worktree files showed a cloud icon in Finder (not fully downloaded locally), and operations requiring file content (git status) stalled, while operations that don't (rm -rf, mv) completed fine. This may or may not be related to the new-chat hang, but seems worth flagging as a separate concern for projects living inside iCloud-synced folders.
Request
Since file-count/size reduction had no effect, the cause is likely something in the app's own new-session initialization path that isn't simply "scan the project directory." I don't have visibility into what the process is doing during the hang (no accessible logs from inside a session). Console.app capture during a live hang may help narrow it down further if needed.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude Code version: 2.1.281
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_