Agents
An agent in Claude Code is a specialized, focused subagent — a separate Claude instance you can spawn for a discrete kind of work (code review, security audit, deployment audit, research dive). Agents have their own system prompt, their own tool allowlist, and their own context window. They keep the main conversation lean and let you pick the right "specialist" for the task.
When to reach for an agent vs. a skill
- Skill: A pattern or playbook the main Claude follows in your conversation. Lives in your chat history.
- Agent: A separate worker spawned for a contained task. Reports back a result. Its working context is discarded after the task.
If the task can derail or pollute your main thread (large search, security review, exhaustive audit), use an agent. If it's a methodology you want Claude to follow alongside your other work, use a skill.
RBA's perspective
We use agents for work that meets three criteria:
- Scoped: The task has a clear start and end. "Audit this PR for security regressions" not "help me improve security."
- Isolated: The agent's context can be discarded without losing important state in the main thread.
- Specialist-flavored: The work benefits from a different system prompt than your main conversation has.
For broad codebase exploration or planning, prefer launching an exploration agent over running searches inline. For domain-specific reviews (accessibility, security, compliance), use a dedicated review agent so its standards aren't diluted by your normal coding context.