Getting started

Chain Preflight has three parts that share one engine:

  • Rules for the agent: skills (Claude Code) and rules (Cursor) with the Solidity and Anchor patterns that lose funds, so the code is safer as it's written.
  • The pre-deploy hook: runs when the agent executes a deploy command, scans the project, and asks you (or blocks) before risky deploys.
  • The scanner: 23 built-in quick checks plus the open-source analyzers you have installed, as a CLI and a GitHub Action.

Install

Claude Code (details):

/plugin marketplace add theguysaccount/bitcursor-crypto-coding-client
/plugin install chain-preflight@chain-preflight

Cursor: see Cursor setup.

Terminal (Node.js 18+, nothing to install):

npx -y github:theguysaccount/bitcursor-crypto-coding-client#v0.1.1 scan .
npx -y github:theguysaccount/bitcursor-crypto-coding-client#v0.1.1 doctor

GitHub Actions: see the action.

Install the analyzers you want

The quick checks need nothing. The scan gets much deeper with real analyzers; install any of them and they're picked up automatically:

AnalyzerForInstall
SlitherSoliditypip install slither-analyzer solc-select (Foundry or Hardhat projects compile with forge / hardhat; loose files need solc-select use 0.8.28)
AderynSolidityRetired by Cyfrin on 2026-11-13; no longer installable. An installation you already have still runs.
SolhintSoliditynpm install -g solhint
cargo-auditAnchor / Rustcargo install cargo-audit

chain-preflight doctor shows which are installed. Versions verified each week are on the analyzers page.

The pre-deploy hook

It recognises these commands (also behind npx, pnpm, yarn, cd … &&, environment prefixes, and npm scripts or make targets that run them):

ToolDeploy commandsNetwork from
Foundryforge script … --broadcast, forge create, cast send --create--rpc-url / -f
Hardhathardhat run, hardhat deploy, hardhat ignition deploy--network (none = in-process, local)
Truffletruffle migrate, truffle deploy--network
Anchoranchor deploy, anchor upgrade, anchor idl init/upgrade/…--provider.cluster, else Anchor.toml
Solana CLIsolana program deploy / write-buffer / upgrade / set-upgrade-authority / extend-u / --url, else the Solana CLI config

Networks are classified as local (localhost, anvil, hardhat, localnet), testnet (sepolia, holesky, devnet, testnet, amoy, fuji…), mainnet (mainnet, ethereum, base, arbitrum, optimism, polygon, bsc, mainnet-beta…) or unknown (an environment variable or an RPC URL it can't place).

Then:

NetworkNo high findingsHigh findings
localruns, no scanruns, no scan
testnet or unknownruns; the agent gets the summaryasks you
mainnetasks you, with an audit reminderblocked: the agent explains the findings and proposes fixes

Every scan writes .chain-preflight/latest.md and latest.json in the project (the folder ignores itself in git).

Per-project policy

Create .chain-preflight.json at the project root:

{
  "highOnMainnet": "deny",
  "mainnet": "ask",
  "highElsewhere": "ask",
  "analyzers": true,
  "analyzerTimeoutSeconds": 180
}
  • highOnMainnet: deny (default) or ask.
  • mainnet: ask (default) or allow (only note the findings).
  • highElsewhere: ask (default) or allow, for testnets and unknown networks.
  • analyzers: false runs only the quick checks (faster).

Set CHAIN_PREFLIGHT=off in the environment to disable the hook entirely.

CLI reference

chain-preflight scan [dir] [--report] [--json] [--no-analyzers] [--only slither,aderyn,solhint,cargo-audit] [--fail-on high|medium|low|none]
chain-preflight check "<command>" [--cwd dir]   # what the hook would do with a command
chain-preflight doctor                          # installed analyzers and install commands
chain-preflight rules                           # the quick-check rules

scan exits 1 when there are findings at or above --fail-on (default high).