Home

markdown notes

Claude Code

table of contents


References

What is Claude Code?

commands vs skills vs agents

When to Use Which?

Note: Recent updates have merged commands into the skills system, allowing skills to be user-invocable, though skills offer more flexibility.

<!-- ~/.claude/skills/explain-code/SKILL.md -->
---
name: explain-code
description: Explains complex code using analogies and visual diagrams. Use when the user asks "how does this work?", "explain this file", or "walk me through this logic."
---

# Explain Code Skill
When this skill is triggered, follow these steps to ensure the user truly understands the underlying logic:

## 1. The Analogy
Start by comparing the code's function to a real-world concept (e.g., a restaurant kitchen, a post office, or a factory line).

## 2. Visual Diagram
Create an ASCII art diagram representing the data flow or architecture.
Example:
[Input] -> (Process A) -> {Validation} -> [Output]

## 3. Deep Dive
Walk through the code block by block. Explain *why* certain patterns (like recursion or specific hooks) were used over alternatives.

## 4. The "Gotcha"
Identify one common pitfall or edge case related to this specific code that a developer might miss.

Folder Structure

Skills are more than just a single file; they are folders that can contain supporting materials that Claude “discovers” as needed: