How to set up Claude Code: a context-first approach

8 minute read

This is a concise, actionable guide of how to set up and use Claude Code as a power user. I’ve collated this advice from a bunch of different external sources (documentation, @bcherny, other tech blogs), as well as my own usage.

This guide is kept intentionally brief – to dive deeper into any specifics, follow the relevant links.

Guiding principle

The single insight that drives all the advice below is that context management is everything. The name of the game is “how do I make sure Claude Code always has access to the right information it needs to solve the immediate problem, no more, no less?”.

This is because:

  1. Context windows are scarce (and expensive) resources that are easy to use up
  2. Even within the window limit, longer contexts significantly degrade performance
  3. Too little context does not give Claude enough information to solve the problem

Anthropic explicitly acknowledges this at the top of their Best Practices documentation:

Most best practices are based on one constraint: Claude’s context window fills up fast, and performance degrades as it fills. (…) The context window is the most important resource to manage.

Key features

Claude Code has a couple of key features that let you extend it to work more effectively for your projects. From the documentation:

  • CLAUDE.md adds persistent context Claude sees every session
  • Skills add reusable knowledge and invocable workflows
  • MCP connects Claude to external services and tools
  • Subagents run their own loops in isolated context, returning summaries
  • Agent teams coordinate multiple independent sessions with shared tasks and peer-to-peer messaging
  • Hooks run outside the loop entirely as deterministic scripts

CLAUDE.md, Skills and Subagents are similar features, with their key differentiation being how they use Claude Code’s context:

  • CLAUDE.md is a text file with a set of instructions (prompts) for how Claude is supposed to act. It is expensive in terms of context because it is loaded into the context window at the start of every session.
  • Skills are also text files, but only their metadata (name and description) are loaded into the context every session. During a session, Claude may realise that it needs to use a Skill (say the Skill description is ‘use me when you need to git commit’). When it does, it will pull the full contents of the Skill.md file into its context. This ’lazy loading’ makes Skills very context efficient, so it’s preferable for longer instructions wherever possible. Skills can also be invoked manually with slash commands, which is useful for prompts you use repeatedly.
  • Subagents are entirely new, ‘clean’, sessions of Claude Code that spin up in parallel, perform a task, and return a summary to the main conversation. This makes them very context efficient, but any working is lost and they lack the parent session’s context – so they work best for self-contained tasks where only the answer matters.

When to use each feature:

  • CLAUDE.md for instructions you need in every conversation, kept ideally as brief as possible.
  • Skills for longer sets of instructions that are not needed persistently.
  • Subagents for isolated tasks, where you only care about the ‘answer’ not the work.

An illustrative example:

  • CLAUDE.md: “Follow our API conventions”
  • Skill.md: “Our API conventions are …”
  • Subagent: “Read through Twilio’s API docs and compare the pricing models for SMS vs WhatsApp”

Hooks, MCPs, and agent teams are important features, but they are not meaningfully related to context management. They are covered in the documentation.

Workflow

Using Claude Code well has two parts – what you do within Claude Code sessions (in loop) and what you do outside sessions (meta loop). For each, there are four things that matter most. There are many smaller optimisations1, but these are the ones that matter most.

In loop

1. Plan (almost) everything

Plan Mode is useful for two main reasons. First, it gets your conception of what you want out of your head and into Claude’s context, allowing Claude to be more useful. Second, it is helpful for the same reason planning is generally helpful – anticipating the steps you need to take towards a goal often reshapes the goal itself.

If the task is really complex, ask Claude to spin up a subagent / fresh session and ‘review the plan as a staff engineer’. The only time to avoid Plan Mode is for very straightforward tasks like committing changes.

2. Verify

Claude can fix most mistakes itself if it understands what it’s supposed to be aiming for. Without verification you become the bottleneck, having to test or review every change and tell Claude where it is going wrong. With verification, Claude can self-correct and run independently, which is where the real value comes from.

Classic test suites are useful because they have deterministic, well-specified pass/fail conditions. This sort of testing only works when you’re able to narrowly specify the behaviour you want for each feature, which can be done, but is a lot of work.

One of the real superpowers of LLMs is that you can create ‘vibe tests’. Tell Claude to navigate to your website on Chrome and see if the changes match the screenshot of the Figma mockup you’ve uploaded. Give it links to a bunch of websites, and tell it to create something that looks similar. ‘Vibe tests’ are less reliable, but they’re easy, quick, and useful when you don’t know what exactly you want.

Two tips: make sure verification is part of Claude’s plan, and get Claude to write your test suite if you’re able to specify exactly what you want.

3. Keep the context focused

Don’t be afraid to use ‘/clear’. If you’ve had to step in and redirect it more than a couple of times or if it’s just filled up with unrelated context, use ‘/clear’. If you need to preserve the plan, note down the path to the plan, and give it to the new session.

If you do want to go down an unrelated tangent but don’t want to pollute the context, ask Claude to “use a subagent to investigate X”.

4. Parallelise Claude

This is likely the single thing that will multiply your productivity the most. But it is worth getting used to using Claude effectively in a single session first. Parallelisation is expensive and can get complicated.

Until recently, the meta for parallelisation was to use git worktrees and multiple terminals running Claude Code. With Opus 4.6, using Claude’s Agent Teams with git worktrees is the new best way to do this together.

Meta loop

5. Run Claude with permissive allowlists

Claude can’t run independently if it has to ask you every time it wants to run a command. For day to day use, my default is to have a relatively permissive allowlist in my user-level settings. On the infrequent occasion I need something more secure for a certain project, I’ll override these permissions in project-level settings.

If I want to run something to run overnight or without any supervision, I’ll use the –dangerously-skip-permissions flag, sometimes in a sandbox. Warnings apply.

6. CLAUDE.md is your living doc

Good CLAUDE.mds are as minimal as possible. As a rule they shouldn’t include things Claude can learn by reading the files in your codebase (note this includes your README – project purpose and usage goes here, not in CLAUDE.md). CLAUDE.mds should include custom bash commands and utilities, non-standard code style guidelines, env setup, test instructions, etc.

Good CLAUDE.mds start off barebones and evolve in response to the mistakes that Claude makes. When Claude makes a mistake, just ask it to add the heuristic to its CLAUDE.md. Start off with a blank CLAUDE.md instead of using /init, which tends to bloat CLAUDE.md.

Good CLAUDE.mds are also project-scoped – a heuristic like “Use relative links for internal references.” may be useful in one project but not another. User-level CLAUDE.md’s are almost never useful because the guidelines you put in it have to be non-obvious enough that Claude doesn’t know it while also generalisable enough to apply to all your projects. Even “use uv, not pip” only applies to your Python projects.

7. Create skills for repeated workflows

Skills are amazingly useful because they are so context efficient. Experiment with them and make new Skills liberally. As a rule, anytime you notice yourself doing a task more than once a day, create a Skill for it. Set disable-model-invocation: true in the Skill’s metadata if you only want to invoke the Skill manually.

8. Connect to other apps you use in your workflow

Claude Code really powers up once it can seamlessly fit into the rest of your workflow, and use the tools that you use. Connect it to Github, Slack, BigQuery, Sentry, … There’s a whole world of custom workflows and advanced usage with these tools, some of which will be perfectly suited towards your particular setup.

Setup guide

  1. Download Claude Code and authorise

  2. Configure settings and permissions

  3. Download some useful Skills from the plugin marketplace

    Plugins allow for easy distribution of Skills/Subagents/Hooks/MCPs. The /plugin command brings up available Claude Code extensions you can install from the default marketplace.

    Some plugins I recommend:

    • code-simplifier (slash command to clean code)
    • commit-commands (workflows for git commits)
    • context7 (pulls updated docs rather than relying on Claude built-in knowledge – includes an MCP)
    • frontend-design (specifies front-end design aesthetic)
    • pyright-lsp (LSP for Python)
    • Note if you copy my entire settings file, you will also add these plugins
  4. Start working on a project

    The best way to get used to this workflow is through actually working on a project.

    Try follow the in-loop workflow guidelines, turning to the meta-loop workflow when appropriate, and start building real things. You’ll figure out the rest as you go. Save parallelising for when you’re used to using Claude Code in a single session effectively, have a big project, and a large token budget.

References


  1. Small tips

    • Use Opus for everything
    • Consider voice input (fn twice on Mac). You can speak 2-3x faster than you can type.
    • Automate deterministic tasks with hooks. Repeatable operations like code formatting are better handled by hooks that run outside the conversation loop.
    • Use --resume and --continue to continue where you left off.
    • Enable explanatory output style for learning. The config setting adds educational context to Claude’s responses. For visual concepts, ask Claude to render HTML or draw ASCII diagrams.
    • Enable Claude in Chrome with /chrome for ‘vibe testing’ UIs and other browser-based tasks (warning, it’s quite slow)
     ↩︎