Getting Better Results
Claude Code is powerful enough to build almost anything. When results fall short, the cause is almost always the input. A few consistent habits change the quality of every response.
Quality in, quality out
Claude reasons from what you give it. A vague task produces a generic answer. A specific task with context produces precise, correct output. The model does not change — your input does.
Four habits that work
Apply all four and the improvement is dramatic. Even one or two makes a noticeable difference from day one.
| Habit | What to do | Why it helps |
|---|---|---|
| Think in features | Break every task into one specific, atomic feature per prompt. | Smaller scope = fewer assumptions = better code. |
| Be specific | Name files, libraries, patterns, expected behaviour, and error states. | Clear input removes guesswork about implementation. |
| Provide context | Use @filename and CLAUDE.md to share conventions once for all sessions. | Claude sees what you see without repeated explanations. |
| Test as you go | Verify each feature before requesting the next one. | Bugs caught early do not compound across later changes. |
See the difference
Same task, two prompts. One leaves Claude to guess, the other gives it everything it needs.
| Task | Instead of… | Try… |
|---|---|---|
| User authentication | “add user authentication” Claude does not know which library, files, or error states to use. | “Add email/password login to @app/api/auth/route.ts. Use NextAuth.js (already in @package.json). On success redirect to /dashboard. Show a red error under the form if credentials are wrong.” File, library, success path, and error UI are all defined. |
Providing context efficiently
The fastest way to improve results is to reduce what Claude has to assume. Two tools do this automatically.
@-mentions
Typing @ in the Claude panel opens a file picker. Claude reads the pinned file automatically. Use Alt+K (Windows) or Option+K (Mac) with selected text to add the exact line range.
CLAUDE.md
A CLAUDE.md file at the project root is read automatically every session. Put your stack, naming conventions, folder structure, and common patterns there.
Test as you go
Bugs compound quickly when you add new features on top of untested ones. A single verification step after each feature keeps the foundation solid.
- Build the feature — ask Claude to implement one specific thing and accept its changes.
- Ask Claude to test it — prompt: “Write a test for this that covers the happy path and the error case.” Run it.
- Fix before continuing — do not move to the next feature until this one works.
When results disappoint
Poor output is feedback about your prompt, not the model's capability. Here is how to course-correct quickly.
| Symptom | What to do |
|---|---|
| Output is generic or off-topic | Add more specificity — name the file, library, and expected behaviour. |
| Claude used the wrong library | Add a @package.json mention or note in CLAUDE.md which packages are in use. |
| Changes touched files you didn't want | Pin the exact file with @filename and say which files to leave alone. |
| The feature works but breaks something else | Ask Claude to write a regression test, or rewind to the last checkpoint. |
| Claude seems to have forgotten earlier context | Start a new conversation and re-attach the relevant file with @filename. |
Quick reference
| Practice | One-line rule |
|---|---|
| One feature per prompt | Smaller scope = better output |
| Name the file with @filename | No guessing which file to edit |
| Include existing packages | Prevents invented dependencies |
| Describe the error state | Edge cases get handled correctly |
| Write CLAUDE.md once | Conventions carry across sessions |
| Verify before continuing | Bugs caught early, not late |
Before you continue
- One feature per prompt — smaller scope produces better code.
- Name files, libraries, and error states so Claude does not guess.
- Use @filename and CLAUDE.md to share context automatically.
- Verify each feature before stacking the next change on top.
- Next: connect Claude Code to external tools via MCP.
What's Next
You're getting better results on every run. The next lesson connects Claude Code to your external tools via MCP — GitHub, databases, APIs, and more.