Summary
When a Claude Code agent creates a literal Windows-path directory (e.g. C:\Users\kover\AppData\Local\pnpm\store\v3) inside a Linux worktree, the taskrunner's post-task git ls-files --others --exclude-standard hangs indefinitely scanning the deeply nested directory tree.
Reproduction
- Taskrunner launches a Claude Code session in a worktree at
/tmp/cc-worktree-{taskId}
- The agent runs a command that creates a Windows-style path as a literal Linux directory (e.g.
pnpm store path returning C:\Users\... and the agent using it as-is)
- Task completes successfully (commit created)
- Taskrunner runs
git ls-files --others --exclude-standard to check for untracked files
- Command hangs — the Windows-path directory contains thousands of files from the pnpm store
Root Cause
The worktree is an isolated git repo with no .gitignore covering Windows-style paths. git ls-files --others walks the entire untracked tree, which in this case includes the full pnpm store.
Impact
- Task marked as running indefinitely (never transitions to completed/failed)
- Taskrunner loop blocks on the hung task
- Branch exists with valid commit but no PR created
Observed Instance
- Task
e586774e (unified credits tests on stackbilt-auth)
- Worktree:
/tmp/cc-worktree-e586774e
- Polluting directory:
C:\Users\kover\AppData\Local\pnpm\store\v3\ (literal backslash-separated path)
- Manual recovery: killed stuck processes,
git push from worktree, manual PR creation
Fix Options
- Timeout on git operations: Add
timeout 30s prefix to post-task git commands in taskrunner.sh
- Worktree .gitignore: Auto-create
.gitignore in worktrees that ignores common pollution patterns (C:*, node_modules/, .pnpm-store/)
- Skip untracked scan: If the commit exists, just push — untracked files in a worktree don't matter
Recommended: options 1 + 2 together.
Summary
When a Claude Code agent creates a literal Windows-path directory (e.g.
C:\Users\kover\AppData\Local\pnpm\store\v3) inside a Linux worktree, the taskrunner's post-taskgit ls-files --others --exclude-standardhangs indefinitely scanning the deeply nested directory tree.Reproduction
/tmp/cc-worktree-{taskId}pnpm store pathreturningC:\Users\...and the agent using it as-is)git ls-files --others --exclude-standardto check for untracked filesRoot Cause
The worktree is an isolated git repo with no
.gitignorecovering Windows-style paths.git ls-files --otherswalks the entire untracked tree, which in this case includes the full pnpm store.Impact
Observed Instance
e586774e(unified credits tests on stackbilt-auth)/tmp/cc-worktree-e586774eC:\Users\kover\AppData\Local\pnpm\store\v3\(literal backslash-separated path)git pushfrom worktree, manual PR creationFix Options
timeout 30sprefix to post-task git commands intaskrunner.sh.gitignorein worktrees that ignores common pollution patterns (C:*,node_modules/,.pnpm-store/)Recommended: options 1 + 2 together.