Skip to content

Add auto-enable Claude Code remote control setting#163

Merged
dhilgaertner merged 2 commits intomainfrom
feature/crow-157-auto-remote-control
Apr 14, 2026
Merged

Add auto-enable Claude Code remote control setting#163
dhilgaertner merged 2 commits intomainfrom
feature/crow-157-auto-remote-control

Conversation

@dhilgaertner
Copy link
Copy Markdown
Contributor

Summary

  • New Settings > General > Remote Control toggle (default off). When on, every Claude Code session Crow starts is launched with --rc --name '<session.name>', so it shows up in claude.ai's Remote Control panel under the same name as the Crow session (Manager tab appears as Manager).
  • Applies uniformly to three launch paths: worker auto-launch on restore (SessionService.launchClaude), the Manager terminal (ensureManagerSession), and crow-CLI-spawned terminals (AppDelegate.resolveClaudeInCommand via the new-terminal RPC).
  • New antenna badge on the sidebar row, Manager button, and session header marks sessions whose Claude was actually launched with --rc, so toggling the setting mid-session doesn't falsely flag older sessions.

Implementation notes

  • Config field is top-level (AppConfig.remoteControlEnabled), matching the notifications / sidebar shape. Decodes with decodeIfPresent for forward-compat — older config.json files continue to work.
  • Launch-arg building is centralized in a new CrowCore/ClaudeLaunchArgs helper (POSIX-quoted --name), used by both SessionService and resolveClaudeInCommand. resolveClaudeInCommand also guards against double-injection if the command already contains --rc / --remote-control.
  • AppState.remoteControlEnabled is hydrated at launch (before ensureManagerSession) and kept in sync in saveSettings, so the toggle takes effect without an app restart.

Closes #157

Test plan

  • make build succeeds
  • make test — CrowCore (incl. 5 new ClaudeLaunchArgs tests + appConfigRemoteControlRoundTrip) and CrowPersistence (incl. configStoreForwardCompatDefaultsRemoteControlOff) pass
  • Manual: toggle on in Settings; create a new worker session via /crow-workspace; confirm the terminal's first line shows claude --rc --name '<session>' --continue (or the initial prompt) and the antenna badge appears in the sidebar + header
  • Manual: restart Crow; confirm restored worker sessions re-launch with --rc --name '<session>' and Manager tab launches with --rc --name 'Manager'
  • Manual: open claude.ai → Remote Control and verify each Crow session shows up with its Crow session name
  • Manual: toggle off; start a new session; confirm no --rc, no badge

🤖 Generated with Claude Code

@dhilgaertner dhilgaertner requested a review from dgershman as a code owner April 14, 2026 05:21
Adds a Settings > General toggle that launches new Claude Code sessions
with `--rc --name '<session.name>'` so they appear in claude.ai's Remote
Control panel under the matching Crow session name (Manager tab shows as
"Manager"). Applies to worker auto-launch, the Manager terminal, and
crow-CLI-spawned terminals. A small antenna badge marks sessions whose
Claude was launched with RC active.

Closes #157

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dhilgaertner dhilgaertner force-pushed the feature/crow-157-auto-remote-control branch from c81f76d to b297c38 Compare April 14, 2026 05:23
The Manager terminal is persisted and its `command` is executed directly
by the shell, so the stored string must reflect the current RC setting
before `preInitialize` runs. Rebuilds the Manager terminal's command in
`hydrateState` from `appState.remoteControlEnabled` (moved to be set
before hydrate) so toggling the preference — or installing this change
on top of a pre-existing Manager — takes effect on next launch and the
badge is surfaced.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dhilgaertner dhilgaertner merged commit fb2de98 into main Apr 14, 2026
1 check passed
@dhilgaertner dhilgaertner deleted the feature/crow-157-auto-remote-control branch April 14, 2026 05:28
dhilgaertner added a commit that referenced this pull request Apr 15, 2026
## Summary

- `/crow-workspace` and `/crow-batch-workspace` now launch Claude Code
with `--rc --name '<session-name>'` whenever the global **Settings →
Remote Control** is on, closing the gap left by #163 which only wired RC
into app-initiated launches.
- Adds two small helpers to `skills/crow-workspace/setup.sh`:
`posix_quote` (mirrors Swift's `ClaudeLaunchArgs.shellQuote`
byte-for-byte — including the `'\''` apostrophe escape) and
`is_remote_control_enabled` (reads `{devRoot}/.claude/config.json`;
missing file / absent key / malformed JSON all default to off, matching
`AppConfig.decodeIfPresent`).
- No Swift/app changes needed. `/crow-batch-workspace` inherits the fix
automatically since it delegates to this script.

Closes #164

## Test plan

- [x] Unit-verified `posix_quote` output matches `ClaudeLaunchArgsTests`
(`Manager` → `'Manager'`; `Bob's session` → `'Bob'\''s session'`).
- [x] Unit-verified `is_remote_control_enabled` across six config
states: key=true, key=false, key absent, file missing,
pretty-printed+true, malformed.
- [x] `bash -n` syntax check.
- [ ] Manual: with **Remote Control off**, run `/crow-workspace` on a
test ticket and confirm the launched command is `claude
--permission-mode plan "$(cat …)"` (no `--rc`).
- [ ] Manual: with **Remote Control on**, run `/crow-workspace` on a
test ticket and confirm the command includes `--rc --name
'<session-name>'` and the session appears in Claude.ai's Remote Control
panel with the antenna badge.
- [ ] Manual: `/crow-batch-workspace` with two tickets while RC is on —
both terminals launch with `--rc --name '…'`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Dustin Hilgaertner <dustinhilgaertner@Dustins-Mac-mini.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dhilgaertner added a commit that referenced this pull request Apr 22, 2026
## Summary

- Adds a `managerAutoPermissionMode` setting (default `true`) that
passes `--permission-mode auto` to the Manager's `claude` launch,
eliminating per-call approval prompts for the `crow`, `gh`, and `git`
commands the Manager runs to orchestrate workspaces.
- Exposes a Settings → General → **Manager Terminal** toggle so users on
plans or providers where auto mode is unavailable (Pro plan,
Bedrock/Vertex/Foundry, Claude Code < 2.1.83) can opt out.
- Scope is Manager-only — worker sessions and `crow
new-terminal`–spawned terminals keep the default permission mode.

Implementation mirrors the existing `remoteControlEnabled` plumbing
added in #163: field on `AppConfig` → mirror on `AppState` → new
optional parameter on `ClaudeLaunchArgs.argsSuffix(...)` → wired into
both Manager launch paths in `SessionService` (first-time creation and
hydration rebuild).

Closes #187.

## Test plan

- [x] `make build` — clean build.
- [x] `swift test --package-path Packages/CrowCore` — 112 tests pass (3
new `ClaudeLaunchArgs` cases, 2 new `AppConfig` cases including
forward-compat default).
- [x] `swift test --package-path Packages/CrowPersistence` — 7 tests
pass (new `ConfigStore` round-trip for the new field, plus the
forward-compat test extended to assert legacy configs default to
`true`).
- [x] Fresh launch with no `.claude/config.json` key — confirm Manager's
`ps` argv contains `--permission-mode auto`.
- [x] Toggle off in Settings → relaunch → confirm flag is gone from
Manager argv and running `gh issue view …` now prompts for approval.
- [x] Toggle back on → relaunch → confirm flag returns and the same `gh`
call runs without a prompt.
- [x] Confirm worker sessions and CLI-spawned terminals do **not**
include `--permission-mode auto`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Add setting to auto-enable Claude Code remote control for new sessions

1 participant