harness

A command-line setup for connecting the ctx quality suite to Claude Code or Codex, which are AI coding environments, through project files, hooks, and optional plugins.

In plain words
What is it for?
Initializing a Claude Code or Codex integration, creating a distributable plugin, checking compatibility, and diagnosing the setup.
Why use it?
It removes the manual work of wiring quality checks and shared rules into an AI coding environment.

Command

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 commands/agentis-tools/ctx/harness
Clone the repo
git clone --depth 1 https://github.com/agentis-tools/ctx
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,167 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.02167
Opus 5 $0.00000 $0.01084
Sonnet 5 $0.00000 $0.00433
Haiku 4.5 $0.00000 $0.00217

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

Security

Grade A, and why

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 2d 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.

docs/commands/harness.md · 174 lines

How it starts

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

ctx harness

Package ctx as an AI coding harness integration (Claude Code).

Synopsis

ctx harness init [--target claude|codex] [--mode local|plugin] [--force] [--json]
ctx harness compat --require <SEMVER>
ctx harness doctor [--json]

Description

The harness command wires the ctx quality suite into an AI coding harness. Supported targets are Claude Code (--target claude, the default) and Codex (--target codex); unknown targets are rejected with exit code 2 and a list of supported values.

Codex

ctx harness init --target codex writes trusted-project lifecycle configuration to .codex/hooks.json, scripts under .codex/hooks/ctx/, and the shared starter .ctx/rules.toml. It prints a guidance block for manual inclusion in AGENTS.md. Review and trust new or changed hook definitions with /hooks before relying on them.

ctx harness init --target codex --mode plugin creates a distributable Codex plugin with .codex-plugin/plugin.json, lifecycle hooks, the ctx skill, an optional MCP configuration, and .agents/plugins/marketplace.json for local installation.

Everything init writes comes from templates embedded in the ctx binary, and every generated file carries a header:

# generated by ctx v0.2.1 — regenerate with 'ctx harness init'
# ctx:checksum sha256:<hex>

The checksum makes regeneration safe: on re-run, files that still match their recorded checksum are regenerated in place, while files you have modified (or files ctx never generated) are skipped with a warning. --force overwrites them. JSON files cannot carry comments, so they are tracked in a manifest, .ctx/harness.lock, instead.

Two files get special treatment:

  • .ctx/rules.toml is never overwritten once it exists, not even with --force — it encodes your policy, not ctx's.
  • .claude/settings.json is never edited by ctx at all; init prints a snippet for you to merge manually.

init --mode local (default)

Wires the current project's .claude/ directory:

Read the full file on GitHub · 174 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. 2d ago First seen · 174 lines · 0 tokens per session scan A f141b98d7bdb

Subscribe to this mod's changes

harness is a command published in the GitHub repository agentis-tools/ctx (11 stars, last pushed 15d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,167 tokens. 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.