feat: add Launch Args setting for Claude provider#1971
feat: add Launch Args setting for Claude provider#1971akarabach wants to merge 5 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 introduces a new user-facing feature (Launch Args setting) that propagates configuration to Claude Code sessions at runtime. Additionally, there's an unresolved bug report about a behavioral regression in the CLI argument parser affecting boolean flags before positionals. You can customize Macroscope's approvability policy. Learn more. |
- fix test - add tests for parser
Dismissing prior approval to re-evaluate cfefd47
| * "--chrome --debug" → { chrome: null, debug: null } | ||
| * "--chrome --max-turns 5" → { chrome: null, "max-turns": "5" } | ||
| */ | ||
| export function parseLaunchArgs(args: string): Record<string, string | null> { |
There was a problem hiding this comment.
Pretty sure we already have one of these for git?
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 5533364. Configure here.
| writeGithubOutput = true; | ||
| continue; | ||
| } | ||
| const { flags, positionals } = parseCliArgs(argv); |
There was a problem hiding this comment.
Boolean flag before positional silently consumed as value
Medium Severity
The refactoring of parseArgs to use the generic parseCliArgs introduces a behavioral regression. The old code explicitly knew --github-output was a boolean flag. The new generic parser uses a heuristic where any non--- token after a flag is consumed as that flag's value. So parseArgs(["--github-output", "1.2.3"]) now fails — "1.2.3" is eaten as the value of --github-output, leaving zero positionals and throwing a usage error. The old code returned the correct result. The existing test for "flags before positional" only passes because --github-output is followed by another ---prefixed flag, masking this regression.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5533364. Configure here.


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
Adds a new user-configurable string that is parsed and forwarded as
extraArgsinto the Claude Code runtime startup, which could change session behavior and introduce new failure modes if invalid flags are provided.Overview
Adds a new
providers.claudeAgent.launchArgssetting (defaulting to empty) and exposes it in the web settings UI so users can enter arbitrary Claude Code CLI flags.On the server, the Claude adapter now parses this string into an
extraArgsmap and forwards it to the Claude SDKqueryoptions when starting a session; settings/tests are updated accordingly. Also introduces a sharedparseCliArgsutility (with tests) and reuses it to simplify argument parsing inscripts/update-release-package-versions.ts.Reviewed by Cursor Bugbot for commit 5533364. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Launch Args setting to Claude provider for passing CLI flags to Claude Code
launchArgsstring field toClaudeSettings(defaulting to empty string) in settings.ts, parsed using a newparseCliArgsutility in cliArgs.ts.launchArgsis set.launchArgson session start and injects the resulting flags asextraArgsinto the query options passed to the Claude agent.parseCliArgssupports--flag,--key value, and--key=valuesyntaxes; also used to refactorparseArgsin update-release-package-versions.ts.Macroscope summarized 5533364.