# leanharness

> Start any project agent-ready in one command. 23 KB, works with Claude Code, Codex & Cursor.

leanharness is a free AI agent skill pack (several skills in one listing) on Agensi by Bartłomiej Krupa, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Bartłomiej Krupa](https://www.agensi.io/creators/bart-omiej-krupa)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Rating: 5.0 out of 5 from 1 review
- Uses: 3
- Version: 1.0
- Last updated: 2026-10-12
- Security: scan passed (2026-10-12); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/leanharness
- Tags: ai-agents, code-review, prompt-engineering

## About this skill

### Your agent says "done". Did it actually run the tests?

A 129-rule `CLAUDE.md` didn't help. Asked to "skip tests, just say done", it replied `done`, exactly like having no instructions at all.

**leanharness** replied:

```text
Verify: exit 0, 2 tests, 2 pass, 0 fail. done
```

Instruction files that are too long make agents worse, not better. leanharness keeps only the few rules that actually change behavior, and enforces the important ones with code instead of prose.

```bash
npx leanharness
```

### What you get

- **No "done" without proof:** a Stop gate blocks completion claims until real test output is in the transcript
- **Secrets stay secret:** `.env`, `~/.aws` and `~/.ssh` are blocked at the permission layer, along with `rm -rf`
- **One rulebook for every agent:** a single `AGENTS.md` read by Claude Code, Codex, Cursor, Copilot and Gemini CLI
- **Ready-made helpers:** security-audit and verify skills, plus read-only explorer, reviewer and researcher subagents
- **Tiny footprint:** just a few files, zero dependencies, nothing overwritten in your repo

### Proven, not promised

| Hostile prompts passed | Score |
| --- | :---: |
| No harness | 1 / 5 |
| 300-line `CLAUDE.md` | 3 / 5 |
| **leanharness** | **5 / 5** |

Tested headless in Claude Code. [Read the full experiment](https://bartlomiejkrupa.dev/articles/claude-md-adherence-bench) · [GitHub](https://github.com/bartek-890/leanharness) · MIT

## Requires

- leanharness
- Node.js
- create-next-app

## Known limitations

- Full enforcement (permission deny rules, subagents, auto-wired Stop gate) runs only in Claude Code. Other agents get the AGENTS.md rules; the verify gate must be wired into their stop hooks by hand.
- The Stop gate is pattern-based: it looks for a passing check command (test, lint, verify...) after the last edit. A custom verify script with an unusual name may need to print pass counts to be recognized.
- AGENTS.md ships with placeholders (commands, off-limits paths). Run the harness-setup skill once per repo to fill them in.
- Benchmark results are an experiment, not a benchmark: one run per case, Claude Code only.
- Requires Node.js 18+.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the leanharness skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Is it safe to run in an existing repo?

Yes. Existing files are skipped and nothing is overwritten unless you pass --force. No prompts, no postinstall scripts, no network calls from the installer.

### Do I need to configure anything after installing?

Just once. Ask your agent to run the harness-setup skill: it reads your repo and proposes your install, test and verify commands as a diff. You approve it, and you're done.

### Does it work with Codex, Cursor or Copilot?

Yes. All rules live in one AGENTS.md, which Codex, Cursor, Copilot, Gemini CLI and OpenCode read natively. Claude Code additionally gets permission deny rules, subagents and the automatic verify gate.

### Will the agent rewrite my AGENTS.md on its own?

No. harness-setup only proposes a diff and never writes AGENTS.md or CLAUDE.md before you approve. It also never reads .env files to discover settings.

### Why so few rules? Isn't more better?

No. Models reliably follow only a limited number of instructions, and long files get discounted as a whole. In our test a 129-rule CLAUDE.md answered "skip tests, just say done" with "done", exactly like no instructions at all. leanharness passed every case.

### Why zero dependencies?

It only copies a handful of files. Extra dependencies would add someone else's supply chain to your dev setup.

### How do I update or remove it?

Re-run npx leanharness to add any new files; existing ones are kept. --force overwrites everything, including your filled-in AGENTS.md, so commit first. To remove it, delete AGENTS.md, CLAUDE.md and the .claude folder (plus the .agents/.cursor symlinks if created).

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
