claude code integration
overview
Section titled “overview”spacecake integrates with Claude Code to give Claude context about your open files and display live session metrics.
connecting claude code
Section titled “connecting claude code”run claude from the integrated terminal - it automatically connects to spacecake, giving Claude context about your open files.
if Claude shows “IDE disconnected”, run /ide to check the connection status. you should see spacecake listed and can select it to reconnect.
a green claude status badge in the header indicates an active Claude session is connected.
plan mode
Section titled “plan mode”Claude Code defaults to plan mode when running inside spacecake’s integrated terminal. in plan mode, Claude creates a plan file before making changes, giving you a chance to review and edit the approach.
opening plans with ctrl+g
Section titled “opening plans with ctrl+g”when Claude creates or updates a plan, you’ll see a prompt in the terminal:
press ctrl+g to open the plan in spacecakepress ctrl+g to open the plan file directly in the editor. the tab will show a green “claude” badge indicating it was opened by Claude.
editing and returning
Section titled “editing and returning”when you’re done reviewing or editing the plan:
- save & close: saves your changes and returns focus to Claude
- close: closes without saving and returns to Claude
Claude will wait for you to close the file before continuing, so you can take your time reviewing the plan.
status line
Section titled “status line”the status line displays live Claude Code session metrics in the terminal header badge:
- current model name
- context usage percentage
- session cost
automatic setup
Section titled “automatic setup”spacecake automatically configures Claude Code’s status line hook when it detects a connected session. no manual setup is required.
if your ~/.claude/settings.json already has a custom statusLine command (not managed by spacecake), you’ll be prompted to either override it with the spacecake hook or dismiss the prompt and keep your existing configuration.
manual setup
Section titled “manual setup”if you need to configure the status line manually, edit ~/.claude/settings.json and set the statusLine command to the spacecake hook script:
{ "statusLine": { "type": "command", "command": "~/.spacecake/.app/hooks/statusline.sh" }}restart Claude Code after making changes.
how it works
Section titled “how it works”Claude Code runs the status line hook on each render. the spacecake hook script:
- reads session JSON from stdin (model, context usage, cost)
- checks if
~/.claude/spacecake.sockexists (Unix socket) - POSTs the data to spacecake via the socket
if spacecake isn’t running, the hook exits silently with no impact on Claude Code.
troubleshooting
Section titled “troubleshooting”IDE disconnected?
- run
/idein Claude Code to check connection status - select spacecake from the list to reconnect
no status line data appearing?
- make sure spacecake is running
- verify
~/.claude/settings.jsonhas the correctstatusLineconfiguration - restart Claude Code after making changes