claude-code - 💡(How to fix) Fix Runtime --permission-mode switch (parity with SDK q.setPermissionMode) [3 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The Claude Agent SDK exposes q.setPermissionMode("plan" | "acceptEdits") so a host can toggle permission mode mid-session without restarting query(). The CLI binary accepts --permission-mode only at spawn time.

Root Cause

Without a runtime switch, every CLI-wrapped Kanna chat session that wants to toggle plan mode must either lose state (respawn) or document a UX regression (close + reopen chat).

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Feature request: runtime --permission-mode switch

Context

The Claude Agent SDK exposes q.setPermissionMode("plan" | "acceptEdits") so a host can toggle permission mode mid-session without restarting query(). The CLI binary accepts --permission-mode only at spawn time.

Problem

Hosts that wrap the CLI under a PTY (to preserve subscription billing instead of API billing) cannot mirror SDK parity. When a user toggles plan mode in our UI mid-chat, we either:

  1. Send /permissions — opens the interactive menu, doesn't actually set the mode.
  2. Kill the process and respawn with new --permission-mode — loses the in-flight turn state.

Neither matches the SDK's behavior.

Request

Expose a runtime equivalent. Options:

  • A slash command, e.g. /set-permission-mode plan / /set-permission-mode acceptEdits, that mutates the running session.
  • A control message accepted on stdin (e.g. \x1b[control]set-permission-mode plan\n) parallel to whatever the SDK uses under the hood.
  • A documented signal-based mechanism (e.g. SIGUSR1 rotates through modes).

Any of these would let CLI-wrapping hosts achieve SDK parity for plan-mode toggling.

Why this matters

Without a runtime switch, every CLI-wrapped Kanna chat session that wants to toggle plan mode must either lose state (respawn) or document a UX regression (close + reopen chat).

Repro / context

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING