agentleFS
ajipalarajipalar/skillkit/skills/claude-code-guide/SKILL.md

claude-code-guide

Skill0 starsChanged 6 months agoMITView on GitHub

Reference guide for Claude Code CLI features, configuration, and advanced usage patterns. Use when anyone asks how Claude Code works, what it can do, or how to configure it. Covers: built-in tools (Read, Write, Edit, Glob, Grep, Bash, Task, TodoWrite, WebFetch, WebSearch), hooks (PreToolUse, PostToolUse, Stop, Notification), agents and subagents (Task tool, custom agents, parallel execution), skills (SKILL.md format, slash commands), MCP servers (mcp.json, stdio/SSE), settings and permissions (settings.json, CLAUDE.md, allowedTools, denyTools), and advanced patterns (Ralph Wiggum loop, worktrees, phased execution, multi-agent workflows, headless/CI mode). Triggers on: "how do hooks work," "what tools does Claude have," "set up MCP," "how do subagents work," "create a skill," "Ralph Wiggum loop," "configure permissions," or any question about Claude Code architecture, tools, or extensibility. NOT for prompt engineering, human-AI interaction patterns, or Claude API/SDK usage.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the reference file

    line 47
  2. Distinctive:

    If the question spans multiple topics, read the most relevant reference first, then supplement from others as needed.

    line 62
  3. Distinctive:

    Read the identified reference file(s), then synthesize a focused answer.

    line 77
  4. Distinctive:

    Prefer concrete examples and code snippets over abstract explanations.

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Code Guide

Reference for Claude Code CLI features, tools, configuration, and advanced patterns. Covers the CLI tool itself — not the Claude API/SDK for application development, and not general human-AI interaction guidance.

Scope

Covers:

  • Built-in tools and when to use each
  • Hooks (lifecycle events, configuration, matchers)
  • Agents and subagents (Task tool, parallel execution, custom agents)
  • Skills and slash commands (SKILL.md format, discovery, directories)
  • Model Context Protocol (MCP servers, configuration, transports)
  • Settings, permissions, and CLAUDE.md files
  • Advanced patterns (Ralph Wiggum loop, worktrees, phased execution)

Does NOT cover:

  • General prompt engineering or conversation techniques
  • Claude API/SDK usage from application code
  • Human-AI interaction patterns and anti-patterns
  • AI safety, ethics, or alignment topics

Workflow

  1. Identify the user's question or topic
  2. Route to the appropriate reference file
  3. Read the reference file
  4. Provide the answer using reference content plus your own knowledge

Step 1: Identify the Topic

TopicTrigger Keywords
ToolsRead, Write, Edit, Glob, Grep, Bash, Task, TodoWrite, WebFetch, WebSearch, "built-in tools," "what tools," "which tool should I use"
Hookshook, PreToolUse, PostToolUse, Notification, Stop, "lifecycle event," "before tool runs," "after tool runs," matcher, "event handler"
Agentssubagent, Task tool, "parallel execution," "dispatch agent," "custom agent," "multi-agent," "background agent," "isolated context"
SkillsSKILL.md, slash command, "skill format," "skill directory," frontmatter, "create a skill," skill discovery, "/command"
MCPMCP, "model context protocol," "MCP server," "tool server," "mcp.json," stdio, SSE, "external tools"
Settingssettings.json, permissions, CLAUDE.md, ".claude directory," allowedTools, denyTools, "permission mode," "configure Claude"
Advanced"Ralph Wiggum," worktree, "phased execution," "multi-pass," "context window," "agentic loop," headless, CI mode, "non-interactive"

If the question spans multiple topics, read the most relevant reference first, then supplement from others as needed.

Step 2: Route to Reference

  • Tools → Read references/tools.md
  • Hooks → Read references/hooks.md
  • Agents → Read references/agents-and-subagents.md
  • Skills → Read references/skills-and-commands.md
  • MCP → Read references/mcp.md
  • Settings → Read references/settings-and-permissions.md
  • Advanced → Read references/advanced-patterns.md

Steps 3-4: Read and Respond

Read the identified reference file(s), then synthesize a focused answer. Prefer concrete examples and code snippets over abstract explanations. Supplement reference content with your own training knowledge when the reference doesn't fully address the question.

Quick Reference

These tables cover the most frequently asked questions. For details beyond what's here, route to the appropriate reference file.

Tool Selection

NeedToolNotes
Read a fileReadSupports offset/limit, images, PDFs, notebooks
Search file contentsGrepBuilt on ripgrep; use pattern + glob/type filters
Find files by nameGlobSupports **/*.ext patterns
Edit existing fileEditExact old_string/new_string replacement
Create/overwrite fileWriteOverwrites entire file
Run a shell commandBash2min default timeout, max 10min
Delegate complex workTaskIsolated subagent with own context
Track progressTodoWritepending → in_progress → completed
Fetch web contentWebFetchURL + prompt, returns processed markdown
Search the webWebSearchReturns search results with links

File and Directory Hierarchy

~/.claude/                    (user-global scope)
├── CLAUDE.md                 (global instructions, always loaded)
├── settings.json             (global settings and permissions)
├── skills/                   (global skills)
├── agents/                   (global custom agents)
└── mcp.json                  (global MCP server config)

<project>/
├── CLAUDE.md                 (project instructions, auto-loaded)
├── CLAUDE.local.md           (personal overrides, gitignored)
├── .claude/
│   ├── CLAUDE.md             (additional project instructions)
│   ├── settings.json         (project settings)
│   ├── settings.local.json   (personal project settings)
│   ├── skills/               (project skills)
│   ├── agents/               (project custom agents)
│   ├── commands/             (project slash commands)
│   ├── rules/                (auto-loaded markdown rule files)
│   └── mcp.json              (project MCP server config)
└── src/
    └── CLAUDE.md             (directory-level, loaded contextually)

Hook Events

EventWhenCommon Use
PreToolUseBefore a tool executesValidate, block, or modify tool input
PostToolUseAfter a tool completesLog, notify, post-process results
NotificationAgent sends a notificationExternal alerts (Slack, desktop)
StopAgent finishes respondingCleanup, final validation
SubagentStopA subagent completesResult validation

Permission Levels

ArrayBehavior
allowTool runs without prompting
askUser prompted for confirmation
denyTool blocked entirely

Evaluation order: deny → ask → allow (first match wins).

Pattern syntax: "ToolName", "Bash(npm test)", "Bash(npm run *)", "mcp__server__*".

MCP Configuration

ScopeFile
Project.claude/mcp.json
User global~/.claude/mcp.json

Transports: stdio (subprocess, most common) or sse (HTTP service).

Updating Reference Content

Fetch the latest documentation from trusted sources:

# Fetch all sources
scripts/fetch_docs.sh

# Fetch a specific source
scripts/fetch_docs.sh --source anthropic-docs

# List available sources
scripts/fetch_docs.sh --list

Fetched content is stored in cache/ for review. Reference files in references/ should be updated manually from cached content to ensure quality and accuracy.

Trusted Sources

SourceURLContent
Anthropic Docsdocs.anthropic.com/en/docs/claude-codeOfficial reference
Claude Code GitHubgithub.com/anthropics/claude-codeSource, examples
MCP Specmodelcontextprotocol.ioProtocol specification
Simon Willisonsimonwillison.net/tags/claude-code/Advanced patterns
eesel.aieesel.ai/blogIn-depth guides
Builder.iobuilder.io/blog/claude-codePractical workflows

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.