mcp-contrast: Command for Claude Code

.claude/commands/improve-harness.md

improve-harness is a command for Claude Code from Contrast-Security-OSS/mcp-contrast. It costs 18 tokens per session (468 once invoked), scanned A, original, Apache-2.0.

A playbook for improving one bounded coding-agent job in a repository. It measures the current process, finds the earliest failed handoff, applies the smallest appropriate change, and checks the result again.

In plain words
What is it for?
Use it to define a representative job, document its starting state, classify the gap, make an authorized repository change, and rerun the job.
Why use it?
It helps turn a vague workflow problem into a specific, testable improvement with a clear owner and scope.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

This is Contrast-Security-OSS/mcp-contrast's own configuration. It tells Claude Code how to work on mcp-contrast itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-contrast configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Contrast-Security-OSS/mcp-contrast. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Contrast-Security-OSS/mcp-contrast/main/.claude/commands/improve-harness.md
Clone the repo
git clone --depth 1 https://github.com/Contrast-Security-OSS/mcp-contrast

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for improve-harness

README.md
[![agentmods](https://agentmods.dev/badge/commands/contrast-security-oss/mcp-contrast/improve-harness/github.svg)](https://agentmods.dev/commands/contrast-security-oss/mcp-contrast/improve-harness)
Your own site
<a href="https://agentmods.dev/commands/contrast-security-oss/mcp-contrast/improve-harness"><img src="https://agentmods.dev/badge/commands/contrast-security-oss/mcp-contrast/improve-harness/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for improve-harness

Your own site · 80×15
<a href="https://agentmods.dev/commands/contrast-security-oss/mcp-contrast/improve-harness"><img src="https://agentmods.dev/badge/commands/contrast-security-oss/mcp-contrast/improve-harness.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 468 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00468
Opus 5 $0.00009 $0.00234
Sonnet 5 $0.00004 $0.00094
Haiku 4.5 $0.00002 $0.00047

Measured 9d ago against content hash 38d9ab04834f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

improve-harness scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/improve-harness.md · 46 lines

What it actually says

/improve-harness

Run Ryan Lopopolo's harness-engineering improve-harness playbook against this repository. It closes one bounded operational loop, from baseline through the earliest failed handoff to the smallest owning intervention, native verification, and a fresh rerun.

The job to improve is passed as $ARGUMENTS. If none is given, ask for one bounded, representative job before starting.

Steps

  1. Locate the corpus by running the snippet in docs/agents/harness.md. That resolves CORPUS_DIR to a read-only checkout pinned to a known commit.

  2. Read $CORPUS_DIR/AGENTS.md. Follow its Application routing and Working loop, and use its Context routing inside the gap-classification step.

  3. Read $CORPUS_DIR/playbooks/README.md, then $CORPUS_DIR/playbooks/improve-harness.md. Treat the procedure as a scaffold you can adapt or reject, and record what changed and why.

  4. Run the loop with this repo as the target. Record the job contract first, and establish scope and authority before changing anything. Change this repo only when the task and its authority contract grant that operation, otherwise stop after recording the evidence, proposed owner, intervention, proof plan, and expected effect.

  5. Implement the smallest reversible change at the earliest owner, then verify both layers. Run this repo's native checks (make check, plus make verify when credentials allow), and exercise the user or operational journey that establishes the accepted outcome.

  6. Record the compact result where this repo keeps architecture or history, a bead comment, an ADR under docs/adr/, or CONTEXT.md. Name the owner, the evidence, and the retirement condition.

Keep the corpus read-only, and adapt its ideas without copying its file layouts, version pins, or fixtures. Follow this repo's branching and PR workflow in CLAUDE.md for any change.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 46 lines · 18 tokens per session scan A 38d9ab04834f

Subscribe to this mod's changes

improve-harness is a command published in the GitHub repository Contrast-Security-OSS/mcp-contrast (23 stars, last pushed 4d ago), licensed Apache-2.0. It adds 18 tokens to every session and 468 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.