Use when a request is ambiguous, underspecified, or could be read more than one way — before writing code based on a guess. Makes the agent surface the ambiguity and either ask or state the assumption it's making, instead of silently picking one interpretation and building the wrong thing.
Use when the user is learning and wants to understand the code, not just receive it — they're new to the language, framework, or to coding agents in general. Makes the agent briefly explain what each change does and why, in plain language, so the user learns from every edit instead of blindly accepting it.
Use at the start of any non-trivial coding task — before writing code for a new feature, a fix, or a change that spans more than a couple of lines or files. Makes the agent state a short plan and confirm direction before implementing, so you catch a wrong approach in 3 sentences instead of 300 lines.
Use when about to modify code in a file or function you haven't actually read yet — making a change in an unfamiliar or existing part of the codebase. Makes the agent read the surrounding code first so the edit matches existing patterns and doesn't break nearby logic.
Use when editing existing code — making a fix, adding a feature, or changing behavior in a file that already has working code. Enforces minimal, scoped diffs so the agent changes only what the task requires and never refactors, reformats, or "improves" untouched code.
Use after making a code change and before telling the user it is finished or working. Forces the agent to actually check the change — run the test, build, or a concrete trace of the logic — and report real results, instead of optimistically claiming success it hasn't confirmed.
Use when restructuring existing code without intending to change its behavior — extracting functions, renaming across files, splitting modules, or swapping an implementation. Makes the agent pin current behavior with tests first, change in small verified steps, and prove behavior is unchanged, so a "cleanup" never silently breaks something.
Use after writing or modifying code that handles untrusted input, authentication, authorization, secrets, file paths, database queries, shell commands, or outbound requests — before treating it as done. Makes the agent review its own change for common vulnerabilities instead of shipping them.