Skip to main content
Category
Agent
Severity
CLAUDE:G:0001

Hook Uses Project Dir Variable

Hook shell commands SHOULD reference $CLAUDE_PROJECT_DIR or $CLAUDE_ENV_FILE instead of hardcoded absolute paths. Claude Code injects these environment variables at runtime — using them makes hooks portable across machines and collaborators.

Mediumclaudegovernance
CLAUDE:S:0010

Import Depth Within Limit

Claude Code's CLAUDE.md @import chains have a documented hard limit of 5 hops. Imports beyond depth 5 are not resolved — content past the cutoff is silently dropped. This stub supersedes the more permissive CORE ceiling with Claude's actual documented threshold so the agent-specific cap is enforced when the project is scanned with --agent claude or when Claude is auto-detected.

Mediumclaudestructure
CLAUDE:S:0011

Memory File Within Size Limit

MEMORY.md should stay under the host agent's memory truncation threshold. Claude Code loads only the first 200 lines or 25KB of MEMORY.md (whichever comes first); content past either cutoff is silently dropped from the agent's context. Other agents that adopt a memory surface may set different caps. Keep the index concise — store detail in linked memory files, not inline.

Mediumclaudestructure
CLAUDE:S:0012

Path Scope Declared

Claude Code path-scoped rules must declare a paths frontmatter key. The code reads frontmatter.paths internally — the globs key is not read and rules using it silently load without path scoping. Only paths is processed; other frontmatter keys are silently ignored.

Mediumclaudestructure
CLAUDE:S:0009

Rule File Length Limit

Keep .claude/rules/*.md files under 200 lines. This is best-practice guidance rather than a documented Claude Code limit — Claude Code does not truncate rule files at any length. The 200-line ceiling is a soft cap that works in concert with the topic-focus rules: when a rule file follows CORE:C:0044 topic-scatter (one or two topics per file) and CORE:S:0019 single-topic-per-section (each topic in its own section), 200 lines is comfortably enough to cover that scope with concrete examples and constraints. Files that exceed the cap usually betray topic fragmentation, redundant restatement, or examples that belong in referenced project files rather than inline. Long rule files also compete for attention with other context — every line is loaded into the agent's context window at session start, so density wins over breadth.

Lowclaudestructure
CLAUDE:S:0004

Hook Command Has Field

Hook handlers with "type": "command" MUST include a "command" field containing the shell command to execute. Without it, Claude Code has no command to run and the hook fails silently.

Highclaudestructure
CLAUDE:S:0006

Hook Handler Has Type

Each hook handler object in .claude/settings.json MUST contain a "type" field set to "command", "http", "mcp_tool", "prompt", or "agent". Without a type field, Claude Code cannot dispatch the handler and the hook silently does nothing.

Highclaudestructure
CLAUDE:S:0007

Hook Prompt Has Field

Hook handlers with "type": "prompt" or "type": "agent" MUST include a "prompt" field containing the instruction text. Without it, Claude Code has no prompt to inject and the hook does nothing.

Highclaudestructure
CLAUDE:S:0005

Hook Valid Event Types

Hook event keys in .claude/settings.json MUST use recognized Claude Code event type names (29 events as of 2026-04-29). Unrecognized event names are silently ignored, so a typo like "PreTooluse" (lowercase u) means the hook never fires.

Highclaudestructure