Skip to content

feat(claude_code): per-agent reasoning effort via claudeConfig#283

Open
vprudnikoff wants to merge 1 commit into
awslabs:mainfrom
vprudnikoff:feat/claude-config
Open

feat(claude_code): per-agent reasoning effort via claudeConfig#283
vprudnikoff wants to merge 1 commit into
awslabs:mainfrom
vprudnikoff:feat/claude-config

Conversation

@vprudnikoff

Copy link
Copy Markdown

What

Adds a claudeConfig field to the agent profile, the Claude Code analog of codexConfig (PR #278) for the codex provider. The claude_code provider maps it to Claude Code CLI flags at launch:

claudeConfig key Claude Code flag
effort --effort <level>
fallback_model --fallback-model <model>

The top-level model field still maps to --model (unchanged), mirroring how codex keeps model separate from codexConfig.

Why

Today the only lever for a claude_code agent's reasoning effort is the machine-global effortLevel in ~/.claude/settings.json (or the CLAUDE_CODE_EFFORT_LEVEL env var, which the provider already preserves). That silently differs between machines: an orchestrator profile meant to run at xhigh falls back to the Claude Code default (high) on any host where the global setting is absent. codexConfig already solves the equivalent problem per-agent for codex; this brings parity to claude_code.

Example

name: cto
provider: claude_code
claudeConfig:
  effort: xhigh

Tests

test/providers/test_claude_code_unit.py::TestClaudeCodeProviderClaudeConfig: effort flag emitted when set, fallback-model emitted when set, no flag when claudeConfig is absent. Docs updated in docs/agent-profile.md.

Add a `claudeConfig` field to the agent profile, the Claude Code analog of
`codexConfig` for the codex provider. The claude_code provider maps it to
Claude Code CLI flags at launch:

  - effort         -> --effort <level>
  - fallback_model -> --fallback-model <model>

This lets a profile set per-agent reasoning effort (e.g. an orchestrator at
xhigh) without relying on the machine-global `effortLevel` in
~/.claude/settings.json, which silently differs between machines. The
top-level `model` field still maps to `--model`.
@codecov-commenter

codecov-commenter commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@1224cd0). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #283   +/-   ##
=======================================
  Coverage        ?   92.15%           
=======================================
  Files           ?       70           
  Lines           ?     7115           
  Branches        ?        0           
=======================================
  Hits            ?     6557           
  Misses          ?      558           
  Partials        ?        0           
Flag Coverage Δ
unittests 92.15% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds per-agent Claude Code launch overrides by introducing a claudeConfig map on AgentProfile, and mapping selected keys to Claude Code CLI flags when building the claude command. This brings profile-level control over reasoning effort / fallback model without relying on machine-global ~/.claude/settings.json settings.

Changes:

  • Add claudeConfig to AgentProfile and document it in docs/agent-profile.md.
  • Update ClaudeCodeProvider._build_claude_command() to emit --effort and --fallback-model when profile.claudeConfig is set.
  • Add unit tests ensuring the flags are emitted/omitted as expected.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/cli_agent_orchestrator/providers/claude_code.py Map profile.claudeConfig entries to claude CLI flags during command construction.
src/cli_agent_orchestrator/models/agent_profile.py Extend the agent profile schema with the new optional claudeConfig field.
test/providers/test_claude_code_unit.py Add unit tests covering claudeConfig → CLI flag behavior.
docs/agent-profile.md Document the new claudeConfig profile field and its flag mappings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +123 to +128
# Apply Claude Code-only per-agent knobs from claudeConfig:
# effort -> --effort <level>
# fallback_model -> --fallback-model <model>
# Claude analog of codexConfig: per-agent reasoning effort without
# depending on the machine-global effortLevel in
# ~/.claude/settings.json.
Comment on lines +55 to +61
# Claude Code-only. Per-agent Claude Code knobs mapped to CLI flags at
# launch: {"effort": "<low|medium|high|xhigh>"} -> `--effort <level>` and
# {"fallback_model": "<model>"} -> `--fallback-model <model>`. Lets a
# profile set per-agent reasoning effort without relying on the
# machine-global `effortLevel` in ~/.claude/settings.json. This is the
# Claude analog of codexConfig for the codex provider; the top-level
# `model` field still maps to `--model`.
Comment thread docs/agent-profile.md
- `model` (string): AI model to use
- `permissionMode` (string, `claude_code` only): One of `"default"`, `"acceptEdits"`, `"plan"`, `"auto"`, `"bypassPermissions"`. When set, the `claude_code` provider passes `--permission-mode <value>` instead of `--dangerously-skip-permissions`. `cao launch --yolo` overrides this and forces bypass. See [Claude Code permission modes](https://code.claude.com/docs/en/permission-modes).
- `native_agent` (string, `claude_code` only): Name of a native Claude Code agent (`~/.claude/agents/`). When set, the provider passes `--agent <name>` directly and skips system prompt / MCP config decomposition (thin-wrapper mode). See [Claude Code native agent routing](claude-code.md#native-agent-routing).
- `claudeConfig` (object, `claude_code` only): Per-agent Claude Code knobs mapped to CLI flags at launch. `{"effort": "<low|medium|high|xhigh>"}` adds `--effort <level>` and `{"fallback_model": "<model>"}` adds `--fallback-model <model>`. Lets a profile set per-agent reasoning effort without relying on the machine-global `effortLevel` in `~/.claude/settings.json`. The Claude analog of `codexConfig`; the top-level `model` field still maps to `--model`.
@haofeif haofeif added the enhancement New feature or request label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants