Claude Code · Workflow

The 5 Claude Code problems I hit on every new project

Every new codebase goes through the same friction with Claude Code. I've set up enough projects now that I recognize these in the first hour and know how to fix each one.

1. Claude refactors things you didn't ask it to touch

You ask Claude to add a new API endpoint. It adds the endpoint, updates the existing ones for "consistency," renames a helper function, and adds type annotations to a file you weren't looking at. The new endpoint works. Now you have a 400-line diff instead of a 40-line one.

Fix in CLAUDE.md:

Minimal footprint. Only touch files directly related to the task.
Do not refactor adjacent code, add comments to unchanged files,
or fix things "while you're in there."

2. Claude stops to ask permission before every command

You ask for a five-step task. Claude does step one, then asks if you want it to continue. You say yes. It does step two, then asks again. Every round trip breaks the flow and makes autonomous work impossible.

Fix in CLAUDE.md:

Do not ask for confirmation before running shell commands or making edits.
Execute and report what you did.

Also add to .claude/settings.json:

{ "defaultMode": "acceptEdits" }

3. Claude creates files in the wrong place

New utility function in utils.ts instead of src/lib/utils.ts. New component in components/ instead of src/components/ui/. New test in the project root instead of __tests__/. Claude knows generic project structures but not yours.

Fix in CLAUDE.md:

When uncertain about file location or naming, ask before creating.
Do not guess.

Project structure:
- Components: src/components/
- Utilities: src/lib/
- API routes: app/api/
- Tests: __tests__/ (mirror source structure)

4. Claude marks work complete when tests are failing

Claude implements a feature, says "done," and moves on. You run the test suite and four tests are failing. Claude either didn't run tests, ran them and misread the output, or considered partial completion acceptable.

Fix in CLAUDE.md:

After any implementation, run the existing tests and report results.
Do not mark work complete if tests fail.
If a test was already failing before your change, note that explicitly.

5. Claude creates duplicates of things that already exist

A second Button component. A third date formatter. Another auth helper. Claude doesn't search the codebase for existing solutions before writing new ones — it just writes. After a few sessions you have duplicated logic scattered across the project.

Fix in CLAUDE.md:

Before implementing a new function or component, search for an existing one
that does the same thing. Only create code that doesn't already exist.

These five rules go in every project before the first session. They cover the failure modes that show up within the first hour of working with Claude Code on a new codebase.

More patterns like these — 25 total, with the reasoning behind each one — are in the Agent Prompt Playbook. $29.