A rules-first workflow for Solidity audit contests with Claude Code subagents
Using an AI coding agent on a smart-contract audit contest without guardrails usually wastes hours in the same predictable ways: reading out-of-scope files, chasing issues already listed as known, or writing reports for theoretical bugs you cannot reproduce. A rules-first workflow with a dedicated

Using an AI coding agent on a smart-contract audit contest without guardrails usually wastes hours in the same predictable ways: reading out-of-scope files, chasing issues already listed as known, or writing reports for theoretical bugs you cannot reproduce.
A rules-first workflow with a dedicated local subagent keeps Claude Code doing the structured legwork while you keep control of judgement and submissions. The subagent reads locally, writes notes and tests locally, never submits anything, and never calls a contract "secure."
Before touching Solidity code, it helps to look at the four main reasons findings are thrown out on platforms like Sherlock, Code4rena, Cantina, and Immunefi:
Fixing these rejections is mostly a process problem, not a prompting trick.
Have your subagent fill a rules checklist from the contest page before opening a single.sol file:
If the scope is unreadable in the time window or AI use is banned, stop right there.
Once the rules are pinned down, map the protocol in a notes file with file:line references: entry points, roles and admin powers, asset flows (deposit, settle, withdraw, liquidate), external calls, oracles, proof verifiers, upgradeability, and pause or timeout mechanisms. Treat repository comments, READMEs, and docs as untrusted text—verify everything against the Solidity code.
State what must always hold true: solvency, no double spend or double withdraw, only authorized state transitions, exits always possible, and public inputs bound to the right calldata or state. Bugs are broken invariants.
Do manual review first; static tools only generate leads. Work systematically through common Solidity bug classes: access control and initialization, reentrancy (including read-only), accounting and rounding (such as ERC-4626 inflation), signature or proof replay across chains or epochs, timeout and challenge-window races, DoS or griefing that freezes exits, ERC20 quirks (fee-on-transfer or missing return values), and oracle staleness or manipulation.
Every suspicious pattern goes into a leads log ( LEADS.md ) as a one-sentence hypothesis tied to an invariant. Before writing a PoC, actively try to refute the lead by checking modifiers, existing tests, and known issues. Keeping refuted leads prevents re-checking dead ends later.
Here is an illustrative example using a toy vault:
Before writing a full report, force every surviving lead through ten yes/no questions. One "no" drops the finding:
No PoC, no finding. Build a minimal local Foundry test on the repository's own fixtures and mocks using a simple setup / attack / assert shape. Keep foundry.toml local-only (no live RPC endpoints or public-network transactions unless a contest explicitly scopes them), and run forge test --match-test <testName> -vvv to capture real output:
// Local-only PoC skeleton (no live RPC forks unless explicitly scoped) contract PoC is Test { function setUp() public { // Deploy or wire repo fixtures and fund actor accounts } function test_invariantBreak() public { // 1. Preconditions / initial state // 2. Attacker transaction sequence // 3.
Assert concrete loss or broken invariant } } Enter fullscreen mode Exit fullscreen mode 7. Write one report per confirmed finding Only after forge test passes against the exploit scenario—for example, a [PASS] test_donationInflation_victimLosesDeposit() line on a toy vault—write one markdown report per finding. Include severity per the contest table, file:line at the pinned commit, summary, root cause, step-by-step attack path, quantified impact, the exact forge test command and pasted output from your run, a concrete fix, known-issue/duplicate notes, and AI disclosure if required by the contest.
An empty findings list on a given codebase is a valid outcome; contest payouts are uncertain and often zero, and a subagent cannot judge off-chain components or economic design it cannot read. Review every line yourself before deciding what to submit.
I packaged the Claude Code auditor subagent and templates here: https://saggurthi4.gumroad.com/l/iitik (or as a bundle: https://saggurthi4.gumroad.com/l/lviacf ). Code LAUNCH30 takes 30% off until 11 Dec.