Prompt
The text you give a model to act on: the instruction, plus whatever context is attached to it. In agent tools the visible prompt is only the last part of a much larger request the harness assembles from system instructions, project files, and conversation history.
At a glance
- Is
- The instruction a model acts on
- Sent with
- System prompt, tools, files, history
- Good prompts state
- Goal, location, constraints, done
- Durable rules belong in
- CLAUDE.md or AGENTS.md
- Not the same as
- The system prompt
How it works
When you type a message into a coding agent, the model receives far more than that message. The harness builds a request from the system prompt (the tool's own instructions), descriptions of every available tool, your project's instruction files such as CLAUDE.md or AGENTS.md, the conversation so far including earlier tool results, and finally what you just typed.
That is why the same sentence can produce different results in different tools, or in the same tool an hour later: the surrounding request changed even though your words did not.
Why it matters
For a coding task, a good prompt answers four questions: what outcome you want, where in the code it belongs, what constraints apply, and how to tell when it is done. Pointing at an existing file to imitate is often worth more than a paragraph of description, because models copy patterns well.
Keep durable facts out of individual prompts. If you find yourself repeating the test command or a naming rule, it belongs in the project's instruction file, where every session picks it up. And when a long session has gone confused, starting fresh with a clearer prompt often works better than adding more corrections.
Order and emphasis matter less than they used to, but clarity still does. Put the goal first, name concrete files and commands rather than describing them, and say explicitly what should not change, since a model asked to fix one thing will sometimes tidy up three others.
Prompt versus system prompt
The system prompt is written by whoever built the tool and sits at the start of every request, setting role, rules and tool usage. Your prompt is the user turn: the specific request for this task. You control the user prompt and, through instruction files, part of the context, but usually not the tool's system prompt itself.
Common mistakes
- Giving a vague goal such as "clean this up" and leaving the model to guess what better means.
- Burying the one constraint that matters among ten that do not.
- Bundling several unrelated changes into one prompt, which makes the result harder to review and easier to get half right.
Related terms
Frequently asked questions
What is the difference between a prompt and context?
The prompt is the instruction you write. Context is everything else in the request, such as files, history and tool output, that the model uses to carry it out.
How long should a prompt be?
Long enough to state the goal, the location, the constraints and the check for done. For most coding tasks that is a few sentences, with details that never change kept in an instruction file instead.