dor4.net

Best practices for Claude Code

Claude Code is a command-line coding assistant. Like any capable tool, it pays off to use it deliberately. These practices apply regardless of language or project size.

Give it context, once

Keep a short project file that describes how to build, test and run the project, plus any conventions a newcomer would need. The assistant reads it at the start of a session, so a few accurate lines save a lot of repeated explanation. Keep it current — stale instructions are worse than none.

Work in small, verifiable steps

Ask for one focused change at a time and check it before moving on. Small steps are easier to review, easier to undo, and make it obvious where something went wrong. A large, vague request tends to produce a large, vague diff.

Verify before you trust

Treat generated code as a draft until you have run it. Run the build, run the tests, and read the diff yourself. The assistant writes plausible code quickly, which is exactly why a real check matters: plausible is not the same as correct.

Keep everything in version control

Commit in small, logical units with clear messages. A clean history lets you review changes, bisect problems and roll back safely. It also gives the assistant a stable base to work from instead of an ambiguous pile of edits.

Be specific about intent

State the goal and the constraints, not just the symptom. “Make the parser reject empty input and add a test for it” leads somewhere; “fix the parser” does not. Concrete acceptance criteria turn a guess into a checkable result.

Review, don’t rubber-stamp

Read what you accept. The point of an assistant is to go faster while staying in control — not to hand over judgement. The final responsibility for what ships is still yours.