LLM Guide

LLM & Claude Code Usage Guide

Practical tips for getting the most out of LLMs and Claude Code.

TL;DR:

  1. Get a Max subscription — Pay-as-you-go will bankrupt you. Max 100+ pays for itself immediately.
  2. Write a CLAUDE.md — Build commands, style rules, “do NOT” rules. Close the feedback loop.
  3. Install Skills & MCP serversskills.sh for domain expertise, MCP for tool access.
  4. Manage your context — Use /clear between subtasks. Offload heavy work to subagents.
  5. Set up pre-hooks — Auto-block dangerous commands, scan for secrets, lint on write.
  6. Use plan mode for non-trivial tasks — Plan first, execute second. /clear between tasks.
  7. Document big tasks — Spec docs + TODO files survive across sessions. Claude can’t remember, but it can read.
  8. You can combine subagents with skills, skills with other skills and so on.

1. Use a Subscription Plan (Unless You Enjoy Bankruptcy)

Claude API usage on pay-as-you-go pricing adds up fast — especially with Opus. A single heavy coding session can cost more than a monthly subscription.

This brings us to another important question: which harness to use? Anthropic is known to be very strict about using their subscription plans with harnesses other than Claude Code or stuff that doesn’t use the Anthropic Agent SDK — they can ban your account if you use it with stuff like OpenCode. This sucks and limits your options to Claude Code basically.

What to do:


2. Write a Good CLAUDE.md

CLAUDE.md is your project’s instruction manual for Claude. It’s loaded into the system prompt every session, so Claude follows your rules without you repeating yourself.

Why it’s important: instruct the model to complete the feedback loop! Tell it to run the build + typechecks/tests after significant changes, check stuff with Playwright or agent-browser and so on. You’ll avoid a ton of mistakes and frustrations if you set the feedback loop correctly.

Everyone is moving to standardize the file as AGENTS.md, but Anthropic seems reluctant so far. All other harnesses support AGENTS.md.

Where it lives:

What to put in it:

npx @next/codemod agents-md --output CLAUDE.md

This produces a structured index the model can search through at runtime. Why this works.

Tips:

Example snippet (from Apache Airflow’s AGENTS.md):

# AGENTS instructions

The main developer documentation lives in the `contributing-docs` directory. The following points summarise
how to set up the environment, run checks, build docs and follow the PR workflow.

## Local virtualenv and Breeze

- [`07_local_virtualenv.rst`](contributing-docs/07_local_virtualenv.rst) explains how to prepare a local
  Python environment using `uv`. The tool creates and syncs a `.venv` and installs dependencies with
  commands such as `uv venv` and `uv sync`.
- [`06_development_environments.rst`](contributing-docs/06_development_environments.rst) compares the local
  virtualenv with the Docker based Breeze environment. Breeze replicates CI and includes services like
  databases for integration tests.

## Running tests

- Use `pytest` inside the container for individual files or invoke `breeze testing` commands to run full
  suites, e.g. `breeze --backend postgres --python 3.10 testing tests --test-type All`.

## Pull request guidelines

- Follow the PR guidance in [`05_pull_requests.rst`](contributing-docs/05_pull_requests.rst). Always add
  tests, keep your branch rebased instead of merged, and adhere to the commit message recommendations from
  [cbea.ms/git-commit](https://cbea.ms/git-commit/).

3. Use Skills and MCP Servers

Claude Code becomes dramatically more useful when you extend it with Skills (reusable prompt-based capabilities) and MCP servers (tool integrations that give Claude access to external services).

Skills:

Recommended skills:

  1. vercel-react-best-practices + vercel-composition-patterns — Opus 4.6 is already very decent with React, but these skills help find stupid bugs.
  2. frontend-design — Actually works, designs are very different from base LLM.
  3. agent-browser — Useful for letting the LLM check its own work visually and to catch console/network errors.
  4. skill-creator — A skill to create your own skills.

MCP Servers:

Honestly though — MCP servers aren’t that great and everyone is trying to fix them with the next better thing. I don’t really use many (Sentry + Stripe and that’s it, everything else is handled via skills). Sentry integration is genuinely useful — fetch errors from Sentry and fix them all in one go, and it actually works.


4. Context Is King

Claude Code has a finite context window. Long research tangents, large file reads, and exploratory searches eat through it fast. When the context fills up, older messages get compressed and you lose nuance. The model gets dumber the more the context window is inflated. Autocompressions can work, but I prefer to clear the context entirely (/clear command) before each subtask.

Subagents to the rescue:

When to use subagents:

When NOT to use subagents:

Pro tip: You can run subagents in the background with run_in_background: true and check on them later. Great for long-running tasks.


5. Use Pre-hooks for Security and Code Practice Warnings

Hooks are shell commands that run automatically before or after Claude Code tool calls. Use pre-hooks to catch problems before they happen.

What hooks can do:

How to set them up:

Hooks are configured in ~/.claude/settings.json (global) or .claude/settings.json (per-project):

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/your/security-check.sh"
          }
        ]
      }
    ]
  }
}

Hook ideas worth implementing:

Hook behavior:

Bonus: add Warcraft peon sounds via hooks.


6. Workflow: Plan Mode and How to Actually Use This Thing

Claude Code defaults to just doing stuff — reading files, writing code, running commands. For small tasks that’s fine. For anything non-trivial, you want plan mode.

What plan mode does:

You type /plan or tell Claude to “plan this first”. It switches into a mode where it can only research (read files, search, explore) but cannot write or execute anything. It produces a step-by-step plan, then asks for your approval before touching any code.

Why this matters:

Without plan mode, Claude will just start coding immediately. For a complex task, this often means it goes down the wrong path, burns through context, and you end up with a mess you need to undo. Plan mode forces it to think before acting — explore the codebase, identify the right files, consider trade-offs, and lay out the approach.

When to use it:

When to skip it:

The ideal workflow looks like this:

  1. /clear — Start with a clean context.
  2. Describe the task. For anything non-trivial, tell Claude to plan first or use /plan.
  3. Review the plan. Push back, ask questions, refine.
  4. Approve the plan. Claude switches back to act mode and executes.
  5. /clear — Clean up context before the next task.

Combining plan mode with subagents:

For large tasks, the best pattern is: plan in the main context, then delegate execution steps to subagents. This keeps your main context clean (just the plan + results) while subagents handle the messy details of reading files, running tests, and making changes.

Tip: You can also tell Claude to “plan this, but don’t enter plan mode” — it’ll write out a plan in the normal conversation without the formal mode switch. Useful when you want a quick outline but don’t need the full ceremony.


7. Document Everything, Especially Big Tasks

Context disappears between sessions. You /clear, you close the terminal, you come back tomorrow — and Claude has no idea what you were doing. For anything that spans multiple sessions, write it down in files Claude can read.

Spec docs for big features:

Before you start building, enter plan mode and have Claude write a spec doc. Not a novel — a concise markdown file that captures the what, why, and how. Put it somewhere in the repo (e.g., docs/specs/feature-name.md).

This serves two purposes:

  1. It forces you and Claude to agree on scope before any code is written.
  2. Next session, you point Claude at the spec and it has full context immediately — no re-explaining.

TODO files for tracking progress:

For multi-session tasks, keep a TODO.md or tasks.md in the repo. Have Claude update it as work progresses — what’s done, what’s next, what’s blocked. When you start a new session, Claude reads the file and picks up where it left off.

A simple format works:

# Auth Refactor

## Done
- Migrated session store from Redis to Postgres
- Updated login endpoint to use new token format

## In Progress
- Updating middleware to validate new tokens (src/middleware/auth.ts)

## Next
- Update all protected routes to use new middleware
- Write integration tests
- Update API docs

Why this matters:

The pattern:

  1. Enter plan mode. Have Claude explore, research, and write a spec doc.
  2. Review and approve the spec.
  3. Create a TODO file with the implementation steps.
  4. Work through the steps across sessions, updating the TODO as you go.
  5. Each new session: “Read docs/specs/feature.md and TODO.md, then continue.”

Quick Reference

TipWhy
Subscription planPredictable costs, no bill shock
CLAUDE.mdPersistent project rules, no repeating yourself
Skills + MCP serversDomain expertise + tool access
SubagentsKeep context clean, parallelize work
Pre-hooksAutomated guardrails against mistakes
Plan modeThink before acting, avoid wasted context
Spec docs + TODOsPersist context across sessions

Further Reading