PromptPreview
APPENDIX-1appendix

Chaining Prompts

The saying goes, "Writing is rewriting." It turns out, Claude can often improve the accuracy of its response when asked to do so!

There are many ways to prompt Claude to "think again". The ways that feel natural to ask a human to double check their work will also generally work for Claude. (Check out our prompt chaining documentation for further examples of when and how to use prompt chaining.)

Examples

Example 1
User Prompt
Name ten words that all end with the exact letters "ab".
Response
Response will be generated by the LLM
Prompt Template
{{CONVO_HISTORY}}
User: Please find replacements for all "words" that are not real words.
Variables
Substituted Prompt
#ERROR!
User: Please find replacements for all "words" that are not real words.
Response
⚠️=CLAUDEMESSAGES prompt should be in "User: ...
Assistant: ..." format, with "User: ..." first and a newline before each subsequent role. For newlines, press Ctrl/Cmd+Enter⚠️
Prompt Template
{{CONVO_HISTORY}}
User: Please find replacements for all "words" that are not real words.
Variables
Substituted Prompt
User: Name ten words that all end with the exact letters "ab".
Assistant: 1. Cab
2. Dab
3. Grab
4. Gab
5. Jab
6. Lab
7. Nab
8. Slab
9. Tab
10. Blab
User: Please find replacements for all "words" that are not real words.
Response
Response will be generated by the LLM
Example 4
User Prompt
Write a three-sentence short story about a girl who likes to run.
Response
Response will be generated by the LLM
Prompt Template
{{PAST_STORY}}
User: Make the story better.
Variables
Substituted Prompt
#ERROR!
User: Make the story better.
Response
⚠️=CLAUDEMESSAGES prompt should be in "User: ...
Assistant: ..." format, with "User: ..." first and a newline before each subsequent role. For newlines, press Ctrl/Cmd+Enter⚠️
Example 6
User Prompt
Find all names from the below text:

"Hey, Jesse. It's me, Erin. I'm calling about the party that Joey is throwing tomorrow. Keisha said she would come and I think Mel will be there too."
Assistant Prefill
<names>
Response
Response will be generated by the LLM

Playground

Editable

Try modifying these prompts and sending them to your configured LLM provider.

Try it yourself
Try it yourself
{{CONVO_HISTORY}}=#ERROR!
Try it yourself
{{CONVO_HISTORY}}=User: Name ten words that all end with the exact letters "ab". Assistant: 1. Cab 2. Dab 3. Grab 4. Gab 5. Jab 6. Lab 7. Nab 8. Slab 9. Tab 10. Blab
Try it yourself
Try it yourself
{{PAST_STORY}}=#ERROR!
Try it yourself