Spend One Hour Setting Up Claude Code Harness — See the Difference Immediately

You installed Claude Code. You switched to Opus 4.7. Same project, same codebase — why is your colleague’s output a full tier above yours? The answer most likely isn’t the model.

The model sets the ceiling. The Harness determines how much of it you actually reach.

Once Claude Code is running, actual output quality depends on two things: the model’s inherent capability, and the configuration layer wrapped around it — CLAUDE.md, Hooks, Skills, LSP, MCP, Sub-agents — collectively called the Harness.

Think of it this way: the model is a V8 engine. The Harness is the chassis, transmission, steering wheel, and navigation. The best engine in the world won’t go anywhere bolted to a car with no steering. And yet, here’s what most people do: they spend real money upgrading to the strongest model, then bolt it onto an empty shell — no Harness at all, nothing in context but a prompt.

After six months of hands-on work, the deepest lesson is this: spending an hour building your Harness delivers a far higher return than upgrading to a better model. Model improvements are linear — a slightly better model gives you slightly better code. But the Harness compounds. Every layer you add — CLAUDE.md, a Hook, a Skill, LSP — multiplies the quality of every single conversation turn. More importantly, the Harness earns interest. A CLAUDE.md rule you write today applies to every future conversation. A Skill you build today activates on every matching task forever.

The five components of a well-configured Harness

A mature Harness has five layers, each solving a distinct problem:

  1. CLAUDE.md: Persistent global rules loaded into every turn. The AI sees these on every single reply, so they must be laser-focused — only write what the AI needs to know before you open your mouth.
  2. Hooks: Lifecycle automations. SessionStart injects git context at conversation start. Stop runs a post-session review to catch violations.
  3. Skills: Lazily-loaded workflow templates. Activated on demand, they encode multi-step processes like “create a new API route” into reusable instructions.
  4. LSP: Language Server Protocol integration. Upgrades the AI’s code search from string matching to symbol-level — for the same variable name, LSP returns a definition and two references, not three hundred grep hits.
  5. Sub-agents: Isolated Claude instances with their own context windows. Send them to explore, research, or audit — without polluting your main session’s context.

These five layers build on each other. CLAUDE.md establishes baseline rules. Hooks automate environmental awareness. Skills encapsulate reusable workflows. LSP sharpens code understanding. Sub-agents extend context boundaries. Build them in this order, and each step amplifies the value of the ones before it.

When building a Harness is worth the effort

If your daily work involves two or three files and standalone scripts, the Harness won’t pay off much — a single prompt does the job, no CLAUDE.md required.

But if you’re in any of these situations, the Harness is essential:

  • Maintaining a codebase above 50,000 lines: The AI needs to navigate dozens of files and understand module dependencies. Without Harness guidance, every turn starts from scratch.
  • Using Claude Code as a team: Different members have different mental models of coding conventions. CLAUDE.md and Skills freeze those conventions so no one has to re-explain them in every chat.
  • Running recurring workflows: Creating API routes, writing database migrations, cutting releases — things you do once don’t need a Skill. Things you do every week absolutely do.
  • Cross-module refactoring: Changes that touch multiple unfamiliar directories. Without a Sub-agent to map the territory, your main session burns most of its context budget just understanding what the code does.

Conversely, if you’re prototyping and requirements change hourly, Harness maintenance will cost more than it saves. A Harness fits a project you’ll work on for months — the kind where every minute spent on setup returns itself dozens of times over.

Three pits everyone falls into

Pit one: treating CLAUDE.md as project documentation. Early on, it’s tempting to fill it with technology rationales, team rosters, and historical decisions — three hundred lines of noise. The AI pays for every word of it on every reply, eating up the context window that should be used for actual code understanding. Cut it to twenty lines. The output will be dramatically better. Write tight, not long. Only rules. No justifications.

Pit two: building MCP Servers too soon. MCP lets Claude connect to databases, GitHub, internal docs — it looks cool. But if you haven’t written a solid CLAUDE.md, built your Skills, or installed LSP, spending an afternoon on a custom MCP Server is textbook over-engineering. Dial in the first four layers first. Start on MCP only when you can articulate exactly why — “if the AI could query this directly, it would eliminate fifty back-and-forths per session.”

Pit three: forgetting the Harness needs maintenance. It’s not a one-time project. After major model releases, some rules become obsolete — if the new model automatically reads tsconfig path aliases, your “watch out for path aliases” rule is now dead weight, burning tokens for nothing. Review every three months. Revisit after every model release.

Five steps, from zero to configured

Before starting: Claude Code ≥ 2.1.100 (run claude —version), a real project you work in daily (not a demo), and fifteen minutes. Follow the order.

Step one: write CLAUDE.md right (the highest-ROI five minutes)

CLAUDE.md loads when Claude Code starts. After that, it’s in every conversation turn — every word you write, the AI pays for on every single reply.

The single rule: rules go in CLAUDE.md, workflows go in Skills.

“Monetary amounts are always in cents, never floating-point” — that’s a rule. It goes in CLAUDE.md. “To create an API route: check existing routes, write zod schema, write handler, add tests, run tests” — that’s a workflow. It goes in a Skill.

Create CLAUDE.md in your project root:

# Project overview
Stack: Next.js 15 + tRPC + PostgreSQL
Run tests: pnpm test

# Global conventions
- No em dashes. Use full-width punctuation for Chinese.
- All monetary calculations in cents. No floats.
- Named exports only. No default exports in components.

If your project has sub-packages (like packages/api in a monorepo), add a CLAUDE.md there too, with only package-specific conventions. Claude Code walks up from the directory you initialize in, auto-loading every CLAUDE.md along the path. Global rules at root, package rules in packages — clean separation, no overlap.

Step two: add a SessionStart Hook (stop introducing yourself every time)

Hooks are scripts that fire automatically on Claude Code lifecycle events. The two most useful: SessionStart fires at conversation start; Stop fires after the conversation ends.

If every Claude Code session begins with you answering “what does the project look like,” “what branch are we on,” “what changed recently” — automate that. Create .claude/settings.json in your project root:

{
  "hooks": {
    "SessionStart": [
      {
        "type": "command",
        "command": "node .claude/hooks/session-context.mjs"
      }
    ]
  }
}

The SessionStart script is dead simple — assemble git status + git log + current branch name and print to stdout. Claude Code injects the Hook output directly into the conversation opening, so the AI knows exactly where it is and what’s around it before you say a word.

Advanced play: if your team’s CLAUDE.md changes often, add a Stop Hook with a headless Claude instance that reviews changes after each session and auto-generates CLAUDE.md update suggestions. Your Harness gets smarter without manual maintenance.

Step three: turn repetitive workflows into Skills

The genius of Skills is lazy loading. You can have fifty Skills, but each conversation turn only pays the token cost for the description of one. The Skill body loads only when the description matches the current task.

Take the “create a new API route” workflow. Write it once as a Skill:

---
name: api-add-route
description: Create a new tRPC route with zod validation and tests
paths: packages/api/**
---
# Create a new API route
1. Check src/routes/ for existing routes to avoid duplicates
2. Write input schema with zod
3. Write the route handler
4. Add tests using the project's standard test helper
5. Run pnpm --filter api test and confirm it passes

Notice the paths field in the frontmatter. It activates this Skill only when you’re working inside the api package directory. Path scoping is the most underrated feature of Skills — in a hundred-person monorepo, every developer sees only the Skills relevant to their part of the codebase.

Step four: install LSP (don’t let grep drown in a hundred thousand lines)

Claude Code doesn’t use vector databases. It doesn’t prebuild indexes. It navigates code like a human — reading files, running grep, following imports. In a five-thousand-line project, you don’t notice. Above a hundred thousand lines, a simple grep returns three hundred hits — comments, log lines, test fixtures, string concatenations — and almost none of them are useful.

LSP fixes this. It understands scope, types, and import relationships. It performs symbol-level search instead of string matching. For the same variable name, LSP returns one definition and two references — not three hundred meaningless string matches.

Setup is straightforward: a Claude Code LSP plugin (code intelligence plugin) plus the language server binary for your language. TypeScript projects get typescript-language-server. Python projects get pyright. Once installed, every code search Claude performs becomes an order of magnitude more precise.

Step five: delegate exploration to Sub-agents (don’t let context bloat kill your main session)

A Sub-agent is an isolated Claude instance with its own context window. You send it to explore. It works in a clean context. It returns results and exits. Your main session never sees the exploration process — it only receives the final answer.

The most practical pattern: separate exploration from editing.

Say you need to refactor the billing module but don’t know it well. Do not grep, read files, and edit code all in the same session — your context will overflow fast. Instead:

  1. Send a read-only Sub-agent to map the billing directory — structure, entry points, data flow. Have it write findings to .claude/discovery/billing.md
  2. Sub-agent returns a summary. The file is on disk.
  3. Your main session reads billing.md and starts refactoring in a clean, focused context.

The bigger the codebase, the more this pattern pays off. In monorepos above a hundred thousand lines, skipping Sub-agents means your main session burns most of its context budget on exploration, leaving almost nothing for actual code changes.

A real comparison: before and after

Take a typical Next.js monorepo as an example. Before the Harness, a Claude Code session looks like this:

  • You: “Add a discount-by-user-type feature to the billing module.”
  • AI: “Let me understand the project structure first… can you confirm: are you using tRPC or REST?”
  • You: “tRPC.”
  • AI: “Got it. Where is the billing module?”
  • You: “packages/api/src/routes/billing/”
  • The AI starts reading files, grepping — burns 8,000 tokens of context before writing a single line of code.

After the Harness:

  • You: “Add a discount-by-user-type feature to the billing module.”
  • The AI already knows the stack is tRPC, amounts are in cents, and the billing structure is cached in a discovery file from a Sub-agent. It jumps straight to “which file gets which logic.”

The gap isn’t the model. It’s the information that was missing from context. The Harness filled the gap.

Next step: from personal setup to team sharing

If you’ve built a solid Harness for your own projects, the next step is packaging it as a Plugin — bundle your CLAUDE.md, Hooks, and Skills into a single installable unit. Forty people on your team run one command and get the full setup. No one spends half an hour manually copying files. Everyone gets the same configuration. New hires have a complete AI coding environment on day one.

Models will keep getting better, and you don’t need to worry about that. But the Harness underneath the model — that’s yours. And it compounds.

Same model, same project. With a Harness versus without — the output is on completely different levels. Spend the hour. Try it.

Related Posts

Stop Writing Markdown — Use HTML with Claude Code

Stop Writing Markdown — Use HTML with Claude Code

Markdown has been the default communication format between agents and humans in the AI coding space. ...