C
Create Claude Code Agent
Complete guide for creating Claude Code agents with YAML frontmatter structure, agent file format, trigger condition design, and system prompt writing
ByNeoLabHQ
WhatIsIt
Agents are autonomous subprocesses spawned via the Task tool that:
- Handle complex, multi-step tasks independently
- Have their own isolated context window
- Return results to the parent conversation
- Can be specialized for specific domains
| Concept | Agent | Command |
|---|---|---|
| Trigger | Claude decides based on description | User invokes with /name |
| Purpose | Autonomous work | User-initiated actions |
| Context | Isolated subprocess | Shared conversation |
| File format | agents/.md | commands/.md |
HowToUse
Agent triggers based on prior tool usage.
<example>
Context: User made multiple edits to test files
user: "I've updated all the tests"
assistant: "Great! Let me verify test quality."
<commentary>
Multiple Edit tools used on test files. Proactively trigger test-quality-analyzer
to ensure tests follow best practices.
</commentary>
assistant: "I'll use the test-quality-analyzer agent to review the tests."
</example>
KeyFeatures
- Complete guide for creating Claude Code agents with YAML frontmatter structure, agent file format, trigger condition design, and system prompt writing
- Seamless integration with Claude's development workflow
- Comprehensive guidelines and best practices for create claude code agent