[BUG] An exception is thrown whenever Claude tries to present a code change in IDE for approval

Status Fixed / completed
Maintainer reply ✓ Yes — igorkofman
Activity 4 comments · opened Jun 6, 2025 · closed Jun 6, 2025
💡 Likely answer: A maintainer (igorkofman, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.16 (Claude Code)
  • Operating System: macOS 15.5 (24F74)
  • Terminal: Windsurf Terminal + Claude Code Extension

Bug Description

An exception is thrown whenever Claude tries to present a code change in Windsurf for approval:

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: command 'type' already exists
    at hX2 (file:///Users/jeff/.asdf/installs/nodejs/22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12108)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async oY5 (file:///Users/jeff/.asdf/installs/nodejs/22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:10075)
    at async J (file:///Users/jeff/.asdf/installs/nodejs/22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:8929)

Steps to Reproduce

  1. Open Windsurf
  2. Start Claude in integrated Terminal (IDE Connected)
  3. Prompt Claude to make a change
  4. Observe Claude performing solution steps
  5. Crash is shown when Claude attempts to present code changes for user approval

Expected Behavior

An editor tab opened by Claude presenting a diff of its proposed code changes.

Actual Behavior

The exception message and no diff presented.

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->

View original on GitHub ↗

4 Comments

digismack · 1 year ago

This one is rough because you can't see the changes it's presenting. I tried uninstalling the VSCode extension hoping it would detect that it wasn't there and revert back to showing the diff in the CLI, but no such luck.

igorkofman collaborator · 1 year ago

Thanks for the report.
We'll try and fix this asap. In the meantime you can got into /config and change the diff tool to build-on.

igorkofman collaborator · 1 year ago

We have a fix coming for this issue later today (it'll be in 1.0.17) - thanks again for the report.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.