Skip to content

Show Claude Code sessions started in a terminal (Warp, Terminal, iTerm…) - #282

Merged
Louis-CFM merged 3 commits into
Louis-CFM:mainfrom
guerraOrzc:contrib/b-terminal-sessions
Oct 8, 2026
Merged

Louis-CFM merged 3 commits into
Louis-CFM:mainfrom
guerraOrzc:contrib/b-terminal-sessions

Conversation

@guerraOrzc

@guerraOrzc guerraOrzc commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Shows Claude Code sessions started in a terminal (Warp, Terminal, iTerm…) on the Mac notch's Claude Code pill.

Fixes #239. Fixes #54.

This is 1 of 3 PRs split from #280:

Screenshot

The Claude Code pill with a session from Warp: it says "Claude Code", and its button opens Warp:

Claude Code pill card with an Open Warp button

What changes

Until now, hook events not coming from VS Code or Cursor were dropped ("Ignored … from WarpTerminal" in nb.log). Sessions in Warp, Terminal, iTerm, Ghostty, kitty, Alacritty, WezTerm, Hyper, Zed, cmux and Orca (ClaudeHost.swift, matched on __CFBundleIdentifier, else TERM_PROGRAM; cmux sets TERM_PROGRAM=ghostty, so its bundle id decides) now route to the existing integration_claude pill:

  • The pill shows steps, diffs and the finished state, like VS Code sessions.
  • The pill reads "Claude Code" (VS Code sessions keep "VS Code").
  • Its open button brings the terminal forward ("Open Warp"), and so does the finished card's "Open terminal". Before, that button only knew Terminal, iTerm, kitty and Ghostty, and opened a new Terminal.app window for anything else.
  • Notes say "Handled in Warp." instead of "Handled in VS Code."
  • The terminal is stored on the task as AgentTask.hostApp (nil = VS Code), so nothing changes for VS Code sessions.

Questions and permission requests from terminal sessions stay in the terminal by default. The --ask and PermissionRequest hooks hold the request until the notch answers, so showing them in the notch would make the terminal wait. A new setting under the Claude Code hooks, "Answer questions and permissions from terminal sessions in the notch" (off by default), lets terminal users opt into the VS Code behavior. When it is off, the request is answered with ask at once.

Like VS Code today, the pill follows the most recently active session.

Not done / known limits

Related open PRs

Testing

  • Builds: NotchBuddy (Debug, and Debug with PHONE_LINK), CoucouAppStore (CODE_SIGNING_ALLOWED=NO) and CoucouPhone (iOS Simulator) build on Xcode 27.
  • Tests: all scripts/test-*.sh pass, including the new test-claude-host.sh (terminal detection, labels, the setting is off by default).
  • Checked live:
    • Warp hook events reach the Claude Code pill.
    • With the setting off, a permission request from Warp gets ask immediately.
  • Not checked on screen: the "Open terminal" change (built and covered by the code path above, not clicked live).

🤖 Generated with Claude Code

- ClaudeHost: recognise terminal sessions from the hook's term_program /
  bundle_id and route them to the Claude Code pill (AgentTask.hostApp).
- The pill says "Claude Code" and "Open <terminal>" brings it forward;
  "Handled in …" notes name the right app.
- New setting, off by default: answer terminal sessions' questions and
  permissions in the notch. Off, the terminal asks itself straight away.
- Tests: scripts/test-claude-host.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssion's app

- cmux (com.cmuxterm.app, Louis-CFM#54) sets TERM_PROGRAM=ghostty: the bundle id is
  checked first, so it's no longer taken for Ghostty. Orca (com.stablyai.orca,
  reported in Louis-CFM#32) is recognised too.
- The finished card's "Open terminal" brings forward the terminal the session
  runs in, before the fixed list. A Warp session no longer opens Terminal.app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kept upstream's Hermes notes and permission guard next to the terminal
routing, and its Claude Desktop "Open Claude" button; "Open terminal"
still tries the session's own terminal first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@guerraOrzc
guerraOrzc marked this pull request as ready for review October 7, 2026 22:22
@Louis-CFM
Louis-CFM merged commit e7ae858 into Louis-CFM:main Oct 8, 2026
Louis-CFM added a commit that referenced this pull request Oct 8, 2026
…ht app (#326)

Terminal sessions in the notch, and Open terminal brings back the right app (#282, #238)

Copy link
Copy Markdown
Owner

Merged in #326 — thank you @guerraOrzc! Sessions from Warp, Terminal, iTerm, Ghostty and friends were the most requested thing, and keeping their approvals in the terminal unless you opt in is exactly the right default. 🙌


Generated by Claude Code

JhoanG956 pushed a commit to JhoanG956/coucou that referenced this pull request Oct 8, 2026
…k the session's own app

Louis-CFM#282 records the terminal a Claude Code session runs in (hostApp) for the pill's
label and routing; Louis-CFM#238 records every session's app (sessionBundleId). Open
terminal tries the Claude Code terminal first, then the session's app (VS Code
included, which fixes Louis-CFM#291), then any running terminal, then Terminal.app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants