claude://resume import launches the session with hardcoded --permission-mode default / --model default, discarding the stored mode and every config surface

Status Fixed / completed
Reported on v2.1.227
Maintainer reply None cached
Activity 0 comments · opened Aug 12, 2026 · closed Aug 14, 2026

Bug description

Importing a CLI session into the desktop app via the claude://resume?session=<uuid> deep link launches the underlying claude process with --permission-mode default and --model default hardcoded in the process arguments — discarding the session's stored mode, the mode it was spawned with, user-settings permissions.defaultMode, and the per-folder remembered mode-selector pick. The imported session always comes up in manual mode on the default model, with no error or diagnostic.

This is inconsistent with the CLI's own resume path, which does propagate the session's stored mode (see #73574, where that propagation is visible because it breaks on the internal bubble mode). The desktop import path discards what the CLI path preserves.

Steps to reproduce

  1. macOS desktop app, Max plan. User-level ~/.claude/settings.json contains "permissions": {"defaultMode": "auto"}; the folder's remembered selector mode is Auto (new sessions in the folder correctly start in Auto).
  2. In that folder: claude --bg --model claude-opus-5 --permission-mode auto -n probe "print READY and stop"
  3. claude stop <uuid>
  4. open "claude://resume?session=<uuid>"
  5. The imported session opens with full history — in manual mode. Without a model key in workspace settings it also drops to the default model (Opus → Sonnet drift visible across the import boundary in the single transcript's message.model fields).

Evidence

Process args, app-created resumed session vs deep-link-imported session, side by side, same machine and user config:

.../claude.app/Contents/MacOS/claude ... --resume=<app-session-uuid>  ... --permission-mode auto
.../claude.app/Contents/MacOS/claude ... --model default --resume=<imported-uuid> ... --permission-mode default

Root cause (traced in app.asar, same method as #61304's workaround): in importCliSession, the desktop session record is built with permissionMode assigned as a literal Default constant. The adjacent field on the same object literal, chromePermissionMode, does read a preference — so this isn't a missing config surface, it's a field assigned a constant where the app's other launch paths call getDefaultPermissionMode (which resolves folder memory and settings). A second identical hardcode exists at the other CLI-import entry point. Neither bypassPermissionsModeEnabled (the #61304 preference) nor autoModeEnabled can affect it — both feed paths the import never touches; verified empirically as well as by trace (spawn-time flag, folder memory, worktree settings, and user settings all tested against the import: the session comes up manual in every arm).

Ground truth that the mode is real, not a label: the imported session, asked via cross-session message to write a file and run git fetch, executed nothing and left a permission prompt on screen; the identical session pre-import executed expansion-bearing commands unattended.

Related issues

  • #73574 — the CLI resume path passes the stored last-used mode through to --permission-mode (contrast: desktop import discards it)
  • #83051 — desktop import drops the CLI session's customTitle: the same import path discarding another field
  • #61304 (closed) — the flag-overrides-settings mechanism on the new-session path, since fixed there; this is its surviving sibling on the import path

Environment

  • Desktop app: 1.28929.0 (macOS)
  • Claude Code: 2.1.227
  • Plan: Max

Expected behavior

The claude://resume import path resolves --permission-mode and --model the way the app's other session-launch paths do — getDefaultPermissionMode (folder memory, then settings), or the session's own stored mode as the CLI resume path already does — instead of assigning hardcoded defaults.

Why it matters

The deep-link import is the only route by which locally-spawned background sessions gain the app's session surface (visibility in the session list, cross-session messaging). With the mode hardcoded to manual, any workflow built on --bg + import produces sessions that look healthy on every instrument and stall on their first gated command.

View original on GitHub ↗