Claude Code tips: 20 habits and settings for faster, safer sessions

Claude Code tips: 20 habits and settings for faster, safer sessions

The Claude Code tips that matter most are about information and verification: tell Claude what it can't see in the repo, give it a check that passes or fails, and stop it early when it drifts. This guide collects 20 habits and settings from the official docs and daily use, plus the older advice you can drop now that models have caught up.

In shortTL;DR
  • Write specific prompts: name the file, the symptom and what "fixed" means, and use @path to hand over files instead of describing them.
  • Keep CLAUDE.md under 200 lines with only what Claude can't learn from the code: test commands, gotchas, decisions made outside the repo.
  • Give Claude something to run that passes or fails, ask for the output as evidence, and get a fresh reviewer with /code-review.
  • Press Esc the moment Claude drifts, use /rewind to undo, and after two failed corrections run /clear and write a better prompt.
  • Use /effort instead of "think harder", deny rules or hooks instead of CAPITALIZED instructions, and /clear between unrelated tasks.

What are the most useful Claude Code tips?

The most useful Claude Code tips fix the four reasons sessions go wrong: Claude lacks information it can't find in the repo, it has no way to check its work, a rule needed enforcing rather than asking, or a default cost more time or tokens than the task was worth. Anthropic's best practices page is organized around the same four problems.

Defaults already handle a lot. As of November 2026, new terminal and VS Code sessions start in auto mode, run Claude Opus 5.5 at medium effort on most plans, delegate to subagents when useful, and compact the conversation before the context window fills. The tips below are for when the defaults aren't enough.

SymptomLikely causeTips
Claude built something other than what you meantMissing information1 to 7
Claude said "done" and it wasn'tNo check to run8 to 10
Claude went down the wrong path for ten minutesNobody stopped it11 to 14
Too slow, too many prompts, too many tokensA default that doesn't fit15 to 18
You wait on one session at a timeNo parallel or unattended setup19 and 20

If you are new to the tool, start with the Claude Code commands cheat sheet; this guide assumes you know the basics.

How should you prompt Claude Code?

Prompt Claude Code with the facts it can't read from the code: where the problem is, what you observed, and what done looks like. Claude reads your repository well, so describing your file layout adds little, while one sentence about the symptom saves a round of corrections.

Tip 1: Name the file, the symptom and the finish line.

Weak promptBetter prompt
fix the login bugusers report login fails after the session times out. look at token refresh in src/auth/, write a failing test that reproduces it, then fix it
add a calendar widgetfollow the pattern in HotDogWidget.php and build a calendar widget that lets you pick a month and page between years. no new libraries

Both better prompts come from the official docs. Each one says where to look, what to prove, and what is off limits.

Tip 2: Hand things over instead of describing them. Type @ and a path to include a file. Paste a screenshot of the design or the error with Ctrl+V (Cmd+V in iTerm2). Pipe command output from your shell: cat error.log | claude -p "what's going on here". Start a line with ! to run a shell command and put its output in the conversation.

Tip 3: Say "be ambitious" when you want the full version. Claude reads requests conservatively and builds the smallest thing that satisfies them. The docs suggest stating scope directly:

prompt
build the settings page from the mockup. be ambitious: empty and error states, the save flow wired up, keyboard navigation, not only the layout

Tip 4: Let Claude interview you before big features. When you haven't worked out the details, ask for questions first, then build from the written spec in a fresh session:

prompt
I want to add rate limiting to the public API but haven't thought it through yet. Interview me until you could write the spec, then write it to SPEC.md.

The fresh session starts with a clean context and a written definition of done, and SPEC.md becomes the yardstick for review later (tip 10).

How do you keep CLAUDE.md useful?

Keep CLAUDE.md short and limited to what Claude can't work out from the code, because it loads into every session and every line competes for attention. The memory docs recommend staying under 200 lines per file.

200lines: the recommended maximum for each CLAUDE.md file
100most recent checkpoints kept per session for /rewind
$13average cost per developer per active day in enterprise deployments
Source: Claude Code docs (memory, checkpointing, costs), November 2026

Tip 5: Write only what passes this test. Could Claude find it by reading the code, and would it go and look? If both answers are yes, leave it out. What belongs:

  • The exact test, typecheck and lint commands, including how to run one test file
  • Misleading code: an old pattern new code must not copy, a directory that looks dead but isn't
  • Decisions made outside the repo: the error helper the team picked, how deploys work
  • Anything you have corrected twice
CLAUDE.md
# Commands- Install: pnpm install- Run one test file: pnpm vitest run path/to/file.test.ts- Typecheck: pnpm tsc --noEmit# Conventions- Use the error helpers in src/lib/errors.ts, never throw raw strings- src/legacy/ is still live but don't copy its patterns into new code# Gotchas- Integration tests need DATABASE_URL set, see .env.example

Run /init to generate a first draft, then delete most of it. Run /context in a session to confirm the file loaded. Personal preferences go in CLAUDE.local.md, added to .gitignore. Our CLAUDE.md best practices guide goes further.

Tip 6: Scope rules to the folders they apply to. A rule that matters only for the API goes in .claude/rules/api.md with a paths: filter such as src/api/**/*.ts, so it loads only when Claude works there.

Tip 7: Put procedures in skills. A release checklist or incident runbook belongs in .claude/skills/<name>/SKILL.md. Claude sees only the name and description until a task needs the skill. For anything with side effects, add disable-model-invocation: true so it runs only when you type the command yourself.

How do you give Claude Code a way to check its work?

Give Claude Code a command that comes back pass or fail, such as a test file, a build, a linter or a script that compares output to a fixture. With a check, Claude can make a change, run it, read the failure and fix it without you acting as the test suite.

Tip 8: Put the check in the prompt, and ask for evidence. "Run the auth tests after, and keep going until they pass" works with no setup. Then ask for the command and its output, not a summary. "All tests pass" tells you little; the output shows what ran.

Tip 9: Get a reviewer that didn't write the code. /code-review reviews the diff in a fresh subagent that never saw your conversation. To check against your plan instead of hunting for general bugs, write the review prompt yourself:

prompt
use a subagent to review the rate limiter diff against SPEC.md, check every requirement is implemented and the listed edge cases have tests, report gaps that affect correctness and skip style

Keep "skip style". A reviewer asked to find problems always finds something, and fixing every nitpick adds abstraction nobody needed.

Tip 10: Turn "must pass" into a hook. A line in CLAUDE.md saying "always typecheck" works most of the time. A Stop hook works every time, because Claude Code runs it whenever Claude tries to finish and sends Claude back to work if it exits with code 2:

.claude/settings.json
{  "hooks": {    "Stop": [      {        "hooks": [{ "type": "command", "command": "pnpm tsc --noEmit 1>&2 || exit 2" }]      }    ]  }}

The same logic applies to rules with zero exceptions: never edit migrations/, always format after editing. Make them hooks or deny rules. The Claude Code hooks guide has seven recipes.

How do you steer a Claude Code session?

Watch the first minute of every task and interrupt as soon as Claude heads somewhere you didn't intend. A few controls do most of the work, and they are worth knowing by heart.

Close-up of code on a dark editor screen
Most wasted sessions show the wrong direction in the first minute

Tip 11: Press Esc early. Esc stops Claude mid-action and keeps the work done so far, so you can redirect with one sentence. You can also type a message while Claude works; it is queued and sent at the end of the turn.

Tip 12: Try the bold approach, then rewind. Every prompt creates a checkpoint. Press Esc twice on an empty prompt or run /rewind to restore the code, the conversation or both. Per the checkpointing docs, files changed only by shell commands aren't tracked, so keep using git.

Tip 13: After two failed corrections, start over. A third correction adds to a conversation that already holds two failed attempts. Run /clear and write one new prompt that includes what you learned. /clear oauth-migration names the session you leave, so you can come back to it later with /resume.

Tip 14: Plan before large changes. Press Shift+Tab to cycle permission modes until the status bar shows plan mode, or start a single prompt with /plan. In plan mode Claude reads and explores but doesn't edit your source, and you approve the plan before it starts.

Shortcuts worth memorizing, from the interactive mode reference:

Key or prefixWhat it does
EscStop Claude and keep its work so far
Esc EscOpen the rewind menu (on an empty prompt)
Shift+TabCycle permission modes, including plan mode
Ctrl+GEdit your prompt in your text editor
Ctrl+BMove a running command or agent to the background
Ctrl+SStash the current prompt, press again to restore it
!Run a shell command and share its output
@Include a file or folder
/btwAsk a side question without adding it to the history

Which Claude Code settings make sessions faster and cheaper?

Effort level, permission mode and session hygiene decide most of a session's speed and cost. Check /usage before changing anything: on subscription plans it breaks down usage by skill, subagent, plugin and MCP server and flags patterns such as long context.

Tip 15: Use /effort, not "think harder". The best practices describe effort as the main control for how long Claude thinks; phrases like "be thorough" only nudge within it.

SettingUse it for
/effort lowBrainstorming, first sketches, renames you review step by step
medium (default)Everyday feature work with clear scope
/effort high or xhighBugs in unfamiliar code, flaky tests, schema changes with many readers
/effort maxHard problems you want worked through unattended, such as security hunts
ultrathink in a promptOne hard question without changing the setting

For the model, the default Opus 5.5 handles most coding, Sonnet costs less on routine work, and Haiku suits simple subagent jobs. Switch with /model.

Tip 16: Keep auto mode, add deny rules. Auto mode lets a classifier approve routine actions and block risky ones such as curl | bash, production deploys and force pushes over other people's work. A classifier can be wrong, so "never" rules go in deny rules, which apply in every mode:

.claude/settings.json
{  "permissions": {    "allow": ["Bash(pnpm tsc --noEmit)"],    "ask": ["Bash(git push *)"],    "deny": ["Read(./.env)", "Read(./.env.local)", "Read(./secrets/**)"]  }}

If you prefer manual mode, /fewer-permission-prompts scans recent sessions and allowlists your common read-only commands.

Tip 17: /clear between unrelated tasks. Every request sends the whole conversation, so a session holding three old tasks pays to reread them on every turn of the fourth. /clear costs nothing. Use /compact with a focus, such as /compact keep the API changes and the test commands, when you continue the same task.

Tip 18: Trim what loads every session. Connected MCP servers add their tool descriptions to context even when unused, so disable the ones you don't need under /mcp. Prefer a CLI Claude already knows, like gh, when one exists. Watch your plan's limits with the help of our guide to Claude Code usage limits.

How do you run Claude Code in parallel or unattended?

Run parallel work in separate git worktrees so edits can't collide, and give unattended runs a definition of done, a check, limits and a person who approves the result. These two habits let you stop waiting on one session at a time.

Tip 19: One worktree per task. claude -w feature-auth starts a session in a new worktree. A worktree is a fresh checkout, so list small gitignored files you need (like .env) in a .worktreeinclude file at the repo root, and keep the install command in CLAUDE.md. Our guide to git worktrees for parallel agents covers the workflow, and a second session reviewing the first one's work is the cheapest independent review you can get.

Tip 20: Answer five questions before you walk away. The docs list them for any unattended run:

  1. Does it know what done looks like? A spec, a goal or a failing test to turn green.
  2. Can it check its own work? Tests, a Stop hook, a review step.
  3. What may it touch? Permission rules, the sandbox, a worktree, one branch.
  4. What stops it? --max-turns or --max-budget-usd with claude -p, or a spend limit.
  5. Where does the result go, and who signs off? A pull request and a person who merges it.

For scripted runs, claude -p with --allowedTools, --permission-mode dontAsk and --max-turns is the core pattern; see Claude Code headless mode. Long runs also need a machine that stays awake. Orkio rents an always-on, isolated cloud box where Claude Code keeps working after you close your laptop, using your own Claude account, and the work comes back as pull requests you review from your phone or the web.

Which old Claude Code tips should you stop following?

Several popular tips were workarounds for older models and now cost more than they save. Anthropic's own best practices list them under "What you can stop doing."

Old adviceWhy to drop it now
Manage the context window aggressivelyMost current models have a 1M-token window and compact automatically. Still /clear between tasks for focus and cost.
Add IMPORTANT or ALL CAPS to rulesCurrent models follow plain wording; emphasis makes Claude over-apply rules. Use a hook or deny rule for hard rules.
Use subagents to protect contextSubagents help with parallel work, noisy output and fresh review, and each one costs tokens.
Delegate to a subagent for a better answerSame model, same task, same answer. A fresh reviewer helps; plain delegation doesn't.
"think hard", "be thorough"Use /effort. ultrathink still works for one turn.
"Keep going, don't be lazy"Models finish agreed tasks; these lines cause over-work. Give a check to pass instead.
Describe your architecture in CLAUDE.mdClaude reads the repo. Write down only what isn't there.

A 10-minute Claude Code setup checklist

Do these once per repository and most of the tips above apply without thinking about them:

  1. Run /init, cut CLAUDE.md to the commands, gotchas and decisions Claude can't find, and confirm it loads with /context.
  2. Add deny rules for .env and secrets in .claude/settings.json, and commit it.
  3. Add a Stop hook for your fastest meaningful check, such as the typecheck.
  4. Move any multi-step team procedure into a skill.
  5. Disable MCP servers you don't use in this project.
  6. Start the next feature with "interview me" and a SPEC.md, build in a fresh session, and finish with /code-review against the spec.

Frequently asked questions

How do I make Claude Code faster?

Lower the effort level with /effort low for quick back-and-forth work, and clear the session with /clear between unrelated tasks so each request carries less history. Let auto mode handle routine approvals instead of approving every command by hand, and run independent work in parallel sessions using git worktrees.

How do I stop Claude Code from asking for permission all the time?

New terminal and VS Code sessions start in auto mode, where a classifier approves routine actions and blocks risky ones. If you prefer manual mode, run /fewer-permission-prompts to add your common read-only commands to an allowlist, or add allow rules to .claude/settings.json. Keep deny rules for anything that must never happen.

Should I use /compact or /clear in Claude Code?

Use /clear when you switch to an unrelated task, because it costs nothing and starts the next task without old history. Use /compact with a focus, such as /compact keep the API changes and test commands, when you want to keep going on the same task. Compaction also happens automatically as the context fills.

Do phrases like think harder still work in Claude Code?

They are ordinary prompt text now. The real control is the effort level, set with /effort low, medium, high, xhigh or max. The keyword ultrathink still asks for deeper reasoning on a single turn without changing your effort setting.

How do I undo changes Claude Code made?

Press Esc twice on an empty prompt or run /rewind to open the checkpoint menu, then restore the code, the conversation or both. Checkpoints only cover files changed with Claude's file editing tools, so changes made by shell commands need git. Commit before risky work.

SOURCES

  1. Claude Code docs: Best practices
  2. Claude Code docs: How Claude remembers your project
  3. Claude Code docs: Choose a permission mode
  4. Claude Code docs: Checkpointing
  5. Claude Code docs: Interactive mode
  6. Claude Code docs: Manage costs effectively
  • #claude code
  • #ai coding
  • #productivity
  • #terminal
Orkio team

The team building Orkio. We write about putting AI to work: coding agents that run overnight, always-on boxes and pull requests ready by morning.

Keep reading

All posts

07:06 · YOU MERGED #128

Go to sleep. Wake up to pull requests.

Start for $19 a month
© 2026 Orkio · Hosted in Europe TürkçeStatus