PTENES
TRACK 2

🔷 Anatomy of Claude Code

Everything that lives in CLAUDE.md e .claude/ — files, settings, hooks, slash commands, sub-agents, skills, and MCP.

2
Modules
14
Topics
~70min
Duration
Inter.
Level

Learning path map

Detailed content

2.1~35 min

📘 CLAUDE.md and the .claude/ folder

The heart of a project's Claude Code configuration.

What it is:

Markdown that Claude Code injects into the system prompt. It exists at three levels: ~/.claude/CLAUDE.md (global), ./CLAUDE.md (project root) and subdir/CLAUDE.md (folder scope). Everything is concatenated in order.

Why learn:

Getting the hierarchy wrong can make project instructions override global ones without you noticing. Or worse: global instructions can stifle a project's specific preferences.

Key concepts:

User CLAUDE.md vs. project CLAUDE.md, precedence, "direct instructions take precedence over everything," ideal size (<2KB), build/test commands at the top.

What it is:

Folder with a fixed convention: agents/ (sub-agents .md), skills/ (folders with SKILL.md), commands/ (slash commands), settings.json, settings.local.json, hooks/.

Why learn:

People unfamiliar with the structure put files in the wrong place, and Claude simply can't see them. The convention is strict: the right name, the right folder, or it won't work.

Key concepts:

Convention over configuration, partial gitignore, user vs. project separation (same structure in ~/.claude/ e ./.claude/).

What it is:

JSON file with behavioral configuration: permissions (allow/deny by tool), default model, environment variables, hooks, includeCoAuthoredBy, theme, statusLine.

Why learn:

This is where you reduce permission friction (auto-allow common commands), switch models (Haiku for quick tasks), and inject event hooks.

Key concepts:

Permissions via regex/glob, settings.local.json (not committed to git), env vars with the CLAUDE_ prefix, cascading override user → project → local.

What it is:

Shell commands triggered by the harness on agent events: before/after tool use, when stopping, when receiving a prompt, at session startup. They RUN; they don’t depend on Claude remembering.

Why learn:

It's the only way to guarantee deterministic behavior ("always run lint before committing"). Memory/prompt aren't enough — Claude may forget. A hook won't.

Key concepts:

Supported events (PreToolUse, PostToolUse, Stop, SessionStart, UserPromptSubmit), matchers by tool name, exit code 0/non-0, fail-open vs. fail-closed.

What it is:

Markdown files in .claude/commands/ that become slash commands. The filename becomes the command (review.md → /review). Receive optional arguments ($ARGUMENTS).

Why learn:

Tasks you repeat become a single command. Committing with a standard message, opening a PR, generating a changelog—everything became a slash command.

Key concepts:

Frontmatter with description and allowed-tools, global vs. project namespace, $ARGUMENTS e $1/$2, chaining with bash backtick-bang.

What it is:

Rules in settings.json that control which tools/commands Claude can run without asking. Three levels: allow (permits), deny (blocks), ask (asks each time).

Why learn:

Misconfigured permissions create friction (asking about everything) or risk (allowing too much). The balance is to allow reading and analysis, and require confirmation for writing or destructive actions.

Key concepts:

Glob standard (Bash(ls:*), Bash(git status:*)), permission modes (default, acceptEdits, plan, bypassPermissions), MCP allowlist (mcp__servidor).

What it is:

Plan mode is a mode where Claude plans without editing, ideal for large refactors. Output styles change the response tone (verbose, concise, explanatory). Both adjust behavior without changing the prompt.

Why learn:

Starting a complex task? Plan mode first, then execution. Want short answers? Output style concise. Need details? Explanatory. It’s zero friction to change the tone.

Key concepts:

/plan, /output-style, customization via .claude/output-styles/*.md, mode isolation per session.

View Full
2.2~35 min

🧩 Skills, sub-agents, and MCP in Claude Code

Where your agent’s custom intelligence really lives.

What it is:

Folder in .claude/skills/<nome>/ containing SKILL.md (with YAML frontmatter: name, description, optional allowed-tools), and conventional subfolders scripts/, references/, assets/.

Why learn:

This is the modern way to package behavior. Cleaner than bloating CLAUDE.md, more reusable than a slash command, and activated by description instead of manual invocation.

Key concepts:

Minimal frontmatter (name + description), ideal body size, references as lazy-loaded deep dives, scripts for deterministic actions.

What it is:

The field description from the frontmatter is what the agent uses to decide whether to invoke the skill. Vague description = skill ignored. Description with the right triggers = skill activated at the right time.

Why learn:

The biggest cause of a skill “not working” is a poor description. It’s not a bug; semantic matching is failing. There are clear patterns that work (use when..., trigger phrases, examples).

Key concepts:

"Use when X" pattern, list real user trigger phrases, direct examples, avoid redundancy with the name.

What it is:

Files in .claude/agents/<nome>.md: frontmatter (name, description, tools, model) + body with the persona's system prompt. The main Claude delegates a task via the Task tool; the sub-agent runs in isolation.

Why learn:

A sub-agent isolates context (it doesn’t clutter the main agent’s context), can run in parallel, and is how you get specialists (code-reviewer, security-auditor, etc.) without a huge prompt.

Key concepts:

Auto-dispatch via description, parallelism (multiple sub-agents at once), tool restrictions per sub-agent, dedicated model (Haiku for search, Opus for analysis).

What it is:

Connect Claude to external services via the Model Context Protocol. Server declared in .mcp.json (project) or ~/.claude.json (global). Tools become mcp__server__tool.

Why learn:

MCP is how you give Claude superpowers: access to Slack, Gmail, GitHub, and databases without having to implement a custom tool.

Key concepts:

stdio vs HTTP transport, allowlist ("enabledMcpjsonServers": [...]), tool discovery, env vars/secrets via variable.

What it is:

Claude Code-specific syntax: inside SKILL.md or commands, code between backtick-bang (`!cmd`) is executed by the shell and the result goes into the prompt. Codex doesn't support it.

Why learn:

This is how to make a dynamic skill: “read the latest log,” “list branches,” “get the current version” — without needing an additional tool call. But this is an exclusive feature — be careful when porting.

Key concepts:

Build-time execution of the skill, security implications (don't interpolate untrusted input), polyskill converts it into fallback prose in Codex.

What it is:

Fields in the skill frontmatter: disable-model-invocation prevents auto-triggering (only runs when explicitly invoked); allowed-tools restricts which tools the skill can use.

Why learn:

Dangerous skills (those that run destructive actions) need explicit invocation. Focused skills should have a restricted tool surface to avoid surprises.

Key concepts:

Principle of least privilege, opt-in invocation, tool allowlist, model override (run a skill with Haiku to save costs).

What it is:

Claude Code supports plugins (packages with skills + agents + commands + hooks) that can be installed via a marketplace. Each plugin can have its own namespace (plugin:skill-name).

Why learn:

It's how you consume other people's work (claude-mem, context-mode, superpowers, etc.) and publish your own. Standardized distribution.

Key concepts:

plugin.json manifest, marketplace.json, plugin:skill namespace, npm-style versioning, updates via /plugins.

View Full
← Track 1: Fundamentals Track 3: Codex →