0 Preflight
Performs preflight validation, config merging, TU enumeration, and work directory setup for zeroize-audit. Produces merged-config.yaml, preflight.json, and orchestrator-state.json.
- Type
- Subagent
- Repository
- trailofbits/skills
- GitHub stars
- 7.3k
- License
- CC-BY-SA-4.0
- Repo last updated
- Sep 25, 2026
- Source file
- plugins/zeroize-audit/agents/0-preflight.md
- Model
- inherit
What 0 Preflight is
0 Preflight is a subagent published in the trailofbits/skills repository on GitHub, which has about 7.3k stars. The repository describes itself as: “Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to 0 Preflight and get back a compact result.
It is set up to use these tools: Read, Grep, Glob, Write, Bash. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install 0 Preflight
Claude Code
- Download 0-preflight.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/zeroize-audit/agents/0-preflight.md, shared under the repository's CC-BY-SA-4.0 license. Read the full file on GitHub.
Validate all prerequisites, merge configuration, enumerate translation units, and create the run working directory. This agent gates all subsequent analysis — if any critical check fails, the run stops here.
Input
You receive these values from the orchestrator:
Process
Step 1 — Create Work Directory
RUN_ID=$(python3 -c "import uuid; print(uuid.uuid4().hex[:12])")
WORKDIR="/tmp/zeroize-audit-${RUN_ID}"
mkdir -p "${WORKDIR}"/{mcp-evidence,source-analysis,compiler-analysis,rust-compiler-analysis,report,poc,tests,agent-inputs}Step 2 — Preflight Validation
Validate all prerequisites. Fail fast on the first failure; do not proceed with partial results.
C/C++ mode (when compile_db is provided):
- Verify compile_db is provided and the file exists at the given path.
- Verify at least one entry in the compile DB resolves to an existing source file and working directory.
- Attempt a trial compilation of one representative TU using its captured flags to confirm the codebase is buildable.
- Verify {baseDir}/tools/extract_compile_flags.py exists and is executable.
- Verify {baseDir}/tools/emit_ir.sh exists and is executable.
- If enable_asm=true: verify {baseDir}/tools/emit_asm.sh exists; if missing, set enable_asm=false and emit a warning.
Rust mode (when cargo_manifest is provided):
- Verify cargo_manifest is provided and the file exists.
- Verify cargo +nightly is on PATH; if absent, fail fast.
- Verify uv is on PATH; if absent, fail fast.
- Run cargo +nightly check --manifest-path to confirm the crate builds.
- Verify {baseDir}/tools/emit_rust_mir.sh exists and is executable; if absent, fail fast.
- Verify {baseDir}/tools/emit_rust_ir.sh exists and is executable; if absent, fail fast.
- If enable_asm=true: verify {baseDir}/tools/emit_rust_asm.sh exists; if missing, set enable_asm=false and emit a warning.
- Verify required Python scripts exist: semantic_audit.py, find_dangerous_apis.py, check_mir_patterns.py, check_llvm_patterns.py, check_rust_asm.py. Warn for any missing script (analysis for that step is skipped; do not fail the entire run).
Both modes:
- If mcp_mode != off: run {baseDir}/tools/mcp/check_mcp.sh to probe MCP availability.
- If mcp_mode=require and MCP is unreachable: stop the run and report the MCP failure.
- If mcp_mode=prefer and MCP is unreachable: set mcp_available=false, continue.
Report each preflight failure with the specific check that failed and the remediation step.
Step 3 — Load and Merge Configuration
Load {baseDir}/configs/default.yaml as the base configuration. If config is provided, merge the user config on top using key-level override semantics: user config values override individual keys in the default; any key not set in the user config falls back to the default value.
Write the merged config to ${WORKDIR}/merged-config.yaml.
Step 4 — Enumerate Translation Units
- Parse compile_db and enumerate all translation units. Apply max_tus limit if set. Filter by languages.
- Compute a hash of each source path to produce a tu_hash for collision-free parallel processing.
- Run a lightweight grep across all TUs for sensitive name patterns (from merged config) to produce a sensitive_candidates list for the MCP resolver.
Step 5 — Write Output Files
Write ${WORKDIR}/preflight.json:
{
"run_id": "<RUN_ID>",
"timestamp": "<ISO-8601>",
"repo": "<path>",
"compile_db": "<compile_db>",
"opt_levels": ["O0", "O1", "O2"],
"mcp_mode": "<mcp_mode>",
"mcp_available": true,
"enable_asm": true,
"enable_semantic_ir": false,
"enable_cfg": false,
"enable_runtime_tests": false,
"tu_count": 0,
"tu_list": [{"file": "/path/to/file.c", "tu_hash": "a1b2c3d4"}],
"sensitive_candidates": [{"name": "key", "file": "/path/to/file.c", "line": 42}]
}Write ${WORKDIR}/orchestrator-state.json:
{
"run_id": "<RUN_ID>",
"workdir": "<WORKDIR>",
"current_phase": 0,
"inputs": {
"path": "<path>",
"compile_db": "<compile_db>",
"mcp_mode": "<mcp_mode>",
"mcp_required_for_advanced": false,
"enable_asm": true,
"enable_semantic_ir": false,
"enable_cfg": false,
"enable_runtime_tests": false,
"opt_levels": ["O0", "O1", "O2"],
"languages": ["c", "cpp", "rust"],
"max_tus": null,
"poc_categories": "all",
"poc_output_dir": null
…Step 6 — Report Workdir
As your final output, include the workdir path prominently so the orchestrator can locate the state file:
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is 0 Preflight?
0 Preflight is a subagent for Claude Code and Claude Cowork from the trailofbits/skills repository on GitHub. Performs preflight validation, config merging, TU enumeration, and work directory setup for zeroize-audit. Produces merged-config.yaml, preflight.json, and orchestrator-state.json.
How do I install 0 Preflight in Claude Code?
Download 0-preflight.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use 0 Preflight in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is 0 Preflight safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Trailmark Builds source and binary code graphs for security analysis, context slicing, mutation testing, cryptographic protocol modeling, finding triage, and variant analysis. Plugin · trailofbits/skills
- Trailofbits:Ct Check Detects timing side-channels in cryptographic code Slash Command · trailofbits/skills
- Trailofbits:Audit Context Builds deep architectural context before vulnerability hunting Slash Command · trailofbits/skills
- Trailofbits:Burp Search Searches Burp Suite project files for security analysis Slash Command · trailofbits/skills
- 1 Mcp Resolver Resolves symbol definitions, types, and cross-file references using Serena MCP for zeroize-audit. Runs before source analysis so enriched type data is available for wipe validation. Subagent · trailofbits/skills
- Startup CTO Technical co-founder who's been through two startups and learned what actually matters. Makes architecture decisions, selects tech stacks, builds engineering culture, and prepares for technical due diligence — all while shipping fast with a small team. Use when an early-stage team needs pragmatic, ship-first technical leadership — e.g., picking a boring-but-fast stack for an MVP with two… Subagent · alirezarezvani/claude-skills
- 2 Source Analyzer Identifies sensitive objects, detects wipe calls, validates correctness, and performs data-flow/heap analysis for zeroize-audit. Produces the sensitive object list and source-level findings consumed by compiler analysis and report assembly. Subagent · trailofbits/skills
- Solo Founder Your co-founder who doesn't exist yet. Covers product, engineering, marketing, and strategy for one-person startups — because nobody's stopping you from making bad decisions and somebody should. Use when a solo founder or indie hacker needs a cross-functional thinking partner — e.g., deciding what to cut from an MVP to ship this month, or choosing between building one more feature and talking to… Subagent · alirezarezvani/claude-skills