Claude Code Tips

29 tips

Things I use daily that most people miss, overlook, or just never knew existed.

Context #01

CLAUDE.md persists your instructions across every session

Claude Code reads CLAUDE.md from your project root — and from your home directory for global settings — at the start of every session. Coding conventions, architecture decisions, things Claude should never do: write them once and they're there every time. You stop repeating yourself; Claude starts with the right mental model from message one.

You can have both a global ~/.claude/CLAUDE.md and a project-level one. Both load — project instructions take precedence.

Memory docs
Context #02

A long CLAUDE.md is a diluted CLAUDE.md

CLAUDE.md gets inserted into the context window at session start. The longer it is, the more working memory it consumes — and the more likely important instructions get buried under irrelevant ones. Keep it to things that are genuinely non-obvious or would materially change Claude's behaviour. Move rarely-needed rules into scoped rule files instead.

Context #03

Use @ to split a large CLAUDE.md into focused modules

A @path/to/file reference inside CLAUDE.md inserts that file's content at that point — like an include directive. Use it to separate concerns: a top-level file that pulls in a coding-standards module, an architecture notes module, a "never do this" module. Each stays focused and easy to maintain independently.

# .claude/CLAUDE.md
@.claude/standards/coding.md
@.claude/standards/architecture.md
@.claude/rules/never.md
Context #04

@ a file in conversation to pull it into context immediately

Typing @src/auth/middleware.ts in your message tells Claude to read that file and include it in context right now — no separate read call needed. Useful when you know Claude needs to see a specific file rather than waiting for it to discover it through exploration. One caveat: large files eat context fast, so be deliberate.

Context #05

Rule files don't fire on file creation — only on reads and edits

Rule files are scoped to path patterns and only load when Claude reads or edits a matching file. The critical gotcha: creating a new file does not trigger rule files. If your .cs rule file defines how new classes should be structured, Claude won't see those rules when writing the file from scratch. This trips up experts and beginners alike.

If your rules need to apply to newly created files, include them in CLAUDE.md or explicitly reference them in your prompt.

Rule files docs
Context #06

Wrap large blocks of pasted context in XML tags

When you paste in logs, specs, or reference code, wrapping them in XML tags helps Claude treat them as structured data rather than prose. Instructions stay cleanly separated from data, and Claude is less likely to conflate what's a guideline with what's content to process.

<error_logs>
  [paste your logs here]
</error_logs>

<reference_implementation>
  [paste reference code here]
</reference_implementation>
Slash Commands #07

/compact summarises without losing your thread — and takes instructions

Instead of opening a new session when context fills up, /compact compresses the full conversation into a tight summary and continues from there. What most people don't know: you can pass instructions to shape what it keeps — focus on specific modules, ignore noisy output, preserve key decisions. Almost always the right move over starting fresh.

/compact keep focus on the auth module, discard the test output discussion
Slash Commands #08

Avoid /clear — it destroys context and breaks external tools

/clear wipes the entire conversation. Claude loses all accumulated context and reasoning, and tools like tokentelemetry that track session analytics lose their thread too. In almost every case /compact is what you actually want — it summarises rather than discards. Reserve /clear for when you're genuinely starting over on a completely unrelated task.

Slash Commands #09

/rename so you can actually find sessions later

Without a parameter, /rename generates a sensible name from context. With one, you make the session findable when you want to resume or reference it later. Unnamed sessions blur together fast — especially when you have several active at once.

/rename payment-integration-fix
Slash Commands #10

/color keeps parallel sessions from blurring together

When you're running several Claude Code sessions at the same time, it's easy to lose track of which terminal is which. /color recolors a session's UI so you can identify it at a glance when switching between terminals.

Slash Commands #11

/powerup is the best onboarding for new Claude Code users

An interactive tutorial that walks through Claude Code's core features hands-on. Far better than pointing a new colleague at documentation — let /powerup orient them first, then they'll know what to look up and why.

Slash Commands #12

/remote-control lets you manage Claude from your phone or another machine

Generates a link you can open anywhere to view Claude's progress and send messages — without being at the machine running it. This is how Anthropic's own engineers manage long-running tasks from the train, between meetings, or away from their desk.

Slash Commands #13

/desktop moves a session between the terminal and the desktop app

Started a session in the terminal but want the desktop UI? /desktop opens it there — and vice versa. Both views stay in sync, so you can switch to whichever is more convenient without losing any context or history.

Slash Commands #14

/handoff creates a self-contained briefing for handover or resumption

Compresses the current conversation into a structured document: context, decisions made, what's left to do. Use it to hand off to a subagent, resume in a fresh session later, or bring a teammate up to speed on exactly where things stand.

Slash Commands #15

/memory shows you exactly what Claude loads at session start

Opens the current CLAUDE.md so you can inspect or edit what Claude reads every time a session begins. Useful for debugging unexpected behaviour, checking which instructions are active, or auditing what's been accumulating over time.

Workflow #16

Escape interrupts Claude — and can roll back partial edits

Pressing Escape mid-response stops Claude immediately. What many people miss: if Claude was partway through making file edits, it will offer to roll back those partial changes. Useful the moment you realise the direction is wrong, before it finishes.

Workflow #17

Tab on a permission prompt lets you redirect, not just deny

When Claude asks for permission, most people just hit yes or no. Pressing Tab on any option opens a text field for a clarifying note. This is most powerful on No: you can redirect Claude to a different tool, explain a constraint, or describe the approach you want instead — turning a flat denial into a useful redirect.

Workflow #18

Let your formatter format — don't waste Claude's tokens on cosmetics

By default Claude writes code and then tidies it up, spending tokens (your money) on cosmetic changes your formatter will overwrite anyway. If you have cargo fmt, dotnet format, or prettier in your toolchain, tell Claude in CLAUDE.md to skip formatting. It works faster, you pay less, and the formatter does the job better.

Add something like never manually format code — the project uses cargo fmt to your CLAUDE.md.

Workflow #19

Changing model or effort mid-conversation invalidates the cache

Claude Code caches your conversation context so it doesn't re-send everything on every message. The moment you switch models or change the effort level, that cache is invalidated and you start paying full context cost again from scratch. Pick your model and effort at the start of a session, not mid-flight.

Workflow #20

Git worktrees let Claude work on multiple features simultaneously

Each worktree is an independent copy of your repo checked out on a different branch. Spin up a Claude Code session per worktree and you can have Claude working on separate features at the same time — no stash juggling, no accidental conflicts between sessions sharing a working directory.

Workflow #21

Start with ! to run shell commands without leaving the session

Typing !git status or !cargo test runs the command in your shell and streams the output directly into context. No need to switch terminal panes or paste output by hand. Great for quick checks without breaking your flow.

!git status
!cargo test 2>&1 | tail -20
Workflow #22

Haiku, Sonnet, Opus, Fable — and when to reach for each

Not all Claude models are suited to the same work. Use /model to switch and /effort to dial in thinking depth independently of the model.

  • Haiku 4.5 Fast and cheap. Great for repetitive tasks, file operations, and bulk edits where reasoning depth doesn't matter.
  • Sonnet 4.6 The daily driver. Balanced speed and capability — right for most coding tasks.
  • Opus 4.8 The heavyweight. Architecture decisions, tricky debugging, anything where deep reasoning matters.
  • Fable 5 Anthropic's newest. Strong at long-context understanding and multi-step planning.
Workflow #23

Enable showThinkingSummaries to see how Claude reasons

By default Claude Code collapses thinking and reasoning to keep output readable. Setting showThinkingSummaries: true in settings.json expands Claude's chain-of-thought inline — useful for debugging unexpected decisions or understanding why Claude took a particular path. You can also press Ctrl+O on any individual message to expand its reasoning on the spot without changing settings.

// ~/.claude/settings.json  (user)  or  .claude/settings.json  (project)
{
  "showThinkingSummaries": true
}
Workflow #24

Orchestrators, subagents, and why the distinction matters

Your main session is the orchestrator. It can spawn subagents to handle isolated, potentially noisy tasks — searching a large codebase, reading many files, running builds — and get back only a summary, keeping your context lean. Critical detail: subagents start cold with no memory of your session. Brief them like a smart colleague who just walked in: file paths, goal, constraints.

Workflow #25

Use Claude's built-in task list to stay oriented on complex work

For any task that spans multiple steps, ask Claude to maintain a task list. It tracks what's done, what's in progress, and what's left — giving you visibility at any point and keeping Claude from losing the thread on long-running work.

Hooks #26

Hooks are how you enforce security guardrails around tool calls

Hooks intercept Claude's tool calls before they execute. Common patterns: block writes to production paths, require confirmation before destructive operations, strip secrets from context, prevent pushes to main. Each hook runs a shell command on a matching event — if it exits non-zero, the tool call is blocked.

Hooks documentation
Hooks #27

Hooks don't have to be serious — Pixel Agents is proof

Hooks fire on tool events, which means any process can know exactly when Claude is doing something — and respond however it wants. Pixel Agents uses hook events to visualise an agent's activity in real time. A playful reminder that the mechanism isn't just for guardrails.

Pixel Agents
Tools #28

Warp's Claude Code integration is worth it even if you skip Warp AI

Warp is a terminal with deep AI integration — but even if you don't use Warp's own AI, the Claude Code-specific UX is genuinely useful: notifications when Claude needs your attention, better output rendering, and a developer experience tuned for AI-assisted workflows.

Warp terminal
Tools #29

tokentelemetry shows what your Claude sessions actually cost

tokentelemetry is a third-party tool that reads your local Claude Code session data and gives you a detailed breakdown of token usage — including thinking tokens that aren't visible in the standard UI. Another reason to avoid /clear: it fragments the session data that tokentelemetry relies on to compute accurate analytics.

tokentelemetry.com