A field guide · Checked Oct 29, 2026
Build your own harness
A guide for people building a DIY agent harness. Data checked on 2026-10-29.
You don't need to write a harness to own one. The agent loop is a commodity now; what makes a harness yours is the layer of skills, plugins, hooks, memory and tools you put around it, and the sandbox and measurements you wrap it in. This guide walks the layers, names open-source pieces for each from the directory, suggests three starter stacks and ends with a checklist for vetting anything you install. For the operational side (choosing, sandboxing and upgrading a big harness), see the open-source harness best practices guide.
Every pick links to its directory page, with stars, license and sources. Browse all of them on Skills, Plugins & Mods.
The layers of a harness
A harness is everything around the model. Built bottom-up, it has eight layers. You rarely write any of them from scratch: each has open-source pieces in this directory, and the Skills, Plugins & Mods section collects the add-ons for the middle layers.
| Layer | What it does | Open-source picks |
|---|---|---|
| 1. Agent loop | Calls the model, runs tools, feeds results back | Claude Code, Codex, opencode, Gemini CLI, Pi, or an SDK such as Claude Agent SDK |
| 2. Skills | Instructions and scripts the agent loads when a task needs them | Agent Skills spec, Anthropic Skills, Superpowers, Matt Pocock's skills |
| 3. Plugins, hooks, subagents | Installable bundles, deterministic checks around tool calls, delegated workers | Claude plugins directory, wshobson/agents, TDD Guard, CC Safety Net |
| 4. Memory and context | What survives a session, and what is kept out of the window | claude-mem, agentmemory, Context Mode, planning-with-files |
| 5. MCP tools | Connections to the outside world over one protocol | MCP, reference servers, GitHub MCP, Playwright MCP |
| 6. Sandbox | Where tool calls run, and what they can reach | E2B, container-use, Sandcastle, NemoClaw |
| 7. Evals and observability | Traces, costs and tests that tell you whether a change helped | Langfuse, Phoenix, promptfoo, Inspect, ccusage |
| 8. Orchestration | Many agents, many models, one workflow | oh-my-claudecode, Claude Squad, Claude Code Router, CC Switch |
Skill, plugin and mod are the words this directory uses for layers 2 to 4 and 8. A skill is instructions the agent loads (usually a SKILL.md folder). A plugin is installed through a harness's own plugin system or marketplace. A mod changes how the harness itself behaves: hook packs, workflow layers, config packs, routers.
Assembling it from open-source pieces
Start with a loop you can read. If you want to understand the loop before you depend on one, learn-claude-code builds a nano harness from zero. Pi is the minimal end of the real ones; Armin Ronacher notes it "only has four tools: Read, Write, Edit, Bash." Deep Agents is the batteries-included end. Most DIY builders keep a stock agent loop and customise the layers above it.
Add skills before you add code. The Agent Skills format is a folder with a SKILL.md (name, description, instructions) plus optional scripts and assets. Agents load it by progressive disclosure: only names and descriptions at startup, the full file when a task matches. That is why skills are the cheapest layer to try. The skills CLI (npx skills add owner/repo) installs them into the project or globally for the agents you pick, and AGENTS.md is the matching standard for repository-wide instructions.
Use hooks for rules that must hold. A rule in a prompt can be ignored; a hook runs every time. TDD Guard enforces test-first work through Claude Code hooks, and CC Safety Net and Destructive Command Guard block destructive git and filesystem commands before they run. Claude Code Hooks Mastery is a reference for the hook lifecycle. Package what works as a plugin, as Compound Engineering and wshobson/agents do across several harnesses.
Treat context as a budget. Context Mode keeps raw tool output out of the window (its README cites 315 KB reduced to 5.4 KB). planning-with-files keeps the plan on disk so it survives compaction, and claude-mem or agentmemory carry decisions across sessions.
Connect tools over MCP, narrowly. The Model Context Protocol is the default tool bus. Prefer servers with a deliberately small tool surface, and load tool definitions on demand where your client supports it (see §5).
Put the whole thing in a box, then measure it. Pick a sandbox (E2B, container-use, or your harness's own, such as the Claude Code sandbox), trace runs with Langfuse or Phoenix, and keep a small eval set in promptfoo or Inspect. ccusage reads Claude Code and Codex logs for token use and cost, which is the fastest way to see what a new plugin really costs.
Orchestrate last. Once one agent works, Claude Squad runs several in isolated git workspaces, Claude Code Router gives them one local endpoint with fallback models, and oh-my-claudecode or oh-my-codex add team workflows on top of a single harness.
Three starter stacks
These are starting points, not endorsements. Swap any piece for one from the same layer on Skills, Plugins & Mods.
| Layer | Solo developer | Team | Always-on personal agent |
|---|---|---|---|
| Agent loop | Claude Code or opencode | The harness the team already pays for, plus Codex as a second opinion | Hermes Agent or OpenClaw |
| Skills | Superpowers or Matt Pocock's skills | Shared, pinned skills from a private registry such as SkillHub; Spec Kit or OpenSpec for specs | A few skills you wrote or read line by line |
| Plugins and hooks | Claude HUD to see context use; TDD Guard | CC Safety Net in the repo; Ruler or rulesync to keep rules the same across agents | Failproof AI policies on tool calls |
| Memory and context | Context Mode, planning-with-files | Beads as shared task memory | agentmemory (scrubs secrets, lets you forget) |
| Tools | Playwright MCP, Context7 | GitHub MCP with read-mostly scopes | Only the MCP servers each task needs |
| Sandbox | Your harness's sandbox, or container-use | Sandcastle or E2B per task | NemoClaw or a dedicated VM; never an exposed control plane |
| Evals and cost | ccusage | Langfuse traces and a promptfoo suite in CI | Spend caps and traces before autonomy |
Vetting checklist for skills and plugins
A skill is text your agent will follow and often scripts it will run; a plugin can add hooks that execute on every tool call. Both run with your agent's access. Before installing anything third-party:
- Pin it. Install a tagged release or a commit SHA, never a moving branch, and re-review on every bump. Big harnesses ship several releases a week (see the best-practices guide); add-ons move just as fast.
- Read the SKILL.md and every script. Look for instructions to fetch URLs, read dotfiles, disable confirmations or run bundled binaries. A plugin's hooks are shell commands: read them like a
postinstallscript. - Scan it. SkillSpector checks skills for 71 vulnerability patterns across 17 categories, including prompt injection, exfiltration and supply-chain risks, and outputs SARIF for CI. Snyk Agent Scan covers agents, MCP servers and skills.
- Allowlist sources. Install only from repos or registries you have approved; a self-hosted registry such as SkillHub adds RBAC and audit logs. Public marketplaces have shipped malicious skills: secondary coverage reported 341 on ClawHub in early 2026 (counts unverified).
- Sandbox the agent, not just the tool. In Claude Code's sandbox, file tools, MCP servers and hooks run outside the boundary, so a plugin's hook is not confined by it. Hermes' security policy says its terminal backend does not confine code running in the agent's own process, including skills and plugins.
- Keep secrets out of context. Deny reads of
~/.ssh, cloud credentials and.envfiles, pass tokens through the environment of the tool that needs them, and prefer memory plugins that scrub secrets, as agentmemory does. - Assume prompt injection. Skill text, tool descriptions and tool output are all model input. An agent with private data, untrusted content and a way to send data out is Simon Willison's "lethal trifecta"; remove one leg. MCP tool metadata can hide instructions too (tool poisoning).
- Give each add-on the least it needs. Narrow MCP servers over a raw shell, read-only scopes over write, and ask-rules (for example on
git push) that prompt even inside the sandbox. - Measure the cost. Note what a skill pack or plugin adds to every prompt before you keep it (see §5), and drop what you don't use.
What the community reports
From the sourced "What the community says" notes on the project pages. These are user reports, not our measurements.
| Topic | Pros people report | Cons people report |
|---|---|---|
| Claude Code as the base | Rich harness features (subagents, skills, hooks, plugins, headless use); users report moving skills and memories to Codex in minutes | Heavy context: one measurement found about 33k tokens sent before the prompt versus about 7k for opencode |
| opencode as the base | Any provider, configurable subagents, leaner prompt overhead and a plugin ecosystem (for example dynamic context pruning) | No built-in sandbox; an October 2026 breach of a legacy system exposed BYOK provider keys stored in workspaces |
| Hermes Agent skills | Creates reusable skills from completed tasks; portable file-based memory | The default load-out lists many skills (over 10k tokens just to list them); it can overwrite manual skill edits |
| OpenClaw skills | A large skill ecosystem and memory kept as files, so switching models is easy | Malicious skills in the marketplace and prompt-injection risk; updates frequently break setups |
| MCP tools | The de facto way to expose tools; narrow servers are safer than a raw CLI; deferred tool loading fixes much of the bloat | Eagerly loaded tool definitions eat context; tool poisoning makes each third-party server a supply-chain risk |
Keeping your stack current
Add-ons change weekly. Sort Skills, Plugins & Mods by recent updates to see what moved, and filter by the harness you run. Harness Hub's own discovery job searches GitHub every day for new skills, plugins and mods and queues them for human review; nothing is listed until someone has checked it. Know one we missed? Suggest it.
When you update, re-run the checklist in §4 on the diff, and re-run your eval set before and after. If a plugin doesn't move your numbers, it's only adding context.
Sources
- Agent Skills specification (agentskills/agentskills)
- Anthropic Agent Skills repository
- Vercel Labs skills CLI
- Claude Code plugin directory (anthropics/claude-plugins-official)
- Claude Code sandboxing docs
- Hermes Agent SECURITY.md
- Armin Ronacher, Pi: the minimal agent
- NVIDIA SkillSpector
- Snyk Agent Scan
- iFlytek SkillHub
- Context Mode README (315 KB to 5.4 KB)
- agentmemory README (secret scrubbing)
- TDD Guard
- CC Safety Net
- Destructive Command Guard
- Simon Willison, The lethal trifecta
- Invariant Labs, MCP Tool Poisoning Attacks
- MCP Security Best Practices
- The Hacker News, 341 malicious ClawHub skills (secondary coverage; counts unverified)
- Hacker News: Claude Code harness features (skills, hooks, plugins)
- Hacker News: moving skills and memories between Claude Code and Codex
- Hacker News: 33k vs 7k tokens before the prompt (Claude Code vs opencode)
- Hacker News: opencode plugin ecosystem (dynamic context pruning)
- Hacker News: opencode BYOK key exposure
- Hacker News: Hermes default skills cost 10k+ tokens to list
- Kilo, OpenClaw vs Hermes: what Reddit says
- Hacker News: OpenClaw security model and malicious skills
- Hacker News: MCP as the standard for tools
- Hacker News: narrow MCP servers vs raw CLIs
- Hacker News: deferred tool loading
- Hacker News: MCP tool poisoning and supply-chain risk