Brief a Coding Agent (Claude Code / Codex) on a Real Task
Write a precise task brief for an autonomous coding agent so it ships the right change without wandering across the codebase.
Get a self-contained brief — context, constraints, definition of done — that lets a coding agent work safely in an existing repo.
At a glance
Access
Free prompt
Open to copy — no account or payment needed.
Prompt objective
Get a self-contained brief — context, constraints, definition of done — that lets a coding agent work safely in an existing repo.
Real use case
A developer wants Claude Code to add rate limiting to an API, but a vague "add rate limiting" prompt risks the agent touching unrelated files or inventing a new framework.
Customize these fields first
Replace the placeholders with your own context before you run the prompt. That usually improves the first output more than adding more instructions later.
Prompt
You are writing a task brief for an autonomous coding agent (e.g. Claude Code or Codex) that will work directly in an existing repository. Repo / stack: [LANGUAGE, FRAMEWORK, KEY DIRS] Task: [WHAT TO BUILD OR FIX] Why: [THE UNDERLYING GOAL] Constraints: [WHAT IT MUST NOT CHANGE, STYLE, DEPENDENCIES ALLOWED] Write the brief with these labeled sections: 1. Objective in one sentence. 2. Exact scope: the files/areas it may edit, and the ones it must not touch. 3. Required approach or patterns to follow (reference existing code it should mimic). 4. Definition of done: observable acceptance criteria (tests pass, endpoint behaves, etc.). 5. Verification steps the agent should run itself (commands, tests) before declaring done. 6. Guardrails: do not add new dependencies without flagging, do not run destructive commands, do not commit/push unless asked. 7. What to report back: a summary of changes, files touched, and any decisions or open questions. Keep it specific enough that the agent does not need to ask follow-up questions to start.
Open directly in an AI — the text is pre-filled:
How to use this prompt
- 1Replace the key placeholders first: LANGUAGE, FRAMEWORK, KEY DIRS, WHAT TO BUILD OR FIX, THE UNDERLYING GOAL, WHAT IT MUST NOT CHANGE, STYLE, DEPENDENCIES ALLOWED.
- 2Replace any bracketed placeholders like [this] with your own context.
- 3Add extra background information when you want more tailored results.
- 4Combine multiple prompts in one conversation when you need a richer output.
- 5Save your best-performing prompts so they are easy to reuse later.
Next best step
Open the guide first, then branch only if you still need more.
A guide for technical builders choosing between prompts, coding workflows, and agent-based implementation.
If this prompt is close but not quite right, generate variants next. If the job is recurring, move into the course library after the guide.
Related prompts
View allPlan-Then-Execute Mode for a Coding Agent
Force a coding agent to produce and confirm an implementation plan before it edits a single file.
Best for
Prevent expensive wrong turns by separating planning from execution and getting a checkpoint before changes land.
Turn a Coding Agent into a Test-First TDD Partner
Direct a coding agent to write failing tests first, then implement just enough code to pass them.
Best for
Get higher-quality, regression-resistant changes by enforcing a red-green-refactor loop with the agent.
Debug with an Agent Using a Hypothesis-Driven Loop
Guide a coding agent to debug systematically — form a hypothesis, add instrumentation, test it, narrow down — instead of random edits.
Best for
Find the real root cause faster by forcing structured, evidence-based debugging rather than shotgun fixes.
Explore other prompt categories
Move sideways into adjacent libraries when the current category is not the full answer.
Every prompt here is free. The course teaches the thinking behind them.
Copy as many prompts as you like. When you want to move from single prompts to a repeatable AI workflow, Learn AI in 30 Days walks through it, one day at a time.
Buy the course once ($15/$20 by length), or go all-access for $10/mo with a verifiable certificate.