Repository navigation
Description
Background
The Claude Code agent (responses_api_agents/claude_code_agent/) currently invokes the claude CLI with a hardcoded --bare flag, which "skips auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md so each scripted call starts clean and fast." Combined with a fresh, per-invocation CLAUDE_CONFIG_DIR (a UUID directory created and rmtree'd on every call) and IS_SANDBOX=1, the agent guarantees that a rollout depends only on the model, the task input, and the explicit config — nothing about the host machine.
This isolation-by-default is the correct default for an eval/benchmark harness: it makes reproducibility a controlled variable instead of measuring "the model + whatever happens to be on this developer's laptop" (notably, the Gym repo itself contains a root .claude/skills/ for docs authoring that would otherwise leak into unrelated evals).
The problem is not the default — it is that --bare is all-or-nothing and hardcoded, with no config seam. To enable skills, MCP servers, or hooks today, you must edit app.py's _run_claude_code command list and rework the CLAUDE_CONFIG_DIR lifecycle. This contradicts Gym's "everything composable via Hydra config" philosophy, and it directly blocks #1256 (agent skill evaluation), whose "out of scope: modifying existing agent code" premise cannot hold while skill loading requires an agent-code edit.
Description
Make the Claude Code agent's runtime capabilities configurable instead of hardcoded. Expose the isolation level as a knob (default preserves today's clean/reproducible behavior) plus explicit opt-ins for MCP servers and custom settings, and refactor command/config-dir construction into testable helpers.
A note on --bare granularity: Claude Code's --bare is all-or-nothing for auto-discovery (skills, hooks, plugins, MCP, auto memory, CLAUDE.md), whereas --mcp-config and settings are explicit and apply independently. So the honest, minimal API is three knobs — bare, mcp_config, settings — rather than a separate flag per discoverable feature. Skills/hooks/plugins/memory are enabled together by setting bare: false.
This is a contained, independently valuable change: it unblocks MCP and settings customization in addition to skills, and it converts #1256's agent-half from "fork the agent" into "set config."
Design
Config
Add fields to ClaudeCodeAgentConfig:
claude_code_agent:
responses_api_agents:
claude_code_agent:
entrypoint: app.py
# ... existing fields ...
bare: true # default: pass --bare; skip auto-discovery (skills/hooks/plugins/MCP/memory/CLAUDE.md)
mcp_config: null # path to an MCP server config file, passed to --mcp-config (explicit; works even with bare: true)
settings: null # path to a settings JSON layered into the per-run CLAUDE_CONFIG_DIR/settings.jsonbaredefaults totrue, so behavior is byte-for-byte identical to today.mcp_configandsettingsare explicit and apply regardless ofbare(they are not auto-discovery).- Set
bare: falseto let Claude Code discover skills/hooks/plugins/memory/CLAUDE.md fromCLAUDE_CONFIG_DIRand the working directory. - Defaults are chosen so existing configs and rollouts are unaffected.
Command construction
Extract a testable _build_command(model, instruction, system_prompt) that builds the claude argv from config:
- Append
--bareonly whenconfig.bareistrue. - Append
--mcp-config <path>whenmcp_configis set (independent of--bare). - Keep
--dangerously-skip-permissions,IS_SANDBOX=1, and the per-model env wiring unchanged.
See the Claude Code CLI reference for exact flag names; the agent passes through what the installed CLI version supports.
Settings + CLAUDE_CONFIG_DIR
Extract _build_settings() and _setup_config_dir():
_build_settings()starts from the telemetry-disabling defaults; whensettingsis set, its JSON is layered on top (top-level keys override,envshallow-merged so telemetry stays off unless explicitly overridden)._setup_config_dir()creates the fresh per-call dir and stagessettings.json. The dir is still created per request andrmtree'd afterward — it is already valid for the full duration of a run and keeps opted-in content from leaking between rollouts. This is the staging seam feat: agent skill evaluation infrastructure #1256 reuses to place skills underCLAUDE_CONFIG_DIR/skills/.
Scope boundary with #1256
- This issue owns the agent mechanism: the
bareknob, the_build_command/_build_settings/_setup_config_dirseams, and explicit MCP/settings opt-ins. - feat: agent skill evaluation infrastructure #1256 owns skills as an evaluation variable:
nemo_gym/skills.py(load_skill_directory),skills_reftagging inrollout_collection.py, the top-levelskills.pathconfig, and the skills-specific staging onto the now-configurable agent.
Out of Scope
- Skills loading,
skills_reftagging, or skills metrics — owned by feat: agent skill evaluation infrastructure #1256. - Training / token-ID / logprob wiring for the Claude Code agent (tracked separately).
- Routing capability opt-ins through Gym's model server.
- A general capability framework for non-Claude-Code agents.
Acceptance Criteria
ClaudeCodeAgentConfigexposesbare(defaulttrue),mcp_config, andsettings.- With default config, the emitted
claudecommand andCLAUDE_CONFIG_DIRbehavior are unchanged from today (verified by test), preserving reproducibility for existing evals. - Setting
mcp_configpasses--mcp-config(and coexists with--bare); settingbare: falsedrops--bare. settingsis layered into the per-runCLAUDE_CONFIG_DIR/settings.jsonwith telemetry defaults preserved unless overridden.- Enabling a capability via config requires no edits to
app.py. - Tests cover the default (
bare: true) command, an opted-in path, and the settings merge. - README documents the new config fields and the reproducibility trade-off of disabling
bare.
Relationship to #1256
- Related to feat: agent skill evaluation infrastructure #1256 (agent skill evaluation infrastructure), and a preferred prerequisite for its agent-half. Skills loading is do-able by editing the agent directly, but we'd rather keep the agent a config-driven constant — this issue adds the
CLAUDE_CONFIG_DIRstaging seam that feat: agent skill evaluation infrastructure #1256 can reuse instead.
Activity
feat: make claude code agent runtime capabilities configurable (#1603)
feat: make claude code agent runtime capabilities configurable (#1603)