CCA-F Study Day 11/20: Custom Commands, Skills & Plan Mode
Domain 3: Claude Code Configuration & Workflows (~20% of exam)
📌 Today's Focus
Yesterday you mastered the CLAUDE.md hierarchy — the 6-level priority system that gives Claude Code persistent instructions. Today we go hands-on with the three core extension mechanisms in Claude Code: custom slash commands, skills, and plan mode. The exam loves testing whether you know which mechanism to use when and the structural differences between them. This is one of the most practical days — everything here directly maps to the "Code Generation with Claude Code" exam scenario.
📚 Core Concepts
1. Custom Slash Commands
Location: .claude/commands/ directory
Custom commands are markdown files that define reusable prompts you invoke manually with /command-name. They are:
- Manually invoked — you type the slash command explicitly
- Always loaded — the command definition is sent as-is when invoked
- Parameterized — use
$ARGUMENTSto capture what the user types after the command - Team-shareable — check into git under
.claude/commands/
Example command file:
# .claude/commands/fix-tests.md
Run the test suite, identify failures, fix the root cause,
and verify all tests pass.
Focus on: $ARGUMENTS
Invocation: /fix-tests auth module
Here, $ARGUMENTS is replaced with "auth module". The entire markdown content becomes Claude's prompt.
Key exam distinction: Commands are explicitly invoked by the user. They don't fire automatically. They're the simplest extension mechanism — just a markdown file with a prompt template.
2. Skills (Auto-Discovered Capabilities)
Location: .claude/skills/ directory
Skills are richer than commands. They use progressive disclosure — Claude loads them on-demand when relevant, rather than loading everything into context upfront.
# .claude/skills/SKILL.md
---
name: deploy-preview
description: Deploy a preview environment for the current branch
tools: [Bash, Write]
---
## Instructions
1. Build the project with `npm run build`
2. Deploy to preview: `netlify deploy --dir=dist`
3. Return the preview URL
Critical differences between Skills and Commands:
| Feature | Commands | Skills |
|---|---|---|
| Invocation | Manual (/command-name) | Auto-discovered OR manual (/skill-name) |
| Loading | Full content loaded on invocation | Progressive disclosure — description loaded first, full instructions only when used |
| Context cost | Entire file consumed when invoked | Minimal until needed (token-efficient) |
| Metadata | None (just markdown) | YAML frontmatter (name, description, tools) |
| Best for | Simple repeatable prompts | Complex workflows with multiple steps |
When to use Skills over Commands:
- When you keep pasting the same instructions repeatedly
- When a section of CLAUDE.md has grown into a procedure rather than a fact
- When the workflow is complex enough to need supporting files
- When you want Claude to auto-invoke the capability without explicit
/prefix
Exam trap: The exam will present scenarios where CLAUDE.md is bloated with procedural instructions and ask what to do. The answer is extract them into skills — not add more to CLAUDE.md.
3. Plan Mode (4-Phase Workflow)
Activation: Shift+Tab in Claude Code CLI
Plan mode separates research from implementation. This is the single most important workflow pattern for the exam's Code Generation scenario.
The 4 Phases:
- Explore (plan mode ON) — Claude reads files, answers questions, makes NO changes
- Plan (plan mode ON) — Claude creates a detailed implementation plan. Use
Ctrl+Gto open the plan in your editor for direct editing. - Implement (plan mode OFF / normal mode) — Claude codes, verifying against its plan
- Commit (normal mode) — Claude commits with a descriptive message and creates a PR
When to use plan mode:
- ✅ Uncertain about the approach
- ✅ Change modifies multiple files
- ✅ Unfamiliar with the code being modified
When to SKIP plan mode:
- ❌ Scope is clear, fix is small (typo, log line, rename)
- ❌ You could describe the diff in one sentence
Exam-critical insight: Plan mode maps to the "plan" permission mode in the Agent SDK, which is read-only. Claude explores and produces a plan but cannot make changes. This is how you get investigation without risk.
4. The TDD Iteration Pattern
A specific workflow that combines plan mode + verification:
- Write a failing test that defines the desired behavior
- Ask Claude to implement code that passes the test
- Claude runs the test, iterates until green
- Refactor with confidence (tests as safety net)
This is the exam's preferred pattern for the Code Generation scenario because it gives Claude built-in verification — the single highest-leverage thing you can do.
⚠️ Anti-Patterns & Exam Traps
| ❌ Anti-Pattern | Why It's Wrong | ✅ Correct Approach |
|---|---|---|
| Stuffing procedural workflows into CLAUDE.md | CLAUDE.md is loaded every session — procedural content bloats context and gets ignored | Extract workflows into Skills that load on-demand |
| Skipping plan mode for multi-file changes | Claude jumps to coding and may solve the wrong problem or miss dependencies | Use plan mode to explore → plan → implement → verify |
| Using commands for complex multi-step workflows | Commands are flat templates with no progressive disclosure — expensive for complex tasks | Use Skills with YAML metadata for auto-discovery and token efficiency |
| Letting Claude self-verify by assertion ("I verified it works") | Claude's self-reported verification is unreliable | Provide concrete verification: run tests, take screenshots, show output |
| Planning simple changes (typo, rename) | Overhead of plan mode exceeds benefit for trivial tasks | Direct execution for one-sentence-describable changes |
💻 Code Examples
Custom Command with $ARGUMENTS
# .claude/commands/security-audit.md
Perform a security audit on the specified file or module.
Focus on: $ARGUMENTS
Check for:
1. SQL injection vulnerabilities
2. XSS attack vectors
3. Hardcoded secrets or credentials
4. Insecure deserialization
5. Missing input validation
For each finding, report:
- Severity (Critical/High/Medium/Low)
- Line number
- Description
- Suggested fix
Run the linter after suggesting fixes to verify no regressions.
Usage: /security-audit src/api/auth.py
Skill with Progressive Disclosure
# .claude/skills/SKILL.md
---
name: migrate-to-typescript
description: Convert a JavaScript file to TypeScript with proper types
tools: [Read, Write, Bash, Grep]
---
## Instructions
1. Read the target .js file
2. Analyze all exports, function signatures, and variable types
3. Create the .ts file with proper type annotations
4. Add necessary @types packages to package.json
5. Run `npx tsc --noEmit` to validate
6. Fix any type errors iteratively
7. Delete the original .js file
8. Update any imports in other files that reference the old .js path
Plan Mode Workflow in Practice
# Phase 1: Explore (plan mode active - Shift+Tab)
> read src/auth/ and understand how we handle sessions and login.
> also look at how we manage environment variables for secrets.
# Phase 2: Plan (still in plan mode)
> I want to add Google OAuth. What files need to change?
> What's the session flow? Create a detailed plan.
# Press Ctrl+G to edit the plan in your text editor
# Phase 3: Implement (switch out of plan mode - Shift+Tab again)
> Implement the OAuth flow from your plan.
> Write tests for the callback handler.
> Run the test suite and fix any failures.
# Phase 4: Commit (normal mode)
> Commit with a descriptive message and open a PR
🎬 Video to Watch
Building Claude Code: Origin Story, Product Iterations, & What's Next (MLOps Community, ~50 min)
Features Siddharth Bidasaria, co-creator of Claude Code and Member of Technical Staff at Anthropic. He discusses the design philosophy behind Claude Code — particularly the shift from "steering the model" to "getting out of its way." Most relevant sections for today: the discussion of how Claude Code's command/skill system evolved, and why progressive disclosure was chosen for skills. Skip to ~15:00 for the product iteration discussion.
📖 Reading
- Primary: Extend Claude with Skills — Official Anthropic docs on skills, commands, and their differences
- Secondary: Best Practices for Claude Code — Anthropic engineering post covering plan mode workflow, CLAUDE.md tips, and verification patterns
- Bonus: anthropics/skills GitHub repo — Official public repository of Agent Skills you can study for structure/patterns
🛠️ Hands-On Exercise (20-30 min)
- Create a custom command: In any project, create
.claude/commands/review-pr.mdthat instructs Claude to review code for quality, security, and test coverage. Include$ARGUMENTSfor the PR branch name. - Create a skill: Create
.claude/skills/SKILL.mdfor a "generate-api-docs" skill that reads route handlers, extracts endpoints, and generates OpenAPI-style documentation. Include proper YAML frontmatter with name, description, and tools. - Practice plan mode: Open Claude Code in a real project. Activate plan mode (
Shift+Tab). Ask Claude to explore the codebase and propose adding a new feature. Review its plan. Then switch to normal mode and let it implement. Notice how the plan constrains and guides implementation.
📝 Quick Quiz
Q1. A developer has a CLAUDE.md file with 500+ lines including detailed deployment procedures. Claude Code is increasingly ignoring important instructions. What's the best fix?
A) Add "IMPORTANT" prefixes to critical rules B) Split into multiple CLAUDE.md files in subdirectories C) Extract procedural workflows into Skills and keep CLAUDE.md concise D) Increase Claude's context window allocation
Q2. In the plan mode workflow, what happens if Claude identifies a needed change during the "Explore" phase?
A) Claude makes the change immediately since it identified the need B) Claude adds it to a queue and executes after exploring C) Claude cannot make changes — plan mode is read-only; changes happen in normal mode D) Claude asks for permission before making each change
Q3. A team wants to standardize their database migration workflow so Claude automatically knows how to handle migration tasks. The workflow involves 8 steps and specific tooling. Which approach is correct?
A) Add all 8 steps to the project CLAUDE.md file
B) Create a custom command at .claude/commands/migrate-db.md
C) Create a skill at .claude/skills/SKILL.md with the full workflow and appropriate metadata
D) Add instructions to the enterprise managed-settings.json
Answers:
Q1: C — Skills use progressive disclosure and only load when relevant. Bloated CLAUDE.md files cause instructions to get lost. The key signal was "increasingly ignoring instructions" = context overload.
Q2: C — Plan mode maps to the "plan" permission mode which is read-only. Claude explores and plans but cannot execute changes. Implementation happens after switching back to normal mode.
Q3: C — Skills are the right choice for complex, multi-step workflows that should auto-trigger when relevant. Commands would work but require manual invocation. CLAUDE.md would bloat context. Enterprise settings are for org-wide policies, not project workflows.
👀 Tomorrow's Preview
Day 12 dives into CI/CD Integration & Batch Processing — the -p flag for non-interactive pipelines, structured JSON output, the Batch API, and the critical anti-pattern of same-session self-review. This powers the "Claude Code for CI/CD" exam scenario.