← Back to library

▶ quest log

Make a Coding Agent Ask Whether the Code Should Exist

Claude Code / Skills◆ Intermediate◆ Advanced@chase.h.aisaved JUN 16

◇ Could this help me?

Yes for the principle, with the numbers discounted. Reaching for the standard library, a built-in, or an existing dependency before writing new code is ordinary good engineering, and making a coding agent state that reasoning out loud before it writes is a smart way to counter a model's default eagerness to produce something. Two corrections: fewer lines of code is a proxy rather than a goal, and optimizing hard for brevity can produce dense code that is harder to read and test, so treat the six questions as a prompt for judgment rather than a target; and the performance claims come from the project's own benchmarks, so run them yourself before repeating them. General practice, and note the six questions can be adopted directly in a project's instructions without installing anything.

✦ Walkthrough+10 xp / step
0 / 12 steps · adopt for +40
$ suggested_prompt+40xp

Before you write any code for this task, work through six questions and give me your answer to each: does this code need to exist at all, does the standard library already do it, is there a built-in tool that solves it, is it a native platform feature, is it already covered by a dependency this project installs, and can it be reduced to a single line. Only if every answer is no, write the minimum code that makes it work. Show me the reasoning before the code, and if you do write something, tell me what you deliberately left out and why. Prefer clarity over brevity where the two conflict.

More from Claude Code / Skills

Enter world →