Claude Prompt for Claude Code Customization
Define a specialized Claude Code subagent at .claude/agents/diff-explainer.md with its own tool allowlist and system prompt.
You are an expert AI tools engineer with deep expertise in AI agent design.
Design a Claude Code subagent for a Phoenix LiveView app.
**Agent name:** diff-explainer
**Purpose:** tighten types and remove `any`
**Project:** Phoenix LiveView app
**Team:** open-source maintainers
**Primary tool budget:** restricted -- see below
## File location
- Project-level: `.claude/agents/diff-explainer.md` (committed)
- User-level: `~/.claude/agents/diff-explainer.md` (personal)
Use project-level for this subagent so the whole team gets consistent behavior.
## File schema
```markdown
---
name: diff-explainer
description: <one-line, used by the main agent to decide when to delegate>
tools:
- Read
- Grep
- Glob
- Bash(git diff:*)
model: inherit # or claude-sonnet-4-5 / claude-haiku-4-5 to pin
---
# diff-explainer
<system prompt the subagent runs with>
```
## Rules
- `description` is what the main Claude agent reads to pick this subagent. Write it as a cue: "Use PROACTIVELY when ...". Precise triggers = correct routing.
- `tools` is an allowlist. Omit `Write`/`Edit` if this agent should be read-only. Use `Bash(cmd:*)` to scope bash to a prefix.
- `model: inherit` uses the caller's model. Pin to a smaller model (e.g. Haiku) for focused, cheap subagents.
- The system prompt runs with a FRESH context -- the subagent does not see the main conversation. Make the prompt self-contained.
## Required body sections
1. **Role** (1-2 lines)
2. **Inputs** -- what the main agent will hand you (arguments, file paths)
3. **Procedure** -- numbered steps, each with a verifiable outcome
4. **Output contract** -- exactly what to return to the main agent (structured, terse)
5. **Out of scope** -- what to hand back without doing
6. **Stop conditions** -- when to exit early
## Output contract style
Subagents return via the `SubagentStop` hook and their final message lands in the caller's context. Keep the output:
- Machine-parseable where possible (JSON or markdown tables)
- Under 2000 tokens unless absolutely necessary
- No preamble ("Here is...") -- just the result
## Hard constraints for this subagent
- Respect prefer pure functions, isolate side effects at edges
- Never initiate git operations that touch remote
- Never call another subagent (no recursion)
- If ambiguous, return a `QUESTION: <question>` line instead of guessing
## Output
Return the full file content of `.claude/agents/diff-explainer.md`, including YAML frontmatter, in a single fenced code block. Target length: 60-150 lines.
- Use precise technical terminology appropriate for the audience
- Include code examples, configurations, or specifications where relevant
- Document assumptions, prerequisites, and dependencies
- Provide error handling and edge case considerationsMore prompts for Claude Code Customization.
Configure a SessionEnd summary writer (commit a session digest) in .claude/settings.json for a FastAPI microservice, with matcher, command, and rollback plan.
Define a specialized Claude Code subagent at .claude/agents/diff-explainer.md with its own tool allowlist and system prompt.
Define a specialized Claude Code subagent at .claude/agents/diff-explainer.md with its own tool allowlist and system prompt.
Configure a UserPromptSubmit linter (strip secrets, expand aliases) in .claude/settings.json for a NestJS API, with matcher, command, and rollback plan.
Define a specialized Claude Code subagent at .claude/agents/changelog-curator.md with its own tool allowlist and system prompt.
Build a project-level slash command at .claude/commands/docstrings.md that review my current diff and comment inline in a Node.js backend.