File: prompt-templates-and-variables.md | Updated: 11/15/2025
Agent Skills are now available! Learn more about extending Claude's capabilities with Agent Skills .
English
Search...
Ctrl K
Search...
Navigation
Prompt engineering
Use prompt templates and variables
Home Developer Guide API Reference Model Context Protocol (MCP) Resources Release Notes
On this page
When deploying an LLM-based application with Claude, your API calls will typically consist of two types of content:
A prompt template combines these fixed and variable parts, using placeholders for the dynamic content. In the Claude Console , these placeholders are denoted with {{double brackets}}, making them easily identifiable and allowing for quick testing of different values.
You should always use prompt templates and variables when you expect any part of your prompt to be repeated in another call to Claude (only via the API or the Claude Console . claude.ai currently does not support prompt templates or variables). Prompt templates offer several benefits:
The Claude Console heavily uses prompt templates and variables in order to support features and tooling for all the above, such as with the:
Let’s consider a simple application that translates English text to Spanish. The translated text would be variable since you would expect this text to change between users or calls to Claude. This translated text could be dynamically retrieved from databases or the user’s input. Thus, for your translation app, you might use this simple prompt template:
Copy
Translate this text from English to Spanish: {{text}}
Generate a prompt
-----------------
Learn about the prompt generator in the Claude Console and try your hand at getting Claude to generate a prompt for you.
Apply XML tags
--------------
If you want to level up your prompt variable game, wrap them in XML tags.
Claude Console
--------------
Check out the myriad prompt development tools available in the Claude Console.
Was this page helpful?
YesNo
Prompt generator Prompt improver
Assistant
Responses are generated using AI and may contain mistakes.