Lesson 5 / 25

Context Is Everything

Give the assistant the files, errors and conventions it needs, and nothing it does not.

It only knows what it sees

The assistant cannot see your whole mind or your whole project. Attach or reference the relevant files, paste the exact error message, mention the framework and versions, and point to an existing example of the style you want. Too little context produces generic code; too much buries the important part and costs tokens, so be selective.

Context, request, check

A good request names the goal, gives the right context, states constraints and says how success is checked.

Four parts: goal, context, constraints, check.
Figure 2.1 — Goal, context, constraints and check.

Weak vs strong request

The strong version names files, the exact failure and a pattern to follow, so the first answer is much closer to usable.

Weak:
  "fix my login bug"

Strong:
  "Login returns 401 for valid users since I upgraded to Express 5.
   Files: src/routes/auth.js, src/middleware/session.js.
   Error: TypeError: Cannot read properties of undefined (reading 'user')
   at session.js:14. Follow the error-handling style in src/routes/users.js.
   Do not change the database schema."

Paste errors, do not paraphrase

"It crashes on login" gives the assistant little to work with. The exact message with file and line number often leads straight to the cause.

Quick check: Which detail most improves a bug-fix request?

  • Saying "please" three times
  • The exact error message and the relevant files
  • A longer greeting
  • Capital letters
Answer

The exact error message and the relevant files — Concrete evidence lets the assistant reason about the real problem instead of guessing.