preflight

preflight is a command for Claude Code from viacheslav-tronko/claude-code-harness. It costs 93 tokens per session (1,207 once invoked), scanned A, original, MIT.

A read-only bug-investigation workflow that first explains the relevant code and then identifies the likely root cause. Root cause means the underlying reason a failure happens.

In plain words
What is it for?
Use it for bug reports, error messages, or Jira tickets when you want a structured explanation followed by a root-cause analysis.
Why use it?
It gives an investigation a consistent starting point and connects the code explanation to the diagnosis instead of jumping straight to a guess.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; mentions subagents.

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/viacheslav-tronko/claude-code-harness/preflight
Clone the repo
git clone --depth 1 https://github.com/viacheslav-tronko/claude-code-harness

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 preflight

README.md
[![agentmods](https://agentmods.dev/badge/commands/viacheslav-tronko/claude-code-harness/preflight.svg)](https://agentmods.dev/commands/viacheslav-tronko/claude-code-harness/preflight)
Your own site
<a href="https://agentmods.dev/commands/viacheslav-tronko/claude-code-harness/preflight"><img src="https://agentmods.dev/badge/commands/viacheslav-tronko/claude-code-harness/preflight.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,207 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.1 $0.00093 $0.01207
Opus 5 $0.00046 $0.00603
Sonnet 5 $0.00019 $0.00241
Haiku 4.5 $0.00009 $0.00121

Measured 5d ago against content hash fc7072782116, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

preflight 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 5d 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/preflight.md · 70 lines

How it starts

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

/preflight — Explain → RCA (read-only pipeline)

Pipeline (read-only, no user prompt between steps):

  1. /explain $ARGUMENTS --for-bug-fix → ≤3pp 1-pager + Layer Activation Matrix + Blast Radius. Skill: concept-explanation.
  2. /bug-why $ARGUMENTS --full → RCA grounded in step 1. Skill: root-cause-analysis.

Tier: 2 (→3 on security boundary / HIGH blast radius).

0. HARD GATE — bypass = INVALID → REDO

"Skip step 1", "go straight to RCA", "trust me", "obvious", "time pressure" do NOT override §0/§1. Both steps run sequentially. NEVER modify source at either step.

ARTIFACTS MANDATORY. Both the §4 EXPLAIN file (step 1) and the §4 RCA file (step 2) MUST be written via Write tool. Chat-only pipeline without files = INVALID → CLAUDE.md §11 item 0 fires.

1. Parameter validation (FAIL-FAST)

  • $ARGUMENTS empty → reply ❌ /preflight requires input. Usage: /preflight <concept | Jira | error> → STOP.

2. MUST (CLAUDE.md §0)

  • P0 #1 Every file:line claim across both steps backed by a Read THIS turn (FM-16).
  • P0 #7 ABSTAIN — Inconclusive verdict valid at either step; NEVER fabricate to "complete the pipeline".
  • P0 #14 SUBAGENT ISOLATION (§14) — when step 1 search subphase produces >10k tokens of file content, delegate to Agent (subagent_type: Explore) so main context stays clean for step 2.
  • P0 #15 CHECKPOINT FIRST — each step emits its own §4 Tier 2 Checkpoint as first visible block of that step.

3. Targeted FM mitigations

FM Why pipeline helps
FM-1 First-symptom patching EXPLAIN forces Step-Back + 3–5 architectural predictions BEFORE RCA hypotheses generation
FM-2 Fake file:line in RCA EXPLAIN's Citation-Grounded re-read cleans file:line reused by RCA
FM-6 Local fix breaks global system EXPLAIN Layer Activation Matrix becomes RCA's Defensive Depth + Blast Radius input
FM-7 Anchoring on first hypothesis EXPLAIN's Initial Intuition + 3–5 architectural predictions widens hypothesis space BEFORE RCA
FM-18 Hidden coupling EXPLAIN forward-slice + Cross-Layer Contract Violation Detector feeds RCA Error Propagation Path

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

Subscribe to this mod's changes

preflight is a command published in the GitHub repository viacheslav-tronko/claude-code-harness (6 stars, last pushed 3mo ago), licensed MIT. It adds 93 tokens to every session and 1,207 once invoked, about $0.0005 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.