Claude Code Best Practices

Habits that save tokens and get better results

Your setup already includes optimized settings. This guide covers the habits and commands that make the biggest difference in day-to-day use. Bookmark this page for reference.

The one thing to remember: Every message you send carries your entire conversation history. Longer conversations = more expensive messages. Keep sessions short and focused.

1. Session Habits

Keep sessions short High Impact

Every message re-sends the whole conversation so far, so each message in a long session costs more than the one before it. Start a fresh session (type /clear) for each new task. A few short sessions cost far less than one long one.

Start fresh before context gets high High Impact

Watch the context percentage in your status bar. When it passes about 40%, type end session, then /clear. Claude also suggests this once. Your notes are saved, so the fresh conversation picks up where you left off.

Why not wait? This setup turns off automatic compressing, so a very long conversation gets slower, costlier and more error-prone. Starting fresh keeps Claude sharp.

Never resume old sessions High Impact

Resuming a day-old conversation forces Claude to re-process the entire history at full price (the cache has expired). Multiple users reported losing 20-28% of their usage on a single resumed message. Start a new session instead.

Use /btw for side questions Medium Impact

The /btw command asks a question in a popup that never enters your conversation history. Perfect for quick questions like "what does this error mean?" without bloating your context. It uses noticeably less of your plan in question-heavy sessions.

If Claude seems confused, start fresh Medium Impact

After 2-3 failed attempts at the same fix, type /clear and write a better prompt that includes what you learned. A clean session with a good prompt beats a bloated session with accumulated confusion.

2. Writing Better Prompts

Be as specific as you can

When possible, point Claude to the specific file or area. For example, "the login page crashes when I leave email empty" is better than "something is broken". If you know the file name, even better: "Fix the bug in src/login.js". The more specific you are, the fewer tokens Claude uses searching.

Paste errors, don't describe them

Copy-paste the actual error message or output. Your description loses details Claude needs and costs extra tokens for less information.

One task at a time

Instead of "fix the login bug and also add a signup page and update the database schema", break it into separate requests. Each focused prompt gets better results and uses fewer tokens.

3. Model Selection

Claude Code can use different models. Matching the model to the task saves significant tokens.

ModelBest ForRelative Cost
Haiku File lookups, search, renaming, formatting 1x (cheapest)
Sonnet Daily coding, tests, simple edits ~2x
Opus Complex architecture, subtle debugging ~4x

Type /model sonnet or /model opus to switch mid-session. This setup uses opusplan: Opus while Claude plans, Sonnet while it does the work. That gives you careful plans without paying Opus prices for every step.

If a task is straightforward and you want even faster responses, type /effort low. For hard problems, type ultrathink in your message for one-off deep reasoning.

4. Commands Quick Reference

Essential

Useful

5. What NOT to Do

Don't resume old sessions

The cache expires after inactivity. Resuming reprocesses everything at full price. Start a new session instead.

Don't wait for context to fill up

At about 40%, type end session, then /clear. Don't let one conversation run on and on.

Don't use Opus for everything

Opus costs about 4x more per token than Haiku and 2x more than Sonnet. Most coding tasks work perfectly fine on Sonnet.

Don't keep iterating in a broken session

After 2-3 failed attempts, /clear and start over with a better prompt. Cheaper and usually more effective.