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.

Update: Since Ghostty 1.3.0, there is direct support for AppleScript, which makes it more robust to open new terminal windows and run commands. The script below has been updated to use AppleScript to open a new Ghostty window and run the Claude CLI command.

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

#!/usr/bin/osascript

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title claude-term
# @raycast.mode silent

# Documentation:
# @raycast.author rverton
# @raycast.authorURL https://raycast.com/rverton

tell application "Ghostty"
	activate
	set newTab to new tab in front window
	set term to terminal 1 of newTab
	input text "cd ~/.claude-scratch && claude" to term
    send key "enter" to term
end tell

See Also