Skip to content

feat(claude): add extra_args config for upstream CLI flags (#407)#408

Merged
Nathan Schram (nathanschram) merged 1 commit into
devfrom
feature/claude-extra-args
Apr 22, 2026
Merged

feat(claude): add extra_args config for upstream CLI flags (#407)#408
Nathan Schram (nathanschram) merged 1 commit into
devfrom
feature/claude-extra-args

Conversation

@nathanschram
Copy link
Copy Markdown
Member

Summary

Adds [claude] extra_args: list[str] to untether.toml so users can pass upstream claude CLI flags (like --chrome) without forking Untether. Primary motivator: Claude Code 2.1.x gates the mcp__claude-in-chrome__* tool namespace behind --chrome / CLAUDE_CODE_ENABLE_CFC=1, so Untether-spawned sessions never saw those tools. Setting extra_args = ["--chrome"] fixes it end-to-end.

Mirrors codex.extra_args and pi.extra_args.

  • Untether-managed flags (-p, --print, --output-format, --input-format, --resume/-r, --continue/-c, --permission-mode, --permission-prompt-tool) are rejected at config-load with a ConfigError so duplicate-argv surprises fail fast.
  • User args land on argv after the managed stream-json prelude and before resume/model/effort/allowed-tools/permission flags — the trailing -p <prompt> (or stdin prompt under permission-mode) position is never displaced.

Closes #407.

Test plan

  • uv run pytest tests/test_build_args.py tests/test_claude_runner.py tests/test_claude_control.py (216 passed)
  • uv run ruff check src/ + uv run ruff format --check src/ tests/
  • python3 scripts/validate_release.py
  • Empirical verification (Nathan): run claude --chrome -p "list your tools" --output-format stream-json --input-format stream-json --verbose < /dev/null on Mac to confirm --chrome works in stream-json mode before staging. Binary analysis found no stream-json-specific gate on the --chrome code path, but SSH to the Mac can't run it because claude.ai OAuth lives in the login Keychain.
  • After merge + dev install: extra_args = ["--chrome"] in ~/.untether-dev/untether.toml, restart untether-dev, prompt via @untether_dev_bot, confirm mcp__claude-in-chrome__* appears in the tool catalogue.

🤖 Generated with Claude Code

Enables `[claude] extra_args = ["--chrome"]` so Untether-spawned Claude
Code sessions can opt into the Claude-in-Chrome extension — previously
the `mcp__claude-in-chrome__*` tool namespace was absent from Untether
sessions because Claude Code 2.1.x gates it behind `--chrome` /
`CLAUDE_CODE_ENABLE_CFC=1`, and Untether never passed the flag.

Mirrors `codex.extra_args` and `pi.extra_args`. Flags Untether manages
internally (`-p`, `--print`, `--output-format`, `--input-format`,
`--resume`/`-r`, `--continue`/`-c`, `--permission-mode`,
`--permission-prompt-tool`) are rejected at config-load with a
`ConfigError` so duplicate-argv surprises fail fast. User args land on
argv after the managed stream-json prelude and before resume / model /
effort / allowed-tools / permission flags, preserving the trailing
`-p <prompt>` (or stdin prompt under permission-mode) position.

- src/untether/runners/claude.py: add `extra_args` field, thread
  through `build_args`, parse + validate in `build_runner`
- tests/test_build_args.py: +8 tests (argv ordering, permission-mode
  argv, multi-flag order, build_runner parsing, reserved-flag rejection
  for individual flags and `key=value` prefixes)
- docs/reference/config.md, docs/reference/runners/claude/runner.md:
  document the new key, including reserved-flag list
- CHANGELOG.md: v0.35.3 (unreleased) entry

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d909250-e3ad-4b59-8332-0ae08454cdc6

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
  • Commit unit tests in branch feature/claude-extra-args

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.

@nathanschram Nathan Schram (nathanschram) merged commit ca7b1b7 into dev Apr 22, 2026
21 checks passed
@nathanschram Nathan Schram (nathanschram) deleted the feature/claude-extra-args branch April 22, 2026 06:06
Nathan Schram (nathanschram) added a commit that referenced this pull request Apr 22, 2026
pip-audit flagged two new transitive CVEs after PR #408 merged:
- lxml 6.0.2: CVE-2026-41066 (fix 6.1.0) — pulled via sulguk
- python-dotenv 1.2.1: CVE-2026-28684 (fix 1.2.2) — pulled via
  pydantic-settings

Both have clean fixes. Lockfile-only change; pyproject.toml constraints
unchanged. Local pip-audit clean after bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nathan Schram (nathanschram) added a commit that referenced this pull request Apr 22, 2026
* chore: staging 0.35.3rc1

Stage Claude extra_args (#407) for TestPyPI. This rc1 is the wheel the Mac
Untether instance will install to validate Claude-in-Chrome end-to-end per
docs/audits/2026-04-21-claude-in-chrome-test-plan.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* deps: bump lxml 6.0.2→6.1.0 and python-dotenv 1.2.1→1.2.2

pip-audit flagged two new transitive CVEs after PR #408 merged:
- lxml 6.0.2: CVE-2026-41066 (fix 6.1.0) — pulled via sulguk
- python-dotenv 1.2.1: CVE-2026-28684 (fix 1.2.2) — pulled via
  pydantic-settings

Both have clean fixes. Lockfile-only change; pyproject.toml constraints
unchanged. Local pip-audit clean after bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

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.

1 participant