Open Claude Code CLI from Raycast in a new Ghostty window

ai

The Claude Desktop app is slow as hell and takes multiple seconds to open. I prefer the CLI version of Claude, which is way faster. However, I also like using Raycast for quick access to apps and commands.

To open Claude in a scratch folder in a new terminal window from Raycast, you can use the following Raycast script command:

 #!/bin/bash

 # @raycast.schemaVersion 1
 # @raycast.title Claude CLI
 # @raycast.mode silent

 CLAUDE_DIR="$HOME/.claude-scratch"
 mkdir -p "$CLAUDE_DIR"

 osascript <<EOF
 tell application "Ghostty" to activate
 delay 0.1
 tell application "System Events"
     keystroke "t" using command down
     delay 0.1
     keystroke "cd $CLAUDE_DIR && claude"
     key code 36
 end tell
 EOF

Now add this script as a Raycast script command, and you can quickly open Claude CLI in a new Ghostty terminal window by invoking it from Raycast.

See Also