Four overlapping ways to teach Claude Code something new — CLAUDE.md, slash commands, Skills, and subagents. They look interchangeable in the docs. They are not. This page is the decision tree.
__tests__/."/name in the terminal/deploy-staging — kick off the staging rollout I keep mistyping."/namecontext: fork)| Auto-invoke | Manual /name |
Bundles files | Isolated context | Token cost when idle | |
|---|---|---|---|---|---|
| CLAUDE.md | ● always loaded | ○ n/a | ○ no | ○ no | ◐ every turn |
| Slash command | ○ no | ● yes | ○ single file | ○ no | ● zero |
| Skill | ● on description match | ● yes | ● folder | ◐ with context: fork |
◐ ~dozen tokens (name+desc) |
| Subagent | ● auto-delegated | ● via Task tool | ● via Skill | ● full window | ● zero |
| description | The triage line. Capped at 1,536 chars. Front-load the use condition. |
| allowed-tools | Pre-approves tools while skill is active — skips per-call prompts. |
| disable-model-invocation | true = user-only. For /deploy, anything with side-effects. |
| user-invocable | false hides from / menu. Background knowledge Claude reads. |
| context: fork | Runs inside a subagent. Pair with agent: Explore or Plan. |
| paths | Glob. Auto-load only when working with matching files (monorepo-friendly). |
| model, effort | Per-skill overrides of session model / effort. |
CLAUDE.md.The ` !`cmd` ` dynamic-context feature runs before the model ever sees the skill body. Model-level prompt-injection defenses never get a chance to fire. [7]
Mitigations: review every project Skill before accepting workspace trust · for untrusted sources, set disableSkillShellExecution: true · prefer source-reference distribution (marketplaces that pin to upstream commits) over copy-paste. [12]
A database, a SaaS API session, an OAuth handshake — anything the agent needs to stay logged into while it works.
A shell command, a Python script, a procedural recipe. Cheaper to build, cheaper to ship, cheaper to audit. [3]
SKILL.md