Skip to content

fix: detect Claude in Chrome permission prompts as waiting_input - #322

Merged
kbwo merged 2 commits into
mainfrom
feature/chrome-extension-prompts
Aug 10, 2026
Merged

kbwo merged 2 commits into
mainfrom
feature/chrome-extension-prompts

Conversation

@kbwo

@kbwo kbwo commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Problem

Claude Code shows browser-extension permission prompts (e.g. "Claude in Chrome wants to create a browser window and read your tabs") as a numbered Allow/Deny menu:

 Claude in Chrome wants to navigate on example.com

 https://example.com/app

 ❯ 1. Allow
   2. Allow all actions on example.com for this session
   3. Deny (esc)

These prompts contain none of the markers the Claude state detector currently keys on — no "Do you want" / "Would you like" phrasing and no "esc to cancel" footer — so ccmanager reports the session as idle while it is actually blocked waiting for the user to answer. The user gets no waiting-input indication (status icon, notification hooks) for these prompts.

The fix detects the numbered N. Deny (esc) option line, which is present in both the 2-option (Allow / Deny) and 3-option (Allow / Allow all actions / Deny) variants, and classifies it as waiting_input. The "wants to ..." sentence itself is deliberately not used as a marker because that phrase commonly appears in ordinary assistant prose and would cause false positives.

Verification

Prerequisites:

  • bun install from repo root.

Steps:

  • bun run test src/services/stateDetector/claude.test.ts — 77 tests pass, including two new cases that reproduce the 2-option and 3-option permission prompts verbatim and assert waiting_input.
  • bun run lint, bun run typecheck, and full bun run test (1790 passed / 10 skipped) succeed on the branch.
  • Manual check: inside a ccmanager session, trigger a Claude in Chrome permission prompt (e.g. ask Claude Code to open a page with the Chrome extension enabled) and confirm the session status changes to the waiting-input state instead of idle while the Allow/Deny menu is displayed.

🤖 Generated with Claude Code

kbwo and others added 2 commits August 10, 2026 12:26
Permission prompts like "Claude in Chrome wants to navigate on ..." use a
numbered Allow/Deny menu without "Do you want" / "esc to cancel" phrasing,
so the Claude state detector treated them as idle. Detect the numbered
"Deny (esc)" option line as a waiting_input marker.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
package.json already declares @kodaikabasawa/ccmanager-* 4.2.2 but the
lockfile still pinned 4.2.1; bun install regenerated the entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kbwo
kbwo marked this pull request as ready for review August 10, 2026 13:38
@kbwo
kbwo merged commit 7b55c65 into main Aug 10, 2026
1 check passed
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