Add a small, well-defined feature

State the endpoint and what it returns; Claude Code finds where similar endpoints live, adds yours alongside them with tests, and runs the suite.

Task: Add a small, well-defined feature · Other tasks

Fill in the details

Describe the output, not how to build it. Name fields and types if you already know them.

Optional. Limits, status codes or behavior the endpoint must have.

Optional. Leave empty and Claude will find how the project runs its tests.

Copy your prompt

This site doesn't run Claude or show model output. Results depend on your input and the model you use.

2 required fields are empty.

What you type is kept in this tab's session storage so a reload doesn't lose it. Use "Clear this task" to remove it. Browsers can restore session data when they reopen tabs, so closing a tab isn't a guaranteed way to erase it.

When to use this template

  • The feature is small and you can state its input and output in a sentence or two, such as a status endpoint, a new field in a response or a simple lookup.
  • The project already has endpoints of the same kind, so Claude can find them and follow their conventions instead of inventing new ones.
  • You want the change finished with tests, not just code that looks right.

When not to use it

  • The change spans several services, needs a data migration or has an unclear design. Plan it first with the plan template and review the file list.
  • You do not know what the endpoint should return yet. Settle the response shape with whoever will call it before asking for code.
  • The project has no similar code to follow, such as a first endpoint in a new service. Then describe the conventions you want, or point at another project to copy from.

Why this structure

  • The opening request states what the endpoint returns, not how to build it. Claude finds the routing and handler conventions itself, which is less to write and less to get wrong.
  • Step 1 asks Claude to follow nearby endpoints and name the one it used as the model, so you can check that it copied a current pattern rather than an old one.
  • Step 2 makes an existing path or an unclear response shape a reason to stop and ask. Those are the two places where a guess turns into a breaking change.
  • The access setting is explicit because authentication is easy to forget on a new route, and a public endpoint by accident is a security problem.
  • Tests for success and failure, plus a test run Claude repeats until it passes, give the work a clear finish line.
  • The final example request and response let you see the endpoint's behavior without reading the code first.

Example input (fictional)

Endpoint path
/health
What it returns
the app version and uptime in seconds, as JSON.
Access
public, with no authentication
Constraints
Must not query the database. Respond within 50 ms.
Test command
npm test -- routes

Follow-ups to send Claude

  • Add the new endpoint to the API docs or OpenAPI file in the same format as the others.
  • What happens if the version file is missing at startup? Add a test for that and handle it.
  • Commit this on a new branch with a message that explains why the endpoint exists. Do not push.

Common mistakes

  • Describing the implementation instead of the result. Telling Claude which file to edit and how often produces code that ignores the conventions the project already has.
  • Leaving the response shape vague. If field names and types matter to a caller, write them down; otherwise Claude picks names you may have to change later.
  • Skipping the failure test. A new endpoint that only has a success test can return the wrong status code for errors without anyone noticing.
  • Build something new from an existing pattern: Point Claude Code at code that already works the way you want, so the new feature matches its structure, naming, tests and error handling.
  • Build a small internal tool from scratch: Describe a small tool and Claude Code builds it as plain HTML, CSS and JavaScript files with no framework or build step, then opens it for you.
  • Work an issue end to end: Give Claude Code an issue number; it reads the full issue on GitHub, finds the cause, implements a fix with a test and runs the suite before reporting.

See all templates

Sources