Agents and Subagents
A subagent is a separate Claude Code worker with its own context window. The main session gives it a task, and it returns only its final report. This keeps large searches or side investigations out of the main conversation.
What the workspace has today
The workspace defines no project agents. There is no .claude/agents/ folder. The built-in subagents are enough for current work:
| Built-in | Good for |
|---|---|
| Explore | Read-only sweeps across many files or projects when you need the conclusion, not the file contents |
| Plan | Laying out an implementation approach before any edit |
| General-purpose | Multi-step research or searches that may take several tries |
When to delegate
- Delegate a broad, read-heavy question (“which services publish audit events?”) when the graph does not answer it, or independent pieces of work that can run in parallel.
- Do not delegate a small, targeted change. A subagent starts cold, re-reads context the main session already has, and costs more.
- Ask for it explicitly (“use a subagent to …”). The workspace does not encourage automatic delegation.
The guardrails still apply
Subagents run in the same Claude Code process, as the same vscode user, in the same dev container. Their tool calls go through the same deny list and PreToolUse hooks as the main session, including the managed policy in /etc/claude-code/. A subagent cannot read a secret or push without approval any more than the main session can. Its report is shown to the main session, not directly to you, so ask the main session to summarise what the subagent found and changed.
Adding a project agent
Add one only when the same delegated task recurs and needs a fixed prompt or a restricted tool set, for example a read-only documentation reviewer. Agent definitions are Markdown files in .claude/agents/:
---
name: docs-reviewer
description: "Review appDocs changes against the Engineering Doc Pipeline. Use after writing BRD/SR/ADR/architecture docs."
tools: Read, Grep, Glob
---
Check each changed doc against <site-repo>/CLAUDE.md ...
- Give it the fewest tools it needs. A reviewer does not need
Bash,EditorWrite. - Write the description as a trigger, like a skill’s.
- Do not put a rule only in an agent. Shared rules belong in
.claude/rules/, so every session follows them. - Commit it to the workspace repository through a pull request, like any other shared configuration.