harness-fix

harness-fix is a command for Claude Code from hahaxiang27/FlowHarness. It costs 26 tokens per session (694 once invoked), scanned A, original, MIT.

A repair command that addresses items a verification step marked as failed, then runs the relevant checks again.

In plain words
What is it for?
Use it after an evaluation failure to identify the affected files, apply the smallest required fix, rerun validation, and update the progress record.
Why use it?
It focuses changes on the cause of each failure and limits repeated repair attempts, making it clear when human investigation is needed.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it after an evaluation failure to identify the affected files, apply the smallest required fix, rerun validation, and update the progress record.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hahaxiang27/flowharness/harness.fix
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/hahaxiang27/FlowHarness

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 harness-fix

README.md
[![agentmods](https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.fix.svg)](https://agentmods.dev/commands/hahaxiang27/flowharness/harness.fix)
Your own site
<a href="https://agentmods.dev/commands/hahaxiang27/flowharness/harness.fix"><img src="https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 694 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.00026 $0.00694
Opus 5 $0.00013 $0.00347
Sonnet 5 $0.00005 $0.00139
Haiku 4.5 $0.00003 $0.00069

Measured 7d ago against content hash 61389a1a35d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

harness-fix 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 7d 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.

commands/harness.fix.md · 77 lines

What it actually says

Harness 定向修正(Corrector)

上下文管理: ✅ 保持当前上下文(紧跟 /harness.eval 的 FAIL 结果执行)

指令

对 Evaluator 验证失败的项目进行最小化定向修正。

输入参数

$ARGUMENTS — 可选,指定修正轮次或失败项。不指定则自动从上一次 Evaluator 结果获取。

执行步骤

  1. 获取失败项:

    • 如果当前上下文中有 Evaluator 的 FAIL 输出,直接使用
    • 否则读取进度文件中最新的失败记录
  2. 加载修正模板: 读取 .harness/prompts/corrector.md

  3. 执行修正(按 corrector.md 的修正模式):

    • 分析每个失败项的根因
    • 确定最小修复范围(哪些文件的哪些行)
    • 执行修改
    • 不重写无关代码
  4. 重新验证:

    • 重新执行导致 FAIL 的验证级别
    • PASS → 更新进度文件,报告修正完成
    • FAIL → 检查轮次
      • 轮次 < 3 → 继续修正
      • 轮次 = 3 → 生成人工介入报告,标记任务为 ⚠️ BLOCKED
  5. 更新进度文件:

    • 记录修正详情到修正记录表
    • 更新任务验证状态

修正约束

  • 每次修正只改必须改的代码
  • 修正不能引入新的编译错误或测试失败
  • 修正后必须重新跑 Level 1 验证
  • 最多3轮,超过自动升级到人工介入

SDD Step Gate

When specs/{REQUIREMENT_ID}/dashboard-state.json exists (SDD workflow active), after this command completes follow .harness/prompts/command-step-gate.md:

  1. Update dashboard-state.json and dashboard.html when applicable.
  2. Mark this command done, next step next, workflow_plan.phase = awaiting_user.
  3. Stop immediately - do not chain the next internal command in the same turn.
  4. Hand off with .harness/prompts/step-gate-handoff.md.

Skip only for standalone invocation without dashboard state, or when the user explicitly asks to batch remaining steps.

Requirement Artifact Path Convention

For a requirement id {REQUIREMENT_ID}, keep all delivery artifacts bucketed by that id:

  • Specs and dashboards: specs/{REQUIREMENT_ID}/
  • Harness sprint plans/progress: .harness/sprints/{REQUIREMENT_ID}/
  • Harness metrics and reports: .harness/metrics/{REQUIREMENT_ID}/

Do not create a second numbered feature folder for the same requirement.

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. 7d ago First seen · 77 lines · 26 tokens per session scan A 61389a1a35d5

Subscribe to this mod's changes

harness-fix is a command published in the GitHub repository hahaxiang27/FlowHarness (4 stars, last pushed 2mo ago), licensed MIT. It adds 26 tokens to every session and 694 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-31.