[BUG] Race condition in plugin agent setting resolution

Resolved 💬 2 comments Opened Apr 14, 2026 by pqienso Closed May 24, 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?

There's a race condition in the Claude Code startup sequence: when a plugin provides an agent setting via its settings.json, the setting is silently dropped because the merged settings cache is primed before plugin loading completes.

What Should Happen?

Agent resolution should be deferred after plugin loading completes. This will then allow the agent: setting in the plugin's settings.json to be merged properly.

Error Messages/Logs

Steps to Reproduce

  1. Create a plugin which includes an agent. Create settings.json with {"agent": "[plugin_name]:[agent_name]"} at the plugin root.
  2. Install plugin with local scope in a directory.
  3. Run claude in that directory.
  4. The agent fails to load as the main agent in the session.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.87

Claude Code Version

2.1.105

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗