How I use Claude Code

| 9 min read


I’ve been a huge fan of Claude Code ever since it was released.

The first time I tried it, I was amazed by how good it was. But the token costs quickly turned me away. I couldn’t justify those exorbitant costs at the time.

Since Anthropic enabled using Claude.ai subscriptions to power your Claude Code usage, it has been a no-brainer for me. I quickly bought the Max tier to power my usage.

Since then, I’ve used Claude Code extensively. I’m constantly running multiple CC instances doing some form of coding or task that is useful to me. This would have cost me many thousands of dollars if I had to pay for the usage. My productivity has noticeably improved since starting this, and it has been increasing steadily as I become better at using these agentic coding tools.

From throwaway projects…

Agentic coding gives the obvious benefit of taking on throwaway projects that you’d like to explore for fun. Just yesterday, I downloaded all my medical records from the Danish health systems and formatted them so an LLM would easily understand them. Then I gave it to OpenAI’s o3 model to help me better understand my (somewhat atypical) medical history. This required barely 15 minutes of my time to set up and guide, and the result was fantastic. I finally got answers to questions I’d been wondering about for years.

There are countless instances where CC has helped me do things that are useful, but not critical enough to be prioritized in the day-to-day.

To serious development

What I’m most interested in is how I can use tools like Claude Code to increase my leverage and create better, more useful solutions. While side projects are fun, they are not the most important thing to optimize. Serious projects (usually) have existing codebases and quality standards to uphold.

I’ve had great experience using Claude Code, AmpCode, and other AI-coding tools for these kinds of projects, but the patterns of coding are different:

  • Context curation is critical: You have to include established experience and directional cues beyond task specifications.
  • You guide the architecture: The onus is on you to provide and guide the model to create designs that fit well in the context of your system. This means more hand-holding and creating explicit plans for the agentic tools to execute.
  • Less vibe-coding, more partnership: It’s more like an intellectual sparring partner that eagerly does trivial tasks for you, is somehow insanely capable in some areas, can read and understand hundreds of documentation pages in minutes, but doesn’t quite understand your system or project without guidance.

Patterns and tips for agentic coding

Much of this advice can be boiled down to:

  • Get good at using the tool you’re using
  • Build and maintain tools and frameworks that help you use these agentic coding tools better. Use the agentic tools to write these

Your skills and productivity gains from agentic coding tools will improve exponentially over time.

Here’s my attempt at boiling down some of the most useful patterns and tips I’ve learned using Claude Code extensively.

1. Establish and maintain a CLAUDE.md file

This can feel like a chore but it’s insanely useful and can save you a ton of time.

Use # as the prefix to your CC prompt and it’ll remember your instructions by adding them to CLAUDE.md.

Put CLAUDE.md files in subdirectories to give specific instructions for tests, frontend code, backend services, etc. Curate your context!

Your investment in curating files like CLAUDE.md, or procedures as in (7) and scripts (11), is the same as investing in your developer tooling. Would you code without a linter or formatter? Without a language server to correct you and give feedback? Or a type checker?
You could, but most would agree that it’s not as easy, nor productive.

2. Use the commands

A few useful ones:

  • Plan mode (shift+tab). I find that this increases the reliability of CC. It becomes more capable of seeing a task to completion.
  • Verbose mode (CTRL+R) to see the full context Claude is seeing
  • Bash mode (! prefix) to run a command and add output as context for the next turn
  • Escape to interrupt and double escape to jump back in the conversation history

3. Run multiple instances in parallel

Frontend + backend at the same time is a great approach. Have one instance build the frontend with placeholder/mocked API & iterate on design while another agent codes the backend.

You can use Git worktrees to work on the same codebase with multiple agents.
It’s honestly more of a pain than gain when you have to spin up multiple Docker Compose environments, so just use a single Claude instance in that kind of project. Or just don’t have multiple instances of the project running at the same time.

4. Use subagents

Just ask Claude Code to do so.

A common and useful pattern is to use multiple subagents to approach a problem from multiple angles simultaneously, then have the main agent compare notes and find the best solution with you.

5. Use visuals

Use screenshots (just drag them in). Claude Code is excellent at understanding visual information and can help debug UI issues or replicate designs.

6. Choose Claude 4 Opus

Especially if you’re on a higher tier. Why not use the best model available?

Anecdotally, it’s a noticeable step up from Claude 4 Sonnet – which is already a good model in itself.

7. Create project-specific slash commands

Put them in .claude/commands.

Examples:

  • Common tasks or instructions
  • Creating migrations
  • Project setup
  • Loading context/instructions
  • Tasks that need repetition with different focus each time

@tokenbender wrote a great guide to their agent-guides setup that shows this practice.

8. Use Extended Thinking

Write think, think harder, or ultrathink for cases requiring more consideration, like debugging, planning, design.

These increase the thinking budget, which gives better results (but takes longer).
ultrathink supposedly allocates 31,999 tokens.

9. Document everything

Have Claude Code write its thoughts, current task specifications, designs, requirement specifications, etc. to an intermediate markdown document. This both serves as context later and a scratchpad for now. And it’ll be easier for you to verify and help guide the coding process.

Using these documents in later sessions is invaluable. As your sessions grow in length, context is lost. Regain important context by just reading the document again.

10. For the Vibe-Coders

USE GIT. USE IT OFTEN. You can just make Claude write your commit messages. But seriously, version control becomes even more critical when you’re moving fast with AI assistance.

11. Optimize your workflow

  • Continue previous sessions to preserve context (use --resume)
  • Use MCP servers (context7, deepwiki, puppeteer, or build your own)
  • Write scripts for common deterministic tasks and have CC maintain them
  • Use the GitHub CLI instead of fetch tools for GitHub context. Don’t use fetch tools to retrieve context from GitHub. (Or use an MCP server, but the CLI is better).
  • Track your usage with ccusage
    • It’s more of a fun gimmick if you’re on Pro/Max tier – you’ll just see what you ‘could have’ spent if you were using the API.
    • But the live dashboard (bunx ccusage blocks --live) is useful to see if your multiple agents are coming close to hitting your rate limits.
  • Stay up to date via the docs – they’re super good

12. Aim for fast feedback loops

Provide a verification mechanism for the model to achieve a fast feedback loop. This usually leads to less reward-hacking, especially when paired with specific instructions and constraints.

Reward hacking: when the AI takes shortcuts to make it look like it succeeded without actually solving the problem.
For example, it might hardcode fake outputs or write tests that always pass instead of doing the real work.

13. Use Claude Code in your IDE

The experience becomes more akin to pair-programming, and it gives CC the ability to interact with IDE tools, which is very useful. E.g. access to lint errors, your active file, etc.

14. Queue messages

You can keep sending messages while Claude Code is working, which queues them for the next turn. Useful when you already know what’s next.

There’s currently a bug where CC doesn’t always see this message, but it usually works. Just be aware of it.

15. Compacting and session context length

Be very mindful of compacting. It reduces the noise in your conversation, but also leads to compacting away important context. Do it preemptively at natural stopping points, as compression leads to information loss.

16. Get a better PR template

This is more of a personal gripe with the template itself.

Use another PR template than the default. It seems like Claude 4/CC was instructed to use a specific template, but that template sucks. “Summary → Changes → Test plan” is OK but it’s better to have a PR body tailored to your exact PR or project.

Beyond Coding

Claude Code can be used for more than just code.

  • Researching docs → writeup (e.g. to use for another sessions context)
  • Debugging (it’s really good at this!)
  • Writing docs after completing features
  • Refactoring
  • Writing tests
  • Finding where X is done (e.g. in new codebases, or huge codebases you’re unfamiliar with).
  • Using Claude Code in my Obsidian vault for extensive research into my notes (journals, thoughts, ideas, notes, …)

Things to watch out for

Security when using tools

Be VERY careful about the external context you inject into the model, e.g. by fetching via MCPs or other means. Prompt injection is a real security concern.
People can write malicious prompts in e.g. GitHub issues and have your agent leak unintended information or take unprecedented actions.

Vibing

I’ve still yet to see a case where full-on, automated vibe-coding for hours on end makes sense. Yes, it works, and you can do it, but I’d avoid it in production systems where people actively have to maintain code. Or, at least review the code yourself.

Model variability

Sometimes it feels like Anthropic is using quantized models depending on model demand. It’s as if the model quality can vary over time. This could be a skill issue, but I’ve seen other users report similar experiences. While understandable, it doesn’t feel great as a paying user.

Running Claude Code

I can’t help but tinker and explore the tools I use, and I’ve found some interesting configurations to use with Claude Code.

Some of the environment variables I’m using aren’t publicly documented yet, so this is your warning that they may be unstable.

Here’s a bash function I use to launch Claude Code with optimized settings:

function ccv() {
  local env_vars=(
    "ENABLE_BACKGROUND_TASKS=true"
    "FORCE_AUTO_BACKGROUND_TASKS=true"
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=true"
    "CLAUDE_CODE_ENABLE_UNIFIED_READ_TOOL=true"
  )
  
  local claude_args=()
  
  if  "$1" == "-y" ; then
    claude_args+=("--dangerously-skip-permissions")
  elif  "$1" == "-r" ; then
    claude_args+=("--resume")
  elif  "$1" == "-ry"  ||  "$1" == "-yr" ; then
    claude_args+=("--resume" "--dangerously-skip-permissions")
  fi
  
  env "${env_vars[@]}" claude "${claude_args[@]}"
}
  • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=true: Disables telemetry, error reporting, and auto-updates
  • ENABLE_BACKGROUND_TASKS=true: Enables background task functionality for long-running commands
  • FORCE_AUTO_BACKGROUND_TASKS=true: Automatically sends long tasks to background without needing to confirm
  • CLAUDE_CODE_ENABLE_UNIFIED_READ_TOOL=true: Unifies file reading capabilities, including Jupyter notebooks.

This gives you:

  • Automatic background handling for long tasks (e.g. your dev server)
  • No telemetry or unnecessary network traffic
  • Unified file reading
  • Easy switches for common scenarios (-y for auto-approve, -r for resume)

Liked this post? Join the newsletter.

Get notified whenever I post something new.