claude-md-optimizer
AgentUse this agent when the user wants to autonomously validate and optimize their CLAUDE.md files. This agent runs claudelint…
Hook configuration in agents.json violates schema requirements
Claude Code
> /plugin marketplace add pdugan20/claudelint> /plugin install claudelint@claudelint
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
description: "Hook configuration in agents.json violates schema requirements"
<RuleHeader description="Hook configuration in agents.json violates schema requirements" severity="error" :fixable="false" :configurable="false" category="Agents" />
This rule checks that hooks declared in agents.json have the correct structure and all required fields. Hook objects must include valid event names (e.g., PreToolUse, PostToolUse, SessionStart, TaskCompleted) and properly structured matchers. Validation is performed by AgentsValidator.validateFrontmatter() using the shared validateSettingsHooks() utility. Invalid hook schemas cause runtime failures when the agent framework attempts to register event handlers.
Hook with missing required command field
{
"hooks": {
"PreToolUse": [
{ "matcher": "Bash" }
]
}
}Hook with invalid event name
{
"hooks": {
"OnStart": [
{ "matcher": ".*", "command": "echo hi" }
]
}
}Properly structured hook with all required fields
{
"hooks": {
"PreToolUse": [
{ "matcher": "Bash", "command": "echo pre-check" }
]
}
}Ensure each hook entry has a valid event name key (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, UserPromptSubmit, Notification, Stop, SubagentStart, SubagentStop, PreCompact, SessionStart, SessionEnd, TeammateIdle, or TaskCompleted) and that each matcher object includes the required fields.
This rule does not have any configuration options.
Available since: v0.2.0
A linter for Claude Code projects. Validates CLAUDE.md files, skills, settings, hooks, MCP servers, plugins, and more.
Use this agent when the user wants to autonomously validate and optimize their CLAUDE.md files. This agent runs claudelint…
Agent body content should meet minimum length requirements
Agent disallowedTools must be an array of tool names
Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…