Skip to content

Reply to a Claude Code session from the notch - #283

Open
guerraOrzc wants to merge 11 commits into
Louis-CFM:mainfrom
guerraOrzc:contrib/c-reply-from-notch
Open

guerraOrzc wants to merge 11 commits into
Louis-CFM:mainfrom
guerraOrzc:contrib/c-reply-from-notch

Conversation

@guerraOrzc

@guerraOrzc guerraOrzc commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Adds a reply box to the Mac notch, to continue a Claude Code session without going back to the terminal or editor.

This is 1 of 3 PRs split from #280, and it is stacked on the other two. The reply box lives in A's right-side panel, and it reuses B's terminal detection.

Screenshot

Replying from the notch. The run's answer shows on the session's card when it ends:

Typing a reply in the notch, then the answer on the finished card

What changes (GitHub build)

  • A ↰ chip next to the session name opens a reply box in the right card.
  • Return sends the message with claude -p --resume <session id> -- <text> in the session's folder, in the background, through a new SessionResumer.
  • InstructionRunner (iPhone instructions) now uses the same runner, so it gains terminal support, and the -- fix: a message starting with - is never read as an option.
  • The session ID, folder and terminal come from the hooks (AppState.claudeSessions), never from the UI.
  • The environment is set so the run's hooks land on the same pill. Hooks keep working, so the turn shows in the notch like any other, and permission prompts still need a click.
  • Sending is blocked while the session is working or waiting for an answer.
  • While the box is open, the island doesn't auto-collapse, and ⌘ + arrows move the cursor instead of switching pills.
  • A failed run shows "⚠ Reply failed: …" as the session's last line.
  • A claude -p --resume run ends with SessionEnd, which used to remove the pill's task, so the finished card showed "VS Code · Session finished" instead of the answer. SessionEnd from a run started here (still running, or ended in the last 5 s) is now ignored, because the session goes on in its terminal or editor. This also applies to iPhone instructions, which use the same runner.
  • Limitation: the turn runs in a separate process, so the terminal or editor the session was started in doesn't show it. The reply box says so.

Not in the App Store build: the sandbox can't start claude.

Related open PRs

Not done / known limits

  • Localization: new strings are English only, with no translations in Localizable.xcstrings.

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.
  • Checked live:
    • claude -p --resume <id> -- "--…" continues a session, including a message that starts with --.
    • A reply sent from the notch (the GIF above) runs in the session's folder and its answer shows on the card.

🤖 Generated with Claude Code

guerraOrzc and others added 4 commits October 6, 2026 21:50
… notch

- Settings: pick watched GitHub repos and a Vercel team + projects;
  quick-switch the focused repo/project from the card header.
- Right card swaps to a detail panel for a PR or deployment (✕ closes,
  pills come back when an agent needs approval or asks a question).
- Merge/approve/rerun and redeploy/promote/cancel from the Mac notch
  (shared ServiceAPI, moved out of the iPhone-only runner).
- Vercel building state and failure reason; PR → preview deployment.
- Claude Code session → branch/PR chip and panel (GitRepoInfo,
  SessionGitHubLinker). Vercel polls only while its pill is active.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The hooks remember the last session on each pill (ClaudeSessionRef);
  a ↰ chip next to the session opens a reply panel in the right card.
- SessionResumer runs `claude -p --resume` in the session's folder,
  shared with the iPhone InstructionRunner (moved out of PhoneLink).
- The island waits to collapse while the reply panel is open, takes key
  focus for the text field, and lets ⌘+arrows move the cursor there.
- GitHub build only (not in the App Store build).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guerraOrzc and others added 7 commits October 6, 2026 22:38
…ashes

The branch and reply chips squeezed the session name to one letter, so
the subtitle (already shown on the pill) is hidden while chips are shown.
Watching a fork and its upstream showed two identical "coucou" chips:
a repo whose name clashes with another watched repo now shows owner/name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `claude -p --resume` run sends Stop and then SessionEnd right away, and
SessionEnd removed the task: the finished card showed "VS Code · Session
finished" instead of the answer. The session goes on in its terminal or
editor, so SessionEnd from a run started here (or ended in the last 5 s)
is ignored. Same for iPhone instructions, which use the same runner.

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>
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>
Kept the reply panel's key-focus subscription next to upstream's new
screen-choice code in IslandWindowController.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant