Re-Read Instructions
Re-Read Instructions
Intent
Tell the model to pay attention to its original prompt, and check if it’s digressing from the goal you set.
Motivation
Large Language Models (LLMs) display “completion bias”, in which they attempt to progress rapidly towards a solution to the problem stated in your original prompt. This completion bias comes in part from your coding assistant’s system prompt, which tells the model to solve your problem. Models also demonstrate “context anxiety”, introduced in training, in which the model tries to avoid filling its context window—even in situations where the context is far from full.
Completion bias manifests in taking shortcuts; for example, generating stub implementations, or asserting that tests work when they compile but don’t run or pass. Other symptoms include early termination, in which the model marks tasks on its to-do list as complete and generates a final summary of its work without completing or even starting the tasks. These symptoms mean that even though the LLM’s goal is to quickly generate output that satisfies the prompt, it might provide an incomplete or incorrect solution, then finish its output stream.
Additionally, LLMs process tokens unidirectionally; processing later tokens can incorporate attention to earlier tokens, but doesn’t modify the attention score for those tokens. As such, repeating the prompt gives the model an opportunity to re-evaluate the attention it pays to tokens in the prompt, based on information added to the context after you initially sent the prompt.
Applicability
Use Re-Read Instructions when your coding assistant reports that it’s finished its task, and You Review to decide that there’s still a gap between your intention and the generated output.
For example, consider a prompt that requires that the agent generate implementation code and tests, and that the tests should pass.
The agent runs the tests and they fail, but reports that the main task was to write the production code, so it marks the testing step as complete and finishes the overall task.
In this situation, you could Call Out Error and prompt the model to fix the tests. Alternatively, Re-Read Instructions to prompt the model to consider the whole problem statement in your original prompt, in the context of the subsequent interaction.
Consequences
Re-Read Instructions offers the following benefits:
- Close the gap between the model’s output and your original problem statement.
- Correct issues without re-stating the instructions.
- Get the model to pay attention to the problem description in the context of the stream of tokens you and the model created.
Implementation
Get a model to Re-Read Instructions by pasting your original prompt back into your coding assistant. This is a special example of Model Reviews, in which you tell the model to review the generated output by re-stating the instructions you originally gave it.
You typically don't use a Clean Slate, so that the model’s attention layer evaluates the re-stated prompt in the context of your interaction and the generated output it created in your session. If the model displays context anxiety or your coding assistant indicates that the context actually is relatively full, or you’re observing symptoms of attention problems such as the agent forgetting instructions, you can Re-Read Instructions in a Clean Slate. In this interaction, the model compares the state of your code with your instructions without any information already in its context, and therefore without an existing bias towards accepting the state as complete.
In situations where use of the model is an expensive resource, for example if you pay a per-token cost for using a model, repeated use of Re-Read Instructions can increase the total cost of your interaction. You might change to using local inference with a model that you run on your own computer, or Intervene and fix problems yourself between iterations of Re-Read Instructions.
Examples
Ralph Wiggum Loop
The ralph tool iteratively applies Re-Read Instructions to attempt to get a model’s output to converge to a point where it satisfies your requirements.
You provide a problem statement, which the model separates into components, called “stories” (in other words, it applies Write Down TODOs). Then, in a loop, ralph takes the first uncompleted story, and prompts the coding assistant to implement it. When the agent finishes, ralph runs quality checks. If the checks pass, then it marks that story as complete and moves on to the next story. Otherwise, it applies Re-Read Instructions, using the description of the same, uncompleted story as the prompt for the next iteration.
ralph also uses Remember What We Did to provide a persistent “memory” between iterations of the loop.
Task-Review Skill
This markdown prompt defines a skill that causes a model to Re-Read Instructions by generating its original user prompt in its output, then comparing the current state of its project with that prompt:
---
name: task-review
description: Reviews the user's original prompt and the current state of the project. Use when deciding whether you have completed the user's task.
---
Repeat the initial instructions that the user gave you to the user. Compare the current state of the code with those instructions, and determine what work is needed to complete the task the user requested. If there isn't anything to do, just say PASSED.
A skill is a way to define behavior that you can prompt an agent to apply, or that the agent can dynamically discover and use. Many coding assistants use the Agent Skills standard to define skills.
Store this file in ~/.agent/skills/task-review/SKILL.md.
Use the slash command /task-review in a coding assistant that supports skills, for example Claude Code or Mistral Vibe, to prompt the agent to Re-Read Instructions.
The source code for the above example is available at SKILL.md.
No comments to display
No comments to display