The AI Coding Harness Guide

Updated by

Agent output quality is set less by the model than by the harness around it: project guides, permissions, context strategy, configuration, and feedback loops.

Guides below cover the full path from first setup to multi-agent fleets, each backed by production use. Release-by-release analysis of the tools themselves lives in the version trackers. Anthropic documents the underlying files in the Claude Code settings reference; the guides cover what that reference leaves out.

Start with the Mindset

The job shifts from writing code to designing the environment agents write it in. Legibility, automated invariants, and review discipline decide output quality more than any prompt.

The Agentic Engineering Playbook

Engineers no longer write code — they design environments where agents do. A practical guide to agent legibility, automated invariants, and treating AI as first-class teammates.

Set Up the Harness

A concise CLAUDE.md, scoped permissions, and slash-command automation cut more friction than a model upgrade. The exact files and settings:

How Much Does Claude Code Cost? Plans, API, OpenRouter and Bedrock Prices

Claude Code costs $20 a month on Claude Pro ($17 a month billed annually), the cheapest plan that includes it; Max is $100 and Ultra $200. With an API key you pay per token: from $0.10 input and $0.50 output per million tokens on Haiku 5.5 to $4 and $20 on Opus 5.5. OpenRouter and Bedrock global endpoints list the same token prices; Bedrock in-region endpoints add 10%.

How to Install Codex CLI on Windows, WSL, macOS and Linux

Install Codex CLI with curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS, Linux and WSL, the install.ps1 command in Windows PowerShell, npm install -g @openai/codex or brew install --cask codex. Then run codex and sign in with ChatGPT or an API key.

Boost Developer Productivity with Claude Code: Settings, Custom Commands, Stack Guides, Tips and Tricks

Claude Code, the terminal-native, agentic coding assistant, gets exponentially more useful when you give it a concise project guide (CLAUDE.md), set sensible permissions & environment via settings.json, and automate routine actions with slash-command files. This guide packs all three into copy-ready snippets: stack-specific CLAUDE.md templates, a JIRA-driven custom workflow, permission hygiene tips, and a reflection command that continuously sharpens your guide.

Always-On Agents in Claude Code: Inbox, Timers, Memory, Permissions, Outbox

Anthropic's "Building always-on agents" guide (Nov 13, 2026) splits an always-on agent into an event inbox, timers, memory, permissions and an outbox. Claude Code already has a part for each: channels and GitHub or API triggers, /loop and scheduled tasks, auto memory, auto mode and the PreToolUse defer decision, and PushNotification or a two-way channel.

Improved Claude Code Settings Schema with Environment Variable Autocomplete

I've been using the official schema from Anthropic for Claude Code settings, but one thing was missing: autocomplete for environment variables. So I built an improved schema with 50+ env vars, inline documentation, and full IntelliSense support. Plus, I'm launching a new 'Extras' section for downloadable productivity tools.

Control the Context Window

Sessions degrade before the token limit — quality drops around 70-75% capacity. Compaction has dials; most engineers never touch them.

Why Your Claude Code Sessions Keep Dying (And How to Fix Them)

Context window mismanagement is the number one productivity killer in Claude Code. This guide shows you how to recognize context degradation, why it happens around 70-75% capacity, and the exact strategies top engineers use to maintain peak Claude Code performance throughout long coding sessions.

Claude Code .claude/rules: Path-Scoped Rules That Load Only When Needed

A Markdown file in .claude/rules/ with a paths: list loads only when Claude reads, writes or edits a matching file. Rules shipped in v2.0.64, but loading on Write, Edit and Bash cat arrived in v2.1.288 to v2.1.293. An @import inside a path-scoped rule loads at launch and defeats the scope; symlink instead.

Claude Code "What's contributing to your limits usage?": How to Read the /usage Breakdown

The /usage breakdown in Claude Code scans the sessions saved on your machine for the last 24 hours and 7 days and shows what used most of your plan limits: cache misses, long context, subagents, max effort, parallel sessions, skills, plugins and MCP servers. Run /usage, press d or w, and press f to apply the fixes. The bars above it show the 5-hour session limit and the weekly limits.

Configure Everything

Claude Code ships hundreds of environment variables; most never reach the docs. The full reference, plus fixes for the common proxy and Bedrock failures.

Claude Code /goal: Keep Claude Working Until a Condition Is Met

The /goal command sets a completion condition and Claude keeps working toward it without a prompt each turn. A separate model checks the condition after every turn, so the session stops at the goal instead of asking "should I also fix this?". Clear it with /goal clear.

Codex Plan Mode: How to Turn It On and Off, Plus Auto Review and Auto Mode

Type /plan or press Shift+Tab to put Codex CLI in Plan mode: it explores, asks questions and proposes a plan without editing files. Auto review (approvals_reviewer = "auto_review", or --approve-for-me) sends approval prompts to the codex-auto-review model. Auto mode is workspace-write plus on-request.

Secure the Harness

What a coding agent can leak and where: your account email in request headers, secrets saved into permission rules and committed, and the certificate settings behind a corporate proxy.

Can an MCP Server Tell Claude Code to Hide Things From You?

An MCP server's instructions, tool descriptions and tool results all reach Claude as text, so a server can ask Claude to keep something from you. RunPod's server and Notion's hosted server did that in November 2026. How to find it in your transcripts, deny one MCP tool, and flag such text with PostToolUse and PostToolUseFailure hooks.

Debug the Harness

Debug flags, log directories, and undocumented switches show what the agent actually did — not what it reported.

Scale to Multiple Agents

One well-harnessed agent is table stakes. Parallel fleets compound the leverage and introduce failure modes single sessions never hit.

Frequently Asked Questions

What is a harness for AI coding agents?

The environment built around a coding agent: project guides like CLAUDE.md, permission allowlists, environment variables, a context management strategy, and the feedback loops — tests, linters, crash reports — that let the agent verify its own work. Harness quality, not model choice, separates reliable agent output from unpredictable output.

Why do Claude Code sessions degrade over time?

Context quality drops before the technical token limit — noticeably around 70-75% capacity. System prompts and accumulated conversation consume the budget, and each compaction dilutes earlier context. One task per context, deliberate /clear and /compact usage, and tuned compaction thresholds keep sessions sharp.

What should go in a CLAUDE.md file?

Build and test commands, tech stack constraints, coding conventions, and project rules the agent cannot infer from code. Every line costs context in every session — keep it concise and split details into referenced docs the agent loads on demand.

How do I stop approving the same commands repeatedly?

permissions.allow patterns in settings.json — global in ~/.claude/settings.json, per-project in .claude/settings.json. Tools exist that scan session history and propose a safe allowlist in bulk instead of hand-writing patterns.

Are undocumented Claude Code environment variables safe to use?

They work, but they are internals: any release can change or remove them without notice. Use them for debugging and tuning, track releases if one becomes load-bearing, and prefer documented settings when an equivalent exists.

New lessons every week

We test the tools so you don't have to. Browse the full blog or get in touch to talk about your team's setup.