OpenCockpitOpenCockpit
← Back to blog

Cockpit now has a Claude Code CLI execution mode

Published June 10, 2026 · 5 min read

Every Claude chat tab in Cockpit can now run in one of two ways: the Claude Agent SDK (headless `query()`), or a real interactive `claude` session driven in a PTY. Both share the same conversation, so you can switch per tab, mid-conversation, one click away. Here is what the new CLI mode is and how it works.

Cockpit drives Claude Code through the Claude Agent SDK — query(), headless, programmatic. That is still the default. As of this release, each Claude / Claude2 chat tab also has a second execution mode you can flip to: Claude Code CLI.

Here is what the two modes are, and how the new one works.

Two ways to run the same conversation

The toggle sits right above the message list:

ModeWhat actually runs
Claude Agent SDKquery() — headless, programmatic
Claude Code CLIa real interactive claude session in a PTY

Same Claude, same project, same tools. The only difference is how the turn is driven.

In Claude Code CLI mode, every message spawns an interactive claude in a pseudo-terminal, types your prompt into the live REPL exactly like a human at a keyboard would, watches the session transcript to know when the turn is done, and exits. It is ephemeral — no daemon, no resident process — but for the duration of a turn it is, by every observable signal, an interactive Claude Code session.

Different invocation paths can be metered differently over time. We will leave you to decide which one fits; the point here is that you now have the choice, per tab, one click away.

Same session, seamless switching

The detail that makes this painless: both modes read and write the same session file.

The SDK's query({ resume }) and the CLI's claude -r operate on the same ~/.claude/projects/.../<id>.jsonl transcript — they are the same underlying claude-code binary. So:

  • One continuous conversation, one history. No "SDK history" vs "CLI history."
  • You can flip a tab between Claude Agent SDK and Claude Code CLI mid-conversation and the next turn just continues.
  • The chat panel always renders from that one transcript, so the UI does not change between modes.

You are not choosing between two products. You are choosing how the next message runs.

A real terminal you can actually see

Driving an interactive TUI from code is the kind of thing that works in a demo and then quietly wedges on a dialog at 2am. So CLI mode is not a black box — it ships with a small floating terminal in the corner of the chat.

  • It shows the live, character-by-character output of the real claude session. (The chat panel, rendered from the transcript, is block-level — the floating window is where you get the typewriter feel.)
  • It auto-expands while a turn is running and collapses when it is done.
  • If a turn ever gets stuck — say Claude is waiting on a prompt the driver did not anticipate — you get a notice in the chat bubble and you can type directly into that terminal to nudge it through by hand. Human-in-the-loop, exactly where you would want it.

Press ESC to interrupt at any time; the session is reaped cleanly, with no orphan processes left behind.

Try it

Update Cockpit, open a Claude or Claude2 chat, and look for the Claude Agent SDK / Claude Code CLI toggle above the message list. Flip it to Claude Code CLI, send a message, and watch the floating terminal drive a real interactive session.


Try it: npm i -g @surething/cockpit · GitHub · Try Online