feat: add Launch Args setting for Claude provider#1971
feat: add Launch Args setting for Claude provider#1971juliusmarminge merged 8 commits intopingdotgg:mainfrom
Conversation
Claude Code supports a --chrome flag to launch with Chrome browser integration, but the SDK query path used by T3 Code never passed it. Add an `enableChrome` boolean to Claude provider settings (default off) and forward it via the SDK's `extraArgs` option when enabled.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
a setting for |
ApprovabilityVerdict: Needs human review This PR adds a new user-facing feature allowing users to configure launch arguments for the Claude provider. New features introducing new capabilities warrant human review. Additionally, there's an unresolved review comment about lack of validation feedback for invalid input values. You can customize Macroscope's approvability policy. Learn more. |
- fix test - add tests for parser
Dismissing prior approval to re-evaluate cfefd47
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 459c130. Configure here.
| ), | ||
| ); | ||
| const claudeBinaryPath = claudeSettings.binaryPath; | ||
| const extraArgs = parseCliArgs(claudeSettings.launchArgs).flags; |
There was a problem hiding this comment.
if I enter some invalid value in the input box there's no indication of that and they'll be silently ignored?
There was a problem hiding this comment.
I considered a few approaches for validating the launch args input and decided to keep it as a plain text field without validation. Here's the reasoning:
-
Runtime extraction - run
claude --helpwhen the user opens settings, parse the output to get valid flags, validate against them. Problems: --help output is unstructured text (no --json option), parsing is fragile across CLI versions, and we'd need to filter out flags the SDK already handles (--model, --effort, --resume, etc.) to avoid conflicts. -
Hardcoded flag list - maintain a static list of valid Claude CLI flags. Problems: Claude CLI updates frequently, the list would go stale fast, and false negatives on new valid flags would be worse than no validation.
Co-authored-by: codex <codex@users.noreply.github.com> # Conflicts: # packages/shared/package.json


What changed
Added a generic Launch arguments text field to the Claude provider settings. Users can pass any CLI flags (e.g.
--chrome,--effort high,--debug) that get forwarded to the Claude Code process on session start.This addresses the original need (Chrome browser integration) while being generic enough to support any future CLI flag without further code changes.
Why
Claude Code supports many CLI flags (see
claude --help), but T3 Code uses@anthropic-ai/claude-agent-sdk'squery()function which never forwarded any of them. The SDK'sextraArgsoption (Record<string, string | null>) is the only way to pass additional flags.Design decisions
Generic
launchArgsstring instead ofenableChromeboolean — per review feedback from @juliusmarminge, a generic field is more future-proof than a Chrome-specific toggle.Custom parser instead of
node:util.parseArgs— Node's built-inparseArgsrequires explicit type definitions for each flag to distinguish boolean flags from value-taking flags. Since we accept arbitrary user-provided flags, it can't determine that--chromeis boolean while--effort hightakes a value. Our 15-lineparseLaunchArgsuses the standard heuristic (if the next token doesn't start with--, it's a value) — same approach asminimist. We chose not to add an external dependency for this.Changes (5 files)
packages/contracts/src/settings.ts— addedlaunchArgs: string(default"") toClaudeSettingsschema andClaudeSettingsPatchapps/server/src/provider/Layers/ClaudeAdapter.ts— addedparseLaunchArgs()that converts CLI-style input to the SDK'sextraArgsformat; wired intoqueryOptionsapps/web/src/components/settings/SettingsPanels.tsx— added Launch arguments text input in the Claude provider details panelapps/server/src/provider/Layers/ClaudeAdapter.test.ts— 12 unit tests forparseLaunchArgscovering real Claude CLI flags (--chrome,--effort high,--model claude-sonnet-4-6,--max-budget-usd 5.00, etc.) and edge casesapps/server/src/serverSettings.test.ts— updated assertions for new fieldScreenshots
Settings panel with Launch arguments field
Tested
--chromeflag — confirmed Claude session launches with Chrome browser integration--chrome --debug— multiple flags forwarded correctlyparseLaunchArgs(12 tests)Test plan
bun run dev)--chrome→ start a new Claude session → confirm Chrome/browser tools are availablelaunchArgsdefaults to empty stringNote
Medium Risk
Changes how Claude sessions are launched by allowing arbitrary user-supplied CLI flags to be passed through, which could affect runtime behavior if misconfigured. Additional changes touch only settings defaults/tests and a release automation script.
Overview
Adds a new Claude provider setting,
launchArgs, exposed in the web Settings panel and defaulted in server/client settings schemas/tests.On the server,
ClaudeAdapternow parses this field and forwards the resulting flag map to the Claude SDK viaextraArgswhen starting a session, enabling arbitrary Claude Code CLI flags.Introduces a small shared
parseCliArgsutility (with tests and package export) and refactorsscripts/update-release-package-versions.tsargument parsing to use it, fixing boolean-flag handling and adding coverage.Reviewed by Cursor Bugbot for commit be6cca1. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
launchArgssetting to the Claude provider for passing custom CLI flagslaunchArgsas a string field (default: empty) to theClaudeSettingsschema in settings.ts, surfaced as a new 'Launch arguments' input in the settings UI.parseCliArgsutility in cliArgs.ts that parses CLI-like strings or arrays into flags and positionals, supporting--key value,--key=value, and boolean flag syntax.launchArgsis parsed viaparseCliArgsand passed asextraArgsin the Claude query options when non-empty.parseArgsin update-release-package-versions.ts to use the new sharedparseCliArgsutility.Macroscope summarized be6cca1.