The hidden context problem
Artifact: the context you keep assuming and forgetting to state
1. The problem
Every prompt has two kinds of context: the part you typed, and the part you assumed.
You assumed: which language. Which framework. Which version. What your code style is. What your team's conventions are. What the constraints are. What the user is supposed to see. What the test suite already covers. What the failure looked like.
You typed: fix this.
The model can't read your mind. It only sees what you typed. So it makes up the rest, plausibly, and ships an answer for a slightly different problem from the one you have.
2. The leak, in one example
A real-shape debugging prompt, and the same prompt with context written in.
Why is this throwing?
async function fetchUser(id) {
const res = await db.query('SELECT * FROM users WHERE id = $1', [id]);
return res.rows[0];
}The model will offer five reasonable guesses: maybe db is null, maybe id is undefined, maybe Postgres isn't running, maybe the connection pool was exhausted, maybe an await is missing somewhere else. Some of those might match your situation. Most won't.
This function throws "TypeError: Cannot read properties of undefined" in production, intermittently — maybe 1 in 50 calls. Local tests always pass.
Stack: Node 20, node-postgres v8, Pool size 10. Column types match the schema (id is uuid).
I have not changed this function in three months. The issue started after we increased traffic 4x last week.
Why might this be intermittent under load?
async function fetchUser(id) {
const res = await db.query('SELECT * FROM users WHERE id = $1', [id]);
return res.rows[0];
}Now the model can do something a guess couldn't do: notice the keywords intermittently, 1 in 50, started after traffic increased, and converge on the actual class of problem (almost certainly a connection pool exhaustion or a stale connection returning an empty result). The answer goes from generic guess-list to specific diagnosis.
The change wasn't "ask better." The change was write the part you'd been assuming.
3. The default context checklist
A short list. Most prompts improve the moment you add even one of these:
- What kind of thing is this? Language, framework, runtime, library, version.
- What does success look like? Test passes, page renders, log line appears, JSON validates.
- What does the current behavior actually do? The exact error message, the screenshot, the unexpected output.
- What constraints can't change? Public API, existing tests, the database schema, the user-facing URL.
- What have you already tried? So the model doesn't suggest your last three failed attempts.
You don't need all five every time. You need the ones that would change the answer if the model knew them.
4. Try it
That one piece of context, added to your default prompt template, will lift the quality of every prompt you write after.