# Claude Code Agents vs Claude Code Commands

> A Claude Code subagent (.claude/agents/*.md) is a role with its own context window and tool grant. A slash command (.claude/commands/*.md) is a prompt you trigger with /. How /ship invokes tech-lead without forking 34 sessions, plus a decision table.

Canonical: https://www.agentickit.co/compare/claude-code-agents-vs-commands
Last updated: 2026-11-18

A subagent (.claude/agents/*.md) is a role: a name, a tool grant, and a system prompt that runs in its own isolated context window when the main session or you delegate to it. A slash command (.claude/commands/*.md) is a prompt you trigger by typing /name, read by whichever session is already running. An agent is who does the work; a command is the order you ask for it in. Last updated 2026-10-30 by Rakshit Yadav.



## Subagent: a role with its own context window
A Claude Code subagent is a markdown file under `.claude/agents/&lt;name&gt;.md` with frontmatter for `name`, `description`, which `tools` it's allowed to call, and optionally which model runs it. When the main session delegates to it — because you named it or because the main agent's own judgment matched the task to its description — that subagent runs in a clean, separate context window with no access to the parent conversation's history beyond what it was handed. It reports back a result; its working context then disappears. That isolation is the entire point: a long code review or a wide research pass can burn thousands of tokens of scratch work without any of it polluting the main thread.

## Command: a prompt you trigger with /
A slash command is a markdown file under `.claude/commands/&lt;name&gt;.md`. Type `/ship` and the current session reads that file as a prompt — there is no separate context window, no isolation, just instructions injected into the conversation you're already having. A command never runs on its own; the model doesn't decide to invoke one the way it can choose to delegate to a subagent that matches a task description. You are always the trigger.

## When to reach for a slash command
Reach for a command when you do the same multi-step job often enough that typing it out each time is wasted effort, and when you want to be the one deciding the moment it runs: a release checklist, a full SEO audit, a scaffold for a new API route. The command's body can itself instruct the session to delegate pieces of the job to subagents — that's the normal pattern, not an exception.

## When to reach for a subagent
Reach for a subagent when a single job benefits from a clean context window separate from the main thread: a code review that needs to read a dozen files it will never mention again, a research pass that would otherwise flood the conversation with search results, or a role you want to invoke by name from several different commands without copy-pasting its instructions each time. If the job is small enough that burning a fresh context window is overkill, it doesn't need to be a subagent — it can just be the next line of the current conversation.

## Combining both: a command that invokes an agent
[/ship](https://www.agentickit.co/commands/ship) is the clearest example. Typing `/ship` doesn't spawn 34 separate processes — it tells the current session to read the command file, which instructs it to delegate in sequence: hand the spec to [tech-lead](https://www.agentickit.co/agents/tech-lead), then the schema to a database subagent, then the endpoint to a backend subagent, each running in its own context window and reporting back before the next one starts. The command supplies the order and the gates between steps; each subagent supplies the isolated workspace and the role-specific system prompt for its piece. Neither replaces the other — a command with no subagents to delegate to is just a long prompt, and a subagent nobody ever invokes is a file that does nothing.

## Decision table
<table><thead><tr><th></th><th>Subagent</th><th>Command</th></tr></thead><tbody><tr><td>**File**</td><td>`.claude/agents/&lt;name&gt;.md`</td><td>`.claude/commands/&lt;name&gt;.md`</td></tr><tr><td>**Triggered by**</td><td>Name, or the main agent's own judgment matching its description</td><td>You, typing `/name`</td></tr><tr><td>**Context**</td><td>Its own isolated window</td><td>The session you're already in — no isolation</td></tr><tr><td>**Tool access**</td><td>Scoped per-agent via frontmatter</td><td>Whatever the current session already has</td></tr><tr><td>**Best for**</td><td>A role or job that needs a clean, separate workspace</td><td>A repeatable sequence you want to trigger on purpose</td></tr><tr><td>**Can it call the other?**</td><td>No — an agent can't type a slash command</td><td>Yes — a command's instructions can tell the session to delegate to one or more subagents</td></tr></tbody></table>This is the same split as the Cursor-side question, just with real context isolation on the agent side instead of a shared single session — see [Cursor Agents vs Commands](https://www.agentickit.co/compare/cursor-agents-vs-commands) for how that version plays out.



## FAQ

### Can a Claude Code subagent run on its own, without a command?
Yes. The main session can delegate to a subagent directly, based on your explicit mention of its name or because the task matches its description, with no command file involved at all.

### Does /ship spawn 34 separate Claude Code sessions?
No. It runs in the current session, which then delegates specific steps to individual subagents one at a time, each getting its own context window for that step before control returns to the command's sequence.

### Should my checklist be a command or a subagent?
If you want to trigger it yourself and it's mostly a sequence of steps, make it a command. If a step in that sequence needs a large, separate context window — reading many files, running a long review — delegate that step to a subagent from inside the command.

### Can a subagent have a smaller tool grant than the main session?
Yes, and that's a common reason to use one. A subagent's frontmatter can restrict it to read-only tools, for example, so a review role can't accidentally edit files even if the main session has write access.

## Related
- [The 34 AgenticKit agents](https://www.agentickit.co/agents)
- [Commands pillar](https://www.agentickit.co/commands)
- [/ship](https://www.agentickit.co/commands/ship)
- [CLAUDE.md vs Skills vs Subagents vs Hooks](https://www.agentickit.co/compare/claude-code-skills-vs-subagents-vs-hooks)
- [Claude Code Plugins vs Commands](https://www.agentickit.co/compare/claude-code-plugins-vs-commands)
- [Cursor Agents vs Commands (the Cursor-side version of this question)](https://www.agentickit.co/compare/cursor-agents-vs-commands)
- [Claude Code Role Agents vs Cursor Custom Agents (SEO, growth, support, QA)](https://www.agentickit.co/compare/claude-code-role-agents-vs-cursor-custom-agents)
- [How the agent roster is structured](https://www.agentickit.co/blog/how-i-structured-34-ai-agents)
