Audit one or all supported agent harnesses (claude, codex, opencode, pi, omp, antigravity, crush) for config efficiency, hook overhead, permission friction, plugin and MCP cost, skill metadata portability, dead config, and measured session friction. Use when invoked as `$optimize-harness [harness ...] [focus]`, or when the user asks to optimize or compare agent harness configuration.
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Audit one or all supported agent harnesses for performance bottlenecks, redundant work, missing permissions, stale configuration, and measured session friction. Produce a prioritized, multi-harness report.
Whitespace-split $ARGUMENTS. Order-independent, no positional meaning:
{claude, codex, opencode, pi, omp, antigravity, crush} adds
that harness to the target set. None given means all seven.{config, hooks, permissions, plugins, mcp, context, sessions, friction, all} sets the focus. None given means all.since:N sets the session window in days for the friction scan, default
30.Example: $optimize-harness claude hooks since:14 resolves to {claude} +
focus hooks + a 14-day session window, with no clarifying question.
Read references/harness-map.md for the per-harness config root, CLI
binary, and known gotchas. For each target harness, check whether its CLI
binary and config root exist. A harness whose root is absent is reported as
not installed / not configured and skipped — it is never rendered as an
empty finding.
scripts/agent-harnesses.py, scripts/agent_plugins.py,
scripts/harness_policy.py, .agents/harness/hooks/,
.agents/harness/generated-paths.json, crates/ness/,
~/.config/ness/policy.toml, and ~/.local/state/ness/applied.json are
human-only ([control_plane] in policy.toml, floored by
REQUIRED_PROTECTED_PATHS in crates/ness/src/active.rs). Policy content
is data: propose a change by writing a candidate to
~/.local/state/ness/proposals/<slug>/policy.toml, adding cases under
~/.config/ness/cases/, running ness policy check <candidate>, and
reporting the verdict diff; the user runs ness policy apply. A fix in one
of the other files above is still a hand-patch for the user to apply.
python3 ~/scripts/harness-sessions.py <slugs> --since <N> --json, and
use its output as the only source of usage and friction claims. Read
references/session-usage-evidence.md before describing any component as
low-use, rarely used, stale, or safe to disable — it defines the
confidence labels and evidence rules this skill must follow.references/session-usage-evidence.md enforced
structurally, not by instruction alone.Each dimension is stated per harness, not just for Claude.
For each active hook (Claude ~/.claude/settings.json; Codex
~/.codex/hooks.json; OMP/Pi/other harnesses per
references/harness-map.md):
harness-sessions.py's ## Hook cost section (Claude only) for measured
firing counts and p50/p95 duration, not guessed cost.Flag hot-path hooks that do too much work. Before flagging any hook as
redundant or overly broad, check git log --oneline -- <hook script> in the
dotfiles repo for prior optimize:/fix: commits — a hook that looks like
duplicated overhead may already be a deliberately tuned guard around an
external tool's fixed event contract. references/harness-map.md records
one known-good exception researched this way; do not re-flag it.
Review recurring command patterns that likely cause unnecessary prompts:
git/GitHub CLI operations, search/navigation tools, build/test/format
tools, and harness-specific scripts. Recommend specific allow rules only
when they are meaningfully safe and scoped. references/harness-map.md
lists the permission command families investigated for Claude; extend per
harness as audited.
Check enabled plugins and active skills for: duplicate functionality, disabled plugins still wired into hooks, large always-loaded instructions, legacy command names that should be skill names, and broken references to removed paths.
Classify each skill as procedural or ability:
$git-commit, $optimize-harness).For procedural skills, check for agents/openai.yaml with:
policy:
allow_implicit_invocation: falseIn Codex 0.162.1, allow_implicit_invocation: false removes the skill from the
model-visible skill list (codex debug prompt-input omits it); the user can still
run it as $<name>. Never set it on a skill that AGENTS.md tells the model to use
on its own. A reference from another skill to a flagged procedural skill is fine
when that reference only hands off to the user-run entry point (for example
using-git-worktrees pointing at /git:worktree) or sits inside a workflow the user
started explicitly (backlog-batch-delivery steps, executing-plans finishing with
branch-finish); do not report those as flag mistakes. If a rarely used procedural
skill should not appear in context at
all, recommend disabling it via harness-specific config ([[skills.config]] enabled = false for Codex) or moving it out of scanned skill paths. Do not
recommend creating a separate classify-skill skill unless the rubric is reused by
multiple workflows.
Check configured MCP servers per harness for high timeouts, disabled-but-
stale entries, missing commands, or servers that connect on every session
but are rarely called — cross-reference against the scanner's mcp_call
observations rather than guessing from config alone.
Review global/project instructions, session-start output, and skill descriptions for verbosity or stale references, per harness.
When optimizing shared skills or porting harness features between the
seven supported harnesses, read references/agent-harness-portability.md
for the current attribute mapping and source notes:
SKILL.md frontmatter minimal: name and description
first. Treat allowed-tools, disable-model-invocation, paths, model
hints, and UI metadata as harness-specific unless the target's primary
docs confirm support.agents/openai.yaml; OMP local adapter; etc. — see
references/harness-map.md).references/, deterministic repeat work into
scripts/, and output resources into assets/.CAPABILITIES in scripts/harness_capabilities.py, regenerate
docs/agent-harnesses.* and docs/harness/ via just harness-generate,
and update references/agent-harness-portability.md in the same change.
The harness-research skill is the full per-release procedure.Use python3 ~/scripts/harness-sessions.py <slugs> --since <N> --json
(already run in step 1 of Execution shape) for:
references/session-usage-evidence.md's confidence labels.Never render unknown/not observed as unused.
Harness config roots in the dotfiles repo are allowlist-governed:
.gitignore denies <root>/* and re-includes named paths with !. That
fails safe — a new credential file is ignored by default — but it also
means a genuinely new config file never appears in git status. Nothing
prompts you to track it.
Close that blind spot with:
just audit-ignored-config # all curated harness roots
just audit-ignored-config .omp .pi # narrow to specific rootsThe script classifies ignored, untracked files under those roots in the
checkout, and every regular (non-symlink) file under the same roots in
$HOME that the checkout does not deploy (printed with a ~/ prefix), as
secret, runtime state, vendored package content, or config candidate. It
reports only the candidates plus two hazards: config-shaped files carrying
credential material, and already-tracked files that look like credentials.
Triage each candidate:
~/dev/dotfiles) at the same relative path, add
a ! rule to the checkout's .gitignore in sorted position
(scripts/sort-gitignore), git add it, run just home-spec, then
just home-apply to link it back into $HOME.STATE_DIRS in scripts/audit-ignored-config.py
rather than dismissing it by hand every audit; for a single
installer-written file, add its path to INSTALLED_PATHS instead.Never propose tracking these, whatever the report says:
| Class | Examples | Why |
|---|---|---|
| Credential stores | .omp/agent/agent.db, .pi/agent/auth.json, *.env | OAuth tokens and API keys |
| Secret definitions | .omp/agent/secrets.yml, secret-placeholder.key | Plaintext secrets and their HMAC key |
| Trust grants | .pi/agent/trust.json, .config/homebrew/trust.json, .codex/config.toml [projects] trust_level | A per-machine security decision. Replicating it auto-approves on a fresh host a directory you only vetted on one machine — a privilege escalation dressed as config. |
| Machine identity | .omp/install-id | Per-install UUID; copying it merges telemetry identities |
| Transcripts | sessions/, history.db, blobs/ | May contain anything typed or read |
Flag any hit in the "tracked files that look like credentials" section as
Critical in the report, even if it turns out to be a false positive
from a test fixture or an .env.example.
## Harness Optimization Report
### Coverage
| Harness | Version | Config root | Sessions scanned | Window | Gaps |
|---|---|---|---|---|---|
### Critical
| # | Harness | Issue | Evidence | Impact | Fix |
|---|---|---|---|---|---|
### High
| # | Harness | Issue | Evidence | Impact | Fix |
|---|---|---|---|---|---|
### Low
| # | Harness | Issue | Evidence | Impact | Fix |
|---|---|---|---|---|---|
### Already Good
- ...The Evidence column must cite a scanner counter (e.g. "2942 Bash
PostToolUse firings, p95 219ms") or a config path. A finding with no
evidence is dropped, not softened.
After reporting, ask which fixes to implement. Do not mutate config during the audit.
phatblat/dotfiles
4d65cab
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.