Access official Claude Code documentation including comprehensive guides on hooks, MCP servers, agent skills, slash commands, settings, CLI reference, security, memory, plugins, and troubleshooting...
CLAUDE_CODE_GUIDE_AGENT: claude-code-guideBefore making any Claude Code changes, always consult the $CLAUDE_CODE_GUIDE_AGENT subagent for up-to-date information.
Use this skill as the opinionated layer on top of the Guide:
Open the smallest reference file that matches the task:
references/prompt-design.md for system prompts, slash commands, agent prompts, hook suggestions, and long-context prompt structurereferences/skill-authoring.md for SKILL.md structure, descriptions, trigger design, examples, and progressive disclosurereferences/subagent-design.md for agent descriptions, tool scoping, isolation, effort, and parallelisationreferences/plugin-bootstrapping.md for SessionStart dependency installation into ${CLAUDE_PLUGIN_DATA}Claude 4.6 is more responsive than older models. Default to calm, specific instructions:
When writing new skills, build them with progressive disclosure:
SKILL.md should be an index into reference files, not a monolithreferences/ filesSKILL.mddisable-model-invocation: true unless directed by the user (or ask the user if you are not sure).Get the actual structure and field requirements of SKILL.md from the Claude Code Guide.
Good:
file: my-skill/SKILL.md
---
description: |
Use a clear description
That can span multiple lines wrapped ~80 chars
Using the yaml literal scalar
disable-model-invocation: true
argument-hint: [hints are useful] [if relevant]
---
file: my-server-skill/SKILL.md
---
description: |
Another skill that's just about a project specific area
Like the server
paths:
- "src/api/**/*.ts"
---
- When working on the server do X
Bad
---
name: should be omitted
description: some super long description hard to read because it flows off the page and might have nested <frontmatter>stuff</frontmatter or nested \"escapes\"
argument-hint: hints need `[]` around the arguments
allowed-tools: don't use this, it's confusing and hard to maintain
---
Repo opinion:
namename field, treat that as background context, not this repo's conventionname from front matterRule: If it fits in one line (~100 characters), write it inline in bash. Otherwise, delegate to a script.
Inline example (short, simple):
{
"type": "command",
"command": "jq -r '.tool_input.file_path' | xargs prettier --write"
}
Script example (anything more complex):
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/my-hook.ts"
}
Script conventions:
#!/usr/bin/env bun shebanghooks/ directory alongside hooks.jsonhooks/package.json for dependencies (consistent pattern: hooks always have their own package.json)@anthropic-ai/claude-agent-sdk types for hook input/outputException: If the repo already has an established precedent or alternative instructions for hook scripts (e.g. Python, binary, or typescript scripts in a different location), follow that instead.
Rule: Deterministic hooks (post-tool validators, stop hooks, linters, test runners) must never fail silently. If a required tool, binary, or configuration is missing, the hook must exit with a non-zero status and a clear error message — never swallow the error or silently skip the check.
Hooks assume the repo is bootstrapped correctly. A missing dependency is a hard failure that the developer must fix, not something to work around at runtime. This applies to all hook types: inline commands, script-based hooks, and SessionStart bootstrapping checks.
Subagents are context-isolated. They do not load CLAUDE.md (project or user), do not inherit skills, and receive only their own system prompt plus basic env. This means they will not behave like the main agent — they lack project conventions, tool preferences, and any injected knowledge unless explicitly provided via skills frontmatter. Design subagents as focused, self-contained specialists; do not assume shared context with the parent session.
Read references/subagent-design.md when designing new agents.
When an agent file restricts tools via front matter, always put a one-line tool inventory at the very top of the system prompt.
Pattern:
You have access to exactly these tools: Glob, Grep, Read. No others exist.
Example of inline MCP for non-plugin agents (project-local .claude/agents/):
---
name: api-researcher
mcpServers:
- context7:
command: npx
args:
- "-y"
- "@upstash/context7-mcp"
description: |
Use literal scalar yaml to write a clear description
---
System prompt...
Plugin agents: mcpServers is silently ignored for security. Use a SessionStart hook + NODE_PATH pattern from references/plugin-bootstrapping.md instead.
Agents aboveSessionStart hook to install into ${CLAUDE_PLUGIN_DATA} (persistent across sessions/updates). See references/plugin-bootstrapping.md for the full pattern (diff-based install, failure recovery, bun adaptation)