Unhandled API Connection Failure During Tool Call Causes Irrecoverable State
Bug Description: If the connection goes out or an API timeout happens in the middle of the toolcall it creates an unrecoverable error in the that. There is nothing you can do to remedy it including switching models, going back to earlier messages from before the toolcall, closing and resumning, nothing. You have to abandon the chat. Environment Info:
Platform: macos Terminal: Apple_Terminal Version: 1.0.18 Feedback ID: 49b512ac-5ecd-4755-b59c-0f6f181a125b
Errors: The error log shows two main issues:
A keychain access error where the system couldn't find Claude Code credentials in the macOS keychain A ShellError indicating a shell command failed during execution
The stack traces reference various internal Claude Code functions, suggesting the error occurred deep in the tool's execution flow when trying to handle API calls. This looks like a serious bug where network interruptions during tool calls can brick an entire Claude Code session with no recovery option. The user has to completely abandon their work and start over, which is pretty frustrating from a UX perspective.
Error: Command failed: security find-generic-password -a $USER -w -s "Claude Code" security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:882:11)
at execSync (node:child_process:954:15)
at JZ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:659:3921)
at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:11795
at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)
at aJ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10941)
at AS (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10022)
at L6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:14134)
ShellError: Shell command failed at Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1578:1345) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async qD5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:19177) at async LK1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:17763) at async ND5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:16805) at async ED5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:16434) at async OO (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:16