15 practical Claude Code tips for experienced developers
The patterns and habits that separate fast, confident Claude Code usage from frustrating trial-and-error.
By CB Patel
These are habits that make Claude Code sessions feel smooth instead of frustrating.
- Start every task with a plan request
Instead of:
add authentication to my app
Do:
I want to add GitHub OAuth via Supabase. Before writing any code, explain your plan: which files you'll create, which you'll modify, and any assumptions you're making about the existing setup.
You'll catch wrong assumptions before they become wrong code.
- Use /clear aggressively between tasks
Context in Claude Code degrades as sessions get long. When you finish one task and start another unrelated one, run /clear first. The agent will re-read your current file state fresh and give better results than if it's still holding context from an hour ago.
Exception: don't clear if the new task depends on what you just did — multi-step tasks benefit from shared context.
- Paste error messages verbatim, never describe them
Wrong:
there's a type error somewhere in my auth code
Right:
Type 'string | undefined' is not assignable to type 'string'.
at lib/supabase/server.ts:24:18
Paste the full error with the file and line number. Claude Code reads your files, so it can go straight to that line.
- Ask for tests before the implementation
before implementing the sortByDate function, write the unit tests for it. I'll review them, then you write the implementation.
This forces clarity about what the code should do before any code is written. It's also how you catch specification ambiguity — if Claude Code's tests don't match your mental model, your spec was unclear.
- Use "only change X, don't touch Y"
Claude Code sometimes helpfully refactors things you didn't ask it to refactor. Prevent this:
fix the race condition in the fetchUser function. only change that function. do not touch the auth middleware or the session handling.
Scope constraints are essential on large, interconnected codebases.
- Read the CLAUDE.md file pattern
Create a CLAUDE.md file in your project root with always-on instructions:
# Project context
This is a Next.js 14 App Router project using Supabase for auth and data.
Always use Server Components where possible.
Never use any in TypeScript — use unknown or specific types.
Run npm run typecheck after making TypeScript changes.
Commit message format: feat(scope): description
Claude Code reads this automatically at the start of every session. You write it once, and it applies to every session. Think of it as the always-loaded counterpart to a project skill.
- "What would break if..." questions
what would break if I changed the User type to make email optional?
what would break if I moved the auth middleware from the root to the app/ directory?
These are faster and safer than just making the change and finding out. The agent can trace dependencies across your codebase.
- Commit after every successful change
Claude Code doesn't make commits automatically. Build the habit of committing after every successful agent-produced change:
the auth flow is working. commit it with a conventional commit message.
Clean commit history means clean git bisect when something breaks. And something will break.
- Use --dangerously-skip-permissions only in isolated environments
In Manual mode, Claude Code asks for permission before it edits files or runs terminal commands (npm install, running tests, etc.). To cut down the prompts on your own machine, switch permission modes instead: press Shift+Tab during a session, or start in one.
claude --permission-mode acceptEdits
acceptEdits lets Claude edit files and run common filesystem commands without asking. --dangerously-skip-permissions skips every prompt, and Anthropic's documentation says to use it only in isolated environments such as containers, VMs, or dev containers without internet access.
- Multi-file tasks need explicit file lists
refactor the user authentication to use a token-based approach instead of sessions. the relevant files are: lib/auth.ts, middleware.ts, app/api/auth/[...]/route.ts, and components/auth-provider.tsx. start with lib/auth.ts.
Telling the agent exactly which files are relevant prevents it from guessing and potentially modifying the wrong ones.
- Use structured output for code review
review the following function for: 1) correctness (does it do what the comment says?), 2) performance (any obvious O(n²) issues?), 3) error handling (unhandled edge cases?). format your review as a numbered list under each category.
Structured review requests get structured, actionable answers.
- Ask it to explain code you wrote
This sounds obvious but is underused. If you wrote something complex six months ago:
explain what the middleware chain in middleware.ts is doing, step by step. assume I've forgotten the context.
Claude Code reads the file and gives you a prose explanation. Faster than re-reading your own comments, especially when the code is dense.
- The "rubber duck" pattern
When you're debugging and stuck:
I'm trying to understand why this function returns undefined when the user is authenticated but the session is valid. here's what I know: [paste what you've already tried]. what are the likely causes I haven't checked?
The act of explaining the problem structured clearly, combined with the agent's cross-file knowledge, often surfaces the answer immediately.
- Skills are reusable context — install them once
For any tech stack you use regularly, find the matching skill on ClaudeSkill and install it:
for s in react-hooks-toolkit typescript-strict-coder nodejs-express-api; do curl -fsSL --create-dirs -o ~/.claude/skills/$s/SKILL.md https://claudeskil.com/skills/$s/SKILL.md; done
These give Claude Code expert knowledge of your exact stack without you re-explaining it: Claude loads each one when a request matches its description.
- Build your own project skill
After a few months on a project, you know its patterns better than any generic skill. Write a SKILL.md for your project:
---
name: my-startup-app
description: Conventions for our Next.js 14 / Supabase SaaS app — App Router, TypeScript strict, shadcn/ui components, Stripe for billing, Resend for email. Use for any code change in this repository.
---
## Rules
- Always use Server Components unless interactivity is required
- Use Zod for all form validation and API input parsing
- Payment flows must go through /api/stripe — never client-side
- Run npm run typecheck before considering a TS task done
Save it as .claude/skills/my-startup-app/SKILL.md and commit it — Claude Code picks it up in every session in that project, for you and your team.