Our Claude Code Harness: Hooks, Skills and Mods
How we run Claude Code on this site: the rules file, guard hooks, a skills pipeline for every post, and the dashboard mods we built to watch each session.
Every post, tracker and chart on Capital & Compute is built with Claude Code, inside a harness we designed and keep extending. This section is where we document it: what each layer does, why it is there, and what we would change. It is our own setup, written from running it daily, not a neutral comparison. For the neutral version of each layer, the Claude Code harness guide explains every extension point and what it costs in context.
What we have built
- Claude Code Dashboard Mods: The Set We Built and Use. The dashboard mods that draw a numbered status band above our prompt: live activity, context, repo, PR and CI, plain-words recaps, memory, system and usage.
- Claude Code Harness Example: A Full-Stack Monorepo Setup. A second harness we built, for a full-stack monorepo: blocking hooks, skills that open and answer pull requests, and a byte budget for CLAUDE.md.
- Claude Code Autonomous Workflow: Guardrails Over Approvals. How that monorepo runs Claude Code autonomously: deny rules and hooks instead of approvals, layered review, local Orca worktrees for trusted work and cloud sessions for anything that reads untrusted pages or needs a key.
How our harness is layered
A harness is everything around the model that decides what it sees, what it may do and what gets checked afterwards. Ours has four layers, each doing one job:
- Rules. A single CLAUDE.md holds the standing orders: the commercial goal, the sourcing and citation rules, the house style, and the hard limits (never commit or push without being asked, never call a banned data source). Rules that only apply to one kind of file live in path-scoped rule files, so they load only when they matter.
- Guards. Settings hooks enforce what a rule can only ask for. One reminds Claude when a new post is written without a hero image, and a Stop hook will not let the turn end while a recent post still lacks one. The build itself fails on a title or description outside the search length limits.
- Skills. A pipeline of skills runs every post the same way: topic planning, a live search-results check before a title is locked, the brief, the draft, a visual pass, the snippet pass and the hero image. Data trackers have their own refresh skills that verify each number against its source before writing it.
- Mods. Since Claude Code shipped mods, eight of our own draw a status band above the prompt so we can see the session itself: context, the branch and PR, memory load, machine load and plan usage, without spending a token.
Which harness engineering techniques belong in a Claude Code harness?
The six layers of the agent harness checklist map cleanly onto Claude Code's own extension points. Each one fixes a specific kind of failure:
- A task contract. Start each job with a written definition of done: the outcome, what must not change, and the check that proves it worked.
- A map, not a manual. Keep CLAUDE.md short and treat it as an index. Put file-specific guidance in path-scoped rules that load only when they apply, and link to longer docs instead of pasting them in.
- Policy outside the model. Anything that must hold every time belongs in a hook or a permission rule, not in an instruction the model can forget. Use instructions for judgment, and code for guarantees.
- Durable state. Use the memory directory and plain progress files to carry decisions and lessons between sessions, so a new session resumes instead of starting over.
- Evidence before "done". Have a hook run lint, typecheck and tests after edits, and treat work as finished only when they pass. If the output is visual, look at the rendered result, not only the data behind it.
- Every failure upgrades the harness. When the same mistake happens twice, turn it into a rule, a hook or a shared helper so it cannot happen a third time.
Two techniques usually come last: a separate evaluator agent that only looks for reasons to reject finished work, and retry budgets that cap attempts, time and spend on long runs. Both add cost, so add them when a real failure calls for them, the same test every other layer should pass.
Why we build our own instead of installing everything
Every layer costs something. Rules and skills cost context on every request, guards cost a little time on every tool call, and a third-party mod runs with full access to the machine. So we add a piece only when it fixes a mistake we have actually seen, and we write most of them ourselves so we know exactly what they touch. When a mod or skill from someone else is the better tool, we use it; the guide to the best Claude Code mods covers where to find them and how to vet one first.
Background reading
- Claude Code Harness Guide: Skills, Hooks, Subagents, MCP
- Best Claude Code Mods and Where to Find Them
- Best Claude Code Agentic Workflows: 2026 Playbook
- Harness Engineering in 2026: Techniques Beyond MCP
- Agent Harness Checklist: Build the Minimum Viable Harness
Frequently asked questions
- What is a Claude Code harness?
- The setup around the model that shapes each session: instruction files such as CLAUDE.md, settings hooks that block or check actions, skills Claude loads for specific jobs, MCP servers that add tools, and mods that change the interface and behavior from inside Claude Code.
- Is this harness available to install?
- Not as a package. This section explains how each layer works and shows the patterns, so you can build the parts that fit your own project.
- Which part of the harness should you build first?
- The rules file. It is the cheapest layer and every other layer refers to it. Add a guard hook the first time Claude breaks a rule that matters, and a skill once you find yourself pasting the same instructions into chat.