[BUG] agent field in ~/.claude/settings.json is ignored by sessions dispatched from the agent view

Resolved 💬 1 comment Opened May 28, 2026 by MrGarri Closed Jun 2, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The agent field in ~/.claude/settings.json is honored when claude is invoked directly (interactive or --print), but is ignored by sessions dispatched from the agent view (claude agents). Dispatched sessions fall back to the catch-all claude agent regardless of the configured default.

Other settings.json fields are honored by dispatched sessions (e.g., model, plugins, permissions, effortLevel), so the gap is specific to the agent key.

There's also no --agent flag on claude agents itself (only --model, --effort, --permission-mode, --mcp-config, etc.), so there's no way to set a default agent for the dispatcher at all.

What Should Happen?

Sessions dispatched from claude agents should pick up the agent field from settings.json the same way they pick up model, effortLevel, etc. Equivalently (or additionally), claude agents should accept a --agent <name> flag matching the existing claude --agent flag.

Error Messages/Logs

Steps to Reproduce

  1. Set in ~/.claude/settings.json:

{
"agent": "ABRegistrationAgents-ab-reg-dev",
"model": "global.anthropic.claude-opus-4-7[1m]"
}

  1. (Substitute any custom agent name installed locally; e.g., one of the agents under ~/.claude/agents/.)
  2. Confirm direct invocation honors it:

claude --print "What is your agent name from your system prompt?"

  1. The reply reflects the configured agent's prompt/instructions. ✅
  2. Run claude agents and dispatch a new background session from the agent view (e.g., @<repo> some prompt).
  3. Observe: the dispatched session runs as the catch-all claude agent (its system prompt does not include the configured agent's frontmatter/instructions). The model from settings.json is applied. ❌

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.152.282

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗