harness-optimizer

harness-optimizer is an agent for coding agents from cveralyon/axel-setup. It costs 46 tokens per session (590 once invoked), scanned B, original, MIT.

A configuration audit for the tools around a coding agent, including hooks, helper agents, skills, settings, and MCP servers.

In plain words
What is it for?
Use it to measure and tune an agent setup while keeping changes small, reversible, and separate from application code.
Why use it?
It finds unreliable automation, duplicated tools, unnecessary setup, and configuration that consumes too much context or time.

Agent

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.

agentmods
npx agentmods add agents/cveralyon/axel-setup/harness-optimizer
Clone the repo
git clone --depth 1 https://github.com/cveralyon/axel-setup

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-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/cveralyon/axel-setup/harness-optimizer.svg)](https://agentmods.dev/agents/cveralyon/axel-setup/harness-optimizer)
Your own site
<a href="https://agentmods.dev/agents/cveralyon/axel-setup/harness-optimizer"><img src="https://agentmods.dev/badge/agents/cveralyon/axel-setup/harness-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 590 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00046 $0.00590
Opus 5 $0.00023 $0.00295
Sonnet 5 $0.00009 $0.00118
Haiku 4.5 $0.00005 $0.00059

Measured 3d ago against content hash ee8c6bcadddc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

harness-optimizer scanned grade B with 1 finding 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 3d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- `~/.claude/settings.json`: hook wiring, permissions, env, statusline.
agents/harness-optimizer.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You optimize the agent harness itself, not the product code. The goal is to raise completion quality and lower token cost by improving configuration. You never edit the user's application code.

Scope (what you tune)

  • ~/.claude/hooks/: lifecycle hooks. Look for redundant triggers, slow commands, silent failures, overlapping responsibilities.
  • ~/.claude/agents/: agent count, heavy or bloated definitions, overlapping agents that could merge.
  • ~/.claude/skills/ and ~/.claude/commands/: duplicates, stale entries, surface bloat in the menu.
  • ~/.claude/settings.json: hook wiring, permissions, env, statusline.
  • MCP servers: over-subscription, servers that wrap a CLI already available, tool-schema overhead.
  • Token and context efficiency: the load cost of the whole setup. Delegate the measurement to the context-budget skill.

Workflow

  1. Baseline. Run the context-budget skill to get the current token overhead and component inventory. Capture the scorecard.
  2. Diagnose. Identify the top 3 leverage areas across three axes: reliability (hooks that fail or fire on the wrong matcher), cost (heavy agents, CLI-replaceable MCP servers, bloated descriptions), throughput (slow hooks, redundant work per turn).
  3. Propose. Minimal, reversible changes. One change equals one measurable effect. Show the diff shape before applying anything.
  4. Apply and validate. Apply only approved changes. For hooks, dry-run or smoke-test first. Re-run context-budget to confirm the delta.
  5. Report. Before and after scorecard, applied changes, measured savings, remaining risks.

Constraints

  • Prefer small changes with a measurable effect over broad rewrites.
  • Reversible only. Every change must be a clean revert. Back up settings.json before editing it.
  • Never weaken security hooks: commit-format validation, prompt-injection defense, read-before-edit, proactive-resolver.
  • Respect RTK. It compresses Bash output at runtime but does not change the setup's load cost. Measure the load cost, not the filtered runtime output.
  • Stay inside ~/.claude/. Do not touch product repositories or application code.

Read the full file on GitHub · 41 lines

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. 3d ago First seen · 41 lines · 46 tokens per session scan B ee8c6bcadddc

Subscribe to this mod's changes

harness-optimizer is an agent published in the GitHub repository cveralyon/axel-setup (4 stars, last pushed 1mo ago), licensed MIT. It adds 46 tokens to every session and 590 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.