Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Claude Code Hang on certain git commands #158

Closed
jmaddington opened this issue Feb 26, 2025 · 5 comments
Closed

Claude Code Hang on certain git commands #158

jmaddington opened this issue Feb 26, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@jmaddington
Copy link

Bug Description
Claude code hangs if a git command times out, at least from inside a docker container. Example:

Bash(git status)…
  ⎿  On branch main
     Your branch is ahead of 'origin/main' by 2 commits.
       (use "git push" to publish your local commits)

     Changes not staged for commit:
       (use "git add <file>..." to update what will be committed)
       (use "git restore <file>..." to discard changes in working directory)
     	modified:   ../prompts/Keap Base Prompt.txt
     	modified:   tandem/spectacular_schema.yaml

     Untracked files:
       (use "git add <file>..." to include in what will be committed)
     	../entrypoint.sh
     	test_api_call.py
     	test_api_call_no_id.py
     	test_company_creation.py
     	test_fixed_company_creation.py

     no changes added to commit (use "git add" and/or "git commit -a")

● Bash(git push origin main)…
  ⎿  Command execution timed out
     Exit code 143

● Let me try again with a shorter timeout:

● Bash(git push origin main)…

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                                                                                          │
│                                                                                                                                                                                       │
│   git push origin main                                                                                                                                                                │
│   Uploads local main branch commits to remote repository                                                                                                                              │
│                                                                                                                                                                                       │
│ Do you want to proceed?                                                                                                                                                               │
│ ❯ Yes                                                                                                                                                                                 │
│   Yes, and don't ask again for git push commands in /app/tandem                                                                                                                       │
│   No, and tell Claude what to do differently (esc)                                                                                                                                    │
│

The UI is completely unresponsive at this point and the only fix is closing out of the terminal.

This happens with other git commands occasionally as well.

Environment Info

  • Platform: macos / Docker
  • Terminal: iTerm.app
  • Version: 0.2.14
  • Feedback ID: 9949e30d-5742-4bd4-bcbc-e1dc751af532
@bcherny
Copy link
Collaborator

bcherny commented Feb 26, 2025

This should be fixed in v0.2.18. Restart to get the update and lmk if it's feeling better.

@bcherny bcherny added the bug Something isn't working label Feb 26, 2025
@jmaddington
Copy link
Author

Related: if it were possible to resume previous sessions that would be helpful, especially in the event of a crash/hang.

@Jarred-Sumner
Copy link

@bcherny it consistently gets stuck in the bash tool, output:

 Now, let me create a Vue plugin for Bun based on the examples and documentation I've reviewed:

  Bash(mkdir -p packages/bun-plugin-vue/src)

 Percolating… (30s · esc to interrupt)

This is 0.2.19 (but has been consistent in each version I've tried). If I try to interrupt it, it prints:

> If I try to interrupt it
    API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.14: Did not find 1 `tool_result` block(s) at the beginning of this message. Messages
following `tool_use` blocks must begin with a matching number of `tool_result` blocks."}}

@jmaddington
Copy link
Author

@bcherny it still hangs.

Image

It tried to push twice, after the first one timed out it tried again, but still became unresponsive to keyboard input.

It looks like it is trying to read from interactive input, which I didn't expect:

Image

@bcherny
Copy link
Collaborator

bcherny commented Mar 3, 2025

@Jarred-Sumner would you mind adding a repro in #290? Specific tool name + transcript would be very helpful.

@jmaddington thanks for the report! Tracking in #292

@bcherny bcherny closed this as completed Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants