agent-preflight

agent-preflight is a command for coding agents from davepoon/buildwithclaude. It costs 9 tokens per session (600 once invoked), scanned A, original, MIT.

A safety check for a coding agent before it changes files in a repository. It produces a short review record of the requested work, likely affected resources, protected areas, and the risk of the change.

In plain words
What is it for?
Use it before agent-led coding tasks to inspect the repository, identify its tests and configuration, map the possible damage area, and classify the change as lower or higher risk.
Why use it?
It reduces the chance that an agent edits secrets, deployment settings, authentication code, or other sensitive files without warning. It also separates read-only inspection from actions that modify the project.

Command

Part of the all-commands plugin — 23 commands shipped together

About the project

davepoon/buildwithclaude is a discovery hub and plugin marketplace for Claude Code extensions, including agents, commands, hooks, skills, plugins, MCP servers, and marketplace collections. Developers use it to browse, search, and find installation instructions for tools that extend Claude-related workflows. Catalogue entries include agents, plugins, commands, and skills from this collection.

davepoon/buildwithclaude · 3,415 stars · on GitHub · buildwithclaude.com

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/davepoon/buildwithclaude/agent-preflight
Clone the repo
git clone --depth 1 https://github.com/davepoon/buildwithclaude

Or install all-commands, the plugin that ships this one along with the rest of its 23 commands.

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 agent-preflight

README.md
[![agentmods](https://agentmods.dev/badge/commands/davepoon/buildwithclaude/agent-preflight.svg)](https://agentmods.dev/commands/davepoon/buildwithclaude/agent-preflight)
Your own site
<a href="https://agentmods.dev/commands/davepoon/buildwithclaude/agent-preflight"><img src="https://agentmods.dev/badge/commands/davepoon/buildwithclaude/agent-preflight.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 600 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.00009 $0.00600
Opus 5 $0.00005 $0.00300
Sonnet 5 $0.00002 $0.00120
Haiku 4.5 $0.00001 $0.00060

Measured today against content hash 0049c2b58380, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

agent-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 today.

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.

plugins/all-commands/commands/agent-preflight.md · 65 lines

How it starts

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

Agent Preflight

Run this before letting Claude Code, Codex, Cursor, or another coding agent modify a real repository. The goal is to make the agent produce a short, reviewable safety receipt before any file-changing work starts.

Instructions

  1. Identify the proposed agent task

    • Restate the requested change in one sentence.
    • List the files, directories, commands, secrets, services, and package managers the agent is likely to touch.
    • Flag any task that asks for credentials, payment details, KYC, production deploys, destructive commands, private prompt extraction, or unclear external network access.
  2. Map the repository blast radius

    • Inspect the project layout, dependency manifests, test commands, CI config, lockfiles, and deployment files.
    • Identify protected paths such as .env*, secrets, auth code, billing code, migration files, infra config, release scripts, and generated artifacts.
    • Separate safe read-only exploration from write operations.
  3. Score the change before editing

    • Mark the task Green when it is local, reversible, tested, and limited to low-risk files.
    • Mark it Yellow when it touches dependencies, config, generated code, authentication-adjacent logic, or unclear test coverage.
    • Mark it Red when it may expose secrets, change payment/auth/deployment behavior, delete data, or run untrusted code.
  4. Create guardrails for the agent run

    • State the allowed files and commands.
    • State the blocked files and commands.
    • Require a branch or patch workflow for Yellow/Red work.
    • Require tests, lint, or a dry-run command before reporting success.
    • Require the agent to stop and ask before crossing any listed boundary.
  5. Produce a preflight receipt

    • Output a concise Markdown receipt with: task summary, risk level, allowed scope, blocked scope, test plan, rollback plan, and exact stop conditions.
    • Do not perform the actual implementation in the same response unless the user explicitly approves the receipt.

Read the full file on GitHub · 65 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. today First seen · 65 lines · 9 tokens per session scan A 0049c2b58380

Subscribe to this mod's changes

agent-preflight is a command published in the GitHub repository davepoon/buildwithclaude (3,415 stars, last pushed yesterday), licensed MIT. It adds 9 tokens to every session and 600 once invoked, about $0.0000 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-09-05.