Subagent examples for Claude Code and Cursor
A subagent is a Markdown file with YAML frontmatter that defines a specialist agent with its own context window and system prompt. Every example below comes in both formats, checked against the Claude Code and Cursor docs.
Convert a subagent between Claude Code and Cursor
--- name: code-reviewer description: "Reviews changes for bugs. Use proactively before committing." model: inherit readonly: true --- You are a strict code reviewer. Run git diff and report issues by severity.
- model "sonnet" is a Claude alias; set to inherit. Put a Cursor model ID here if you want a fixed model.
- Cursor has no equivalent for: tools. Tool access is reduced to readonly: true.
Runs in your browser. Nothing is uploaded.
Claude Code vs Cursor subagent format
- Both:
name,description(the delegation trigger),model, and the Markdown body as the system prompt. - Claude Code only:
tools/disallowedToolsallowlists,permissionMode,maxTurns,skills,hooks,mcpServers,memory,effort,isolation: worktree,background,color. Model aliases: sonnet, opus, haiku, inherit. - Cursor only:
readonly(no file edits or state-changing shell commands) andis_background.modelisinheritor a Cursor model ID.
All 33 subagents
- Code ReviewerReviews uncommitted or branch changes for bugs, regressions and missing tests.
- Security AuditorSecurity specialist.
- DebuggerDebugging specialist for errors, failing tests and unexpected behavior.
- Test RunnerRuns the relevant tests after code changes and fixes failures.
- Test WriterWrites missing tests for new or changed code using the project's existing test framework and patterns.
- RefactorerPerforms behavior-preserving refactors in small verified steps.
- Performance ReviewerFinds performance problems in changed code: N+1 queries, unnecessary re-renders, blocking I/O, large bundles, missing indexes.
- Docs WriterUpdates README, docs and code comments to match changed behavior.
- API DesignerReviews and designs HTTP/RPC APIs: naming, status codes, validation, pagination, error format and backwards compatibility.
- Database Migration ReviewerReviews database migrations for locking, data loss, rollback safety and deploy ordering.
- Read-Only Database QueryAnswers questions about data by running read-only SQL queries.
- Dependency AuditorAudits project dependencies for known vulnerabilities, unused packages, duplicates and risky upgrades.
- Accessibility AuditorAudits UI code for accessibility (WCAG 2.2 AA): labels, keyboard access, focus, semantics, alt text and contrast.
- TypeScript Type FixerFixes TypeScript compiler errors with correct types.
- Lint FixerRuns the project linter and fixes all reported issues without disabling rules.
- Commit Message WriterWrites a commit message for the staged changes following the repository's convention.
- Pull Request Description WriterWrites a pull request title and description from the branch diff.
- Changelog WriterUpdates CHANGELOG.md from commits since the last release tag.
- Codebase ExplorerAnswers questions about how the codebase works: where things are defined, how data flows, which files to change.
- Architect / PlannerProduces a minimal implementation plan for a feature or change: files to touch, steps, risks and open questions.
- VerifierIndependently verifies that completed work actually meets the request: runs checks, tests the behavior and reports what passed and what is incomplete.
- Dockerfile ReviewerReviews Dockerfiles and compose files for size, caching, security and reproducibility.
- CI Failure FixerDiagnoses and fixes failing CI runs.
- i18n CheckerChecks UI code for internationalization problems: hardcoded strings, missing or unused translation keys, concatenated sentences, locale-unaware formatting.
- Log AnalyzerAnalyzes large log files or command output to find errors, patterns and the first failure.
- Next.js App Router ReviewerReviews Next.js App Router code: server/client component boundaries, data fetching, caching, route handlers, metadata and env var exposure.
- React Component ReviewerReviews React components for hook misuse, unnecessary effects, state placement, keys, re-render issues and component size.
- Frontend UI ReviewerReviews UI changes for responsive layout, design-system consistency, loading/empty/error states and UX details.
- Python ReviewerReviews Python changes for correctness, typing, exception handling, async misuse and resource management.
- Secrets ScannerScans staged changes for secrets such as API keys, tokens, private keys and connection strings.
- Dead Code FinderFinds unused exports, files, components, dependencies and stale feature flags.
- Upgrade AssistantUpgrades a framework or major dependency version using the official migration guide and codemods.
- AGENTS.md WriterCreates or updates AGENTS.md (and CLAUDE.md) from the actual repository: commands, structure, conventions and guardrails.
FAQ
Where do subagent files go?
Claude Code: .claude/agents/ in the project or ~/.claude/agents/ for all projects. Cursor: .cursor/agents/ or ~/.cursor/agents/. Cursor also loads .claude/agents/ and .codex/agents/ for compatibility.
Can one file work in both Claude Code and Cursor?
Mostly. Cursor reads .claude/agents/, and name, description and the prompt body carry over. But Cursor ignores Claude-only fields such as tools, and Claude Code ignores Cursor's readonly. For a read-only agent, keep a Cursor copy with readonly: true.
Which frontmatter fields are required?
Claude Code requires name and description. In Cursor both are optional (name defaults to the file name), but without a description the agent cannot decide when to delegate.
More AI dev guides: how to make videos with Claude Opus 5.5.