Claude Code is Anthropic’s agentic coding tool for terminal and IDE workflows. This 2026 revision focuses on subagents, skills, and built-in commands. Anthropic now documents reusable prompt workflows as skills; older .claude/commands/ examples may still appear in existing projects, but new reusable workflows should use skill folders. Always check the current Claude Code feature overview before relying on a configuration detail.

Claude Code Subagents: Creating Custom AI Assistants

What are Subagents? Claude Code subagents are pre-configured AI personalities that Claude can delegate tasks to. Each subagent has a specific purpose or domain of expertise (for example, code review, testing, or debugging), uses its own separate context window (so it won't mix up information with the main conversation), and can have its own set of tools and a custom system prompt guiding its behavior. In practice, when Claude Code encounters a task that matches a subagent’s purpose, it can hand off that task to the subagent, which then works independently and returns the result.

Why use subagents? Subagents bring several benefits: they preserve context (each works in isolation, preventing the main chat from getting cluttered) and provide specialized expertise for certain tasks. You can fine-tune a subagent with detailed instructions for its domain, leading to higher success rates on those tasks. Subagents are also reusable – once you create one (say, a “code-reviewer” agent), you can use it across projects or share it with your team for consistent workflows. Each subagent can be given limited tool permissions as needed (for safety, you might restrict powerful actions to only specific agents).

Creating a custom subagent. Claude Code makes it easy to set up a new subagent. The simplest way is to use the interactive /agents command:

  1. Open the subagents interface: In Claude’s terminal session, run the slash command /agents. This opens an interactive menu to manage subagents. From there, choose “Create New Agent”.
  2. Define the subagent: You’ll be prompted to fill in details. Claude Code can even auto-generate a draft subagent definition for you, which you can then customize. Provide a name (a unique identifier, lowercase with hyphens), a description of the subagent’s purpose (when should Claude delegate to it), and select which tools it can use (or leave that blank to let it inherit all available tools). The interface conveniently lists all tools so you can pick those relevant to the subagent’s job. You will also define the subagent’s system prompt – essentially instructions that dictate how it should approach tasks. This prompt can be multiple paragraphs describing the role, capabilities, best practices, and any constraints for the agent.
  3. Save and use: Once saved, your new subagent becomes active. Claude will automatically use it when a user request seems to fit that agent’s described purpose, or you can invoke it explicitly by name. For example, you might tell Claude: “Use the code-reviewer subagent to check my recent changes.” In this case, Claude will hand over the task to the code-reviewer agent and return its output.

Under the hood, each custom subagent is stored as a Markdown file with a YAML frontmatter. The file might look like this in your project (for a project-level agent) or your home directory (for a user-level agent):

---
name: your-sub-agent-name
description: Description of when this subagent should be invoked
tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted
---
< Subagent system prompt instructions go here... >

In the above snippet, we define the name of the agent, a short description of its purpose, and an optional list of tools it is allowed to use. If you omit the tools field, the subagent will inherit all tools available to the main Claude session by default. The body of the file (after the YAML --- markers) is the subagent’s system prompt – use this to clearly define the agent’s role, approach to solving problems, and any specific instructions or constraints it should follow.

Tips for effective subagents: To make your custom agents more effective, be very clear and specific in their description and prompt. For instance, if you want Claude to proactively use a certain subagent whenever possible, say so! The documentation suggests including phrases like “use PROACTIVELY” or “MUST BE USED” in the subagent’s description to nudge Claude into delegating to it more often. Also, choose a descriptive name and make sure the description covers the scenarios where the agent is useful. You can manage and tweak subagents either via the /agents menu (recommended for ease) or by directly editing the Markdown files (located under .claude/agents/ in your project for project-specific agents, or under ~/.claude/agents/ for user-wide agents). Project-level agents take precedence if there’s a name conflict with a user-level agent.

With well-crafted subagents, Claude Code can become a team of specialized helpers – e.g. a “test-runner” agent that runs and fixes tests, a “security-auditor” agent focusing on finding vulnerabilities, or a “doc-writer” agent that generates documentation. These agents will keep your main conversation focused and tackle their niche tasks with the guidelines you’ve given them.

Useful Built-in Commands in Claude Code

Claude Code provides many slash commands (commands you type with a leading / in the terminal session) to control its behavior or perform common actions. Below are five of the most useful built-in slash commands for developers, along with what they do:

  1. /init – Initialize a project: This command sets up a new project by creating a CLAUDE.md guide in your repository. It’s great for getting started with Claude Code on a fresh codebase. Running /init will generate a Markdown file with guidelines (like a project README for Claude) that helps the AI understand your project’s context and conventions.
  2. /agents – Manage AI subagents: Opens an interactive menu to create, edit, or view custom subagents. This is the command we discussed earlier; it allows you to configure specialized AI helpers. Using /agents is an easy way to tweak which tools a subagent can use, update its prompt, or add new agents without manually editing files. (When listed in the help menu, this command appears as “agents (project)” or “(user)” depending on scope).
  3. /review – Request a code review: When you want an AI perspective on your code changes, use /review. Claude will analyze your recent changes or a pull request and provide a code review with feedback. This can help catch issues or suggest improvements from an AI code reviewer’s perspective.
  4. /memory – Edit memory files: Claude Code maintains a memory of important context (in a file called CLAUDE.md). The /memory command opens or lets you edit these memory files. You might use this to update Claude’s knowledge of project-wide information or persistent instructions (for example, high-level design decisions or naming conventions) that you want it to remember across sessions.
  5. /clear – Clear the conversation: This command clears the conversation history in Claude Code. It’s essentially a reset – very useful when you want to start fresh without any prior context influencing the AI. For instance, if Claude has gone off track or you’re switching to a completely new task, /clear wipes the slate clean.
  6. claude --resume – Resume a conversation: This is a CLI flag rather than a slash command. Use it to select or resume a saved session; claude --continue continues the most recent conversation in the current directory.

Creating Reusable Skills in 2026

Claude Code now documents reusable workflows as skills. A skill lives in .claude/skills/<skill-name>/SKILL.md for a project or ~/.claude/skills/<skill-name>/SKILL.md for your user account. The skill description helps Claude decide when to load it, and you can still invoke user-facing skills with /skill-name. See Anthropic’s skills documentation for the current schema.

Create .claude/skills/test-run/SKILL.md for a project-level workflow:

---
name: test-run
description: Run the project test suite, diagnose failures, and propose scoped fixes.
allowed-tools: Bash(npm run test)
---

Run `npm run test`. Group failures by root cause, identify the smallest safe fix,
and rerun the affected tests. Do not change unrelated production behavior.

The description should state both what the skill does and when it is useful. Give it only the tools it needs. A skill can also specify isolated context or a particular agent, but those options should be added only when the workflow benefits from them. Use /skills or /context to confirm that Claude Code discovered the configuration.

Conclusion

Subagents are useful when a focused task would otherwise clutter the main context. Skills package reusable instructions and can be invoked explicitly or selected from their descriptions. Built-in commands help inspect configuration and manage a session. Keep permissions narrow, verify generated changes, and prefer a simple workflow until isolation or delegation provides a measurable benefit.

Sources reviewed August 16, 2026:

  1. Anthropic Documentation – Claude Code subagents
  2. Anthropic Documentation – Claude Code skills