Prompt templates let you define reusable instruction patterns for tasks. Instead of writing the same boilerplate in every task description, create a template and apply it automatically.
How Templates Work
A template is a text block with optional variables that get replaced when a task starts. The rendered template is prepended to the task description before sending to Claude.
You are working on the {{project_name}} project.
Task type: {{task_type}}
Priority: {{priority}}
Always write tests for new code.
Follow the existing code style.
Commit with descriptive messages.
Variables
Templates support these built-in variables:
| Variable | Resolves To |
|---|
{{project_name}} | The project’s name |
{{task_title}} | The task’s title |
{{task_type}} | feature, bugfix, refactor, etc. |
{{priority}} | low, medium, high, urgent |
{{model}} | opus, sonnet, haiku |
Task Type Defaults
Assign a default template to each task type. When a new task of that type is created, the template is automatically applied:
| Task Type | Example Template Focus |
|---|
feature | Architecture guidelines, test requirements |
bugfix | Reproduce first, minimal fix, add regression test |
refactor | No behavior changes, maintain test coverage |
docs | Follow style guide, update table of contents |
test | Coverage targets, edge cases, mocking strategy |
Model and Effort Presets
Templates can also specify default model and thinking effort values. When applied, these override the task defaults unless the user explicitly changes them.
Create a “quick fix” template with haiku model and low effort for trivial tasks, and a “deep feature” template with opus and high effort for complex work.
Managing Templates
Create, edit, and delete templates via project settings or the Templates API.