Skip to content

feat: add Launch Args setting for Claude provider#1971

Merged
juliusmarminge merged 8 commits intopingdotgg:mainfrom
akarabach:feat/claude-chrome-integration
Apr 15, 2026
Merged

feat: add Launch Args setting for Claude provider#1971
juliusmarminge merged 8 commits intopingdotgg:mainfrom
akarabach:feat/claude-chrome-integration

Conversation

@akarabach
Copy link
Copy Markdown
Contributor

@akarabach akarabach commented Apr 12, 2026

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's query() function which never forwarded any of them. The SDK's extraArgs option (Record<string, string | null>) is the only way to pass additional flags.

Design decisions

Generic launchArgs string instead of enableChrome boolean — 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-in parseArgs requires 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 --chrome is boolean while --effort high takes a value. Our 15-line parseLaunchArgs uses the standard heuristic (if the next token doesn't start with --, it's a value) — same approach as minimist. We chose not to add an external dependency for this.

Changes (5 files)

  • packages/contracts/src/settings.ts — added launchArgs: string (default "") to ClaudeSettings schema and ClaudeSettingsPatch
  • apps/server/src/provider/Layers/ClaudeAdapter.ts — added parseLaunchArgs() that converts CLI-style input to the SDK's extraArgs format; wired into queryOptions
  • apps/web/src/components/settings/SettingsPanels.tsx — added Launch arguments text input in the Claude provider details panel
  • apps/server/src/provider/Layers/ClaudeAdapter.test.ts — 12 unit tests for parseLaunchArgs covering real Claude CLI flags (--chrome, --effort high, --model claude-sonnet-4-6, --max-budget-usd 5.00, etc.) and edge cases
  • apps/server/src/serverSettings.test.ts — updated assertions for new field

Screenshots

Screenshot 2026-04-13 at 01 31 49 Screenshot 2026-04-13 at 00 42 40

Settings panel with Launch arguments field

Tested

  • --chrome flag — confirmed Claude session launches with Chrome browser integration
  • --chrome --debug — multiple flags forwarded correctly
  • Clearing the field and starting a new session — no extra args passed
  • Unit tests pass for parseLaunchArgs (12 tests)

Test plan

  • Start T3 Code locally (bun run dev)
  • Open Settings → Claude provider → expand details
  • Verify "Launch arguments" input appears below the binary path field
  • Type --chrome → start a new Claude session → confirm Chrome/browser tools are available
  • Clear the field → start another session → confirm no Chrome tools
  • Fresh install (no existing settings) → confirm launchArgs defaults to empty string

Note

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, ClaudeAdapter now parses this field and forwards the resulting flag map to the Claude SDK via extraArgs when starting a session, enabling arbitrary Claude Code CLI flags.

Introduces a small shared parseCliArgs utility (with tests and package export) and refactors scripts/update-release-package-versions.ts argument 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 launchArgs setting to the Claude provider for passing custom CLI flags

  • Adds launchArgs as a string field (default: empty) to the ClaudeSettings schema in settings.ts, surfaced as a new 'Launch arguments' input in the settings UI.
  • Introduces a parseCliArgs utility in cliArgs.ts that parses CLI-like strings or arrays into flags and positionals, supporting --key value, --key=value, and boolean flag syntax.
  • In ClaudeAdapter.ts, launchArgs is parsed via parseCliArgs and passed as extraArgs in the Claude query options when non-empty.
  • Refactors parseArgs in update-release-package-versions.ts to use the new shared parseCliArgs utility.

Macroscope summarized be6cca1.

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: afa9e952-bedd-4d14-bb0c-3cc191c7050d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 12, 2026
@juliusmarminge
Copy link
Copy Markdown
Member

a setting for launchArgs or something feels more generic?

macroscopeapp[bot]
macroscopeapp bot previously approved these changes Apr 12, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 12, 2026

Approvability

Verdict: 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.

@macroscopeapp macroscopeapp bot dismissed their stale review April 12, 2026 22:32

Dismissing prior approval to re-evaluate cfefd47

@akarabach akarabach changed the title feat: add Enable Chrome setting for Claude provider feat: add Launch Args setting for Claude provider Apr 12, 2026
Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Outdated
@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Apr 13, 2026
Comment thread scripts/update-release-package-versions.ts Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread packages/shared/src/cliArgs.ts
),
);
const claudeBinaryPath = claudeSettings.binaryPath;
const extraArgs = parseCliArgs(claudeSettings.launchArgs).flags;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I enter some invalid value in the input box there's no indication of that and they'll be silently ignored?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but Claude won't be able to start.

Screenshot 2026-04-14 at 01 01 31

Copy link
Copy Markdown
Contributor Author

@akarabach akarabach Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Runtime extraction - run claude --help when 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.

  2. 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
@juliusmarminge juliusmarminge enabled auto-merge (squash) April 15, 2026 21:26
@juliusmarminge juliusmarminge merged commit 5e1dd56 into pingdotgg:main Apr 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants