Repository navigation
Ignore the fields Claude Code ignores on a plugin agent - #421
Merged
Merged
Conversation
Measured on Claude Code 2.1.318 with --plugin-dir, beside a project agent as control: a plugin agent's hooks do not fire, permissionMode does not restrict its tools, a missing description becomes "Agent from <plugin> plugin", and frontmatter that does not parse still loads the agent. The subagent docs state hooks and permissionMode are unsupported on plugin agents for security reasons.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Plugin agents now follow Claude Code's plugin rules in
extensions/subagent/agents.ts. Project and user agents are unchanged. Behavior was measured on Claude Code 2.1.318 with--plugin-dir, with a project agent as control, and the subagent docs state that plugin subagents do not supporthooksorpermissionMode"for security reasons".Security
hooksno longer reach the child (readAgentFile).hooks.PreToolUseinagents/hooky.mdwas passed to the child inPI_CODE_AGENT_HOOKSand ran there. The field is now dropped, andagentHooksEnvreturns{}for that agent. A project agent's hooks still run.Plugin agents that failed or differed
permissionModeis ignored on a plugin agent (readAgentFile).permissionMode: planwith notools:gaveread, grep, find, ls. The agent now has every tool. Behavior change: this widens a plugin agent that setplan.parseAgentFile).name: nodescwith no description was dropped. It now loads with the descriptionAgent from toolkit plugin.readAgentFile).name: [uncloseddropped the file with a warning. It now loads astoolkit:<filename>with every field ignored and no warning. Behavior change:tools:in such a file is not applied, so the agent has every tool.Verification
tsc, knip and vitest with coverage pass on macOS.PreToolUsehook did not fire while a project agent's did, and a plugin agent with unparseable frontmatter loaded and ran.