[BUG] Parameter-based permission rules not working on Agent tool
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?
I have the following snippet in my Claude Code configuration:
{
"permissions": {
"deny" : [
"Agent(run_in_background:true)"
]
}
}
The goal is to block background subagents, since I run Claude Code with a local backend that works pretty poorly with background agents.
Despite this setting, Claude still launches subagents in the background.
What Should Happen?
Any attempt to launch a sub agent in the background gets a "Tool use denied" error. All agents that actually start do so in foreground mode.
Error Messages/Logs
Steps to Reproduce
- Put the snippet above in your Claude Code settings
- Ask Claude to start sub-agents
- The sub-agents have the "Backgrounded agent" mention and the main agent resumes before the sub-agents are done
This happens especially often in Plan mode
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.202
Platform
Other
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
Running Claude Code CLI with Ollama backend (ollama launch claude). The AI model I'm using is Qwen 3.6. Note this is not an issue with Ollama since Ollama delegates everything to the official Claude Code executable (including auto-updates).