claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] claude code starts cursor ide

Open thesamet opened this issue 6 months ago • 2 comments

Environment

  • Platform (select one):

  • Claude CLI version: 1.0.30

  • Operating System: NixOS

  • Terminal: kitty, alacritty, xterm

Bug Description

When I start claude via the command line, it opens claude, and gives me the prompt as expected. However, it always launches cursor the IDE on a new window. I have no idea why it does that. I currently use cursor. This happen within any directory I am starting claude from

Steps to Reproduce

  1. Open a terminal.
  2. Start claude
  3. Claude starts in a terminal, opens Cursor in a new window

Expected Behavior

Claude code starts in the terminal and waits for user input.

Actual Behavior

Cursor is opened in the background, focus switches to it.

Additional Context

I tried installing cursor via npm, via migration, and through nix package manager. Behavior is the same. I also deleted ~/.claude.json and ~/.claude directory.

thesamet avatar Jun 24 '25 14:06 thesamet

related https://github.com/anthropics/claude-code/issues/2397

ardasevinc avatar Jun 24 '25 18:06 ardasevinc

how do we solve this? anyone has a workaround?

edit: i found a workaround.

the issue is that claude code is running cursor somehow when launched. so we gotta put up a fake shim/script that claude code sees instead of the real cursor binary.

  • make sure your ~/.local/bin is in PATH. its location in the path should be before the real cursor binary, you can substitute your own path, usr/local/bin etc
  • inside your chosen path (~/.local/bin) create the file cursor and inside put this:
#!/bin/sh
# shim to fully fake --version and suppress gui for non-interactive callers

case "$1" in
  --version*|-v)
    printf "1.1.6\n\
deadbeefdeadbeefdeadbeefdeadbeefdeadbeef\n\
x64\n"
    exit 0
    ;;
esac
  • save the file and make it executable: chmod +x ~/.local/bin/cursor

now when you launch claude code it should go to this shim we made and not launch cursor every time.

ardasevinc avatar Jun 28 '25 17:06 ardasevinc

same here

AmeerArsala avatar Aug 05 '25 00:08 AmeerArsala

this appears to have surfaced again, somehow - I assume this is probably a cursor issue to fix but making note since this is the first place that comes up when you google the issue

brickfrog avatar Aug 07 '25 03:08 brickfrog