Skip to content

Support temporary global custom request headers for Claude Code - #687

Open
andy-xu-db wants to merge 2 commits into
mainfrom
andy/custom-request-headers-claude
Open

andy-xu-db wants to merge 2 commits into
mainfrom
andy/custom-request-headers-claude

Conversation

@andy-xu-db

@andy-xu-db andy-xu-db commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


Summary

  • add repeatable ug claude --header "Name: value" support
  • reuse the existing private and OS-managed settings reconciliation required by Claude precedence
  • reject protected headers and collisions with existing user or admin headers
  • record exact temporary values in the existing global state and remove only those values on the next header-free launch or configuration
  • document that the setting applies globally to active Claude sessions until it is cleared

Stack

Stacked on #610, which contains the shared parser and launch plumbing. Merge #610 first.

Testing

  • uv run pytest -q tests/test_state.py tests/test_agent_claude.py tests/test_cli.py tests/test_agent_codex.py tests/test_codex_smart_routing_v2.py (734 passed)
  • full suite passes with tests/test_e2e_user_agent.py excluded; its installed Claude 2.1.273 rejects the synthetic test model before making a request
  • uv run ruff check src tests
  • uv run ruff format --check src tests
  • git diff --check

@andy-xu-db
andy-xu-db changed the base branch from andy/custom-request-headers to main September 16, 2026 20:14
@andy-xu-db
andy-xu-db force-pushed the andy/custom-request-headers-claude branch from c85880d to c65f808 Compare September 16, 2026 20:42
@andy-xu-db andy-xu-db changed the title Support temporary custom request headers for Claude Code Support temporary global custom request headers for Claude Code Sep 16, 2026
@andy-xu-db
andy-xu-db force-pushed the andy/custom-request-headers-claude branch from c65f808 to b2ce76d Compare September 16, 2026 20:43
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