fuzzing-patterns

fuzzing-patterns is a skill for Claude Code, Codex from ccashwell/evm-cortex. It costs 50 tokens per session (1,667 once invoked), scanned A, original, MIT.

A guide to fuzz testing Solidity contracts with Foundry. Fuzz testing runs tests with many generated inputs, while stateful fuzzing also tries sequences of calls against accumulated contract state.

In plain words
What is it for?
Use it to write stateless or stateful fuzz tests, constrain generated values, configure runs, seed a test corpus, and investigate failing inputs.
Why use it?
It helps find unexpected failures and counterexamples that fixed test inputs may not cover. It can check properties such as whether depositing and redeeming assets creates unintended profit.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import {Vault} from "../src/Vault.sol";.

Good fit Use it to write stateless or stateful fuzz tests, constrain generated values, configure runs, seed a test corpus, and investigate failing inputs.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex
agentmods
npx agentmods add skills/ccashwell/evm-cortex/fuzzing-patterns

Made for: Claude Code, Codex.

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 fuzzing-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccashwell/evm-cortex/fuzzing-patterns/github.svg)](https://agentmods.dev/skills/ccashwell/evm-cortex/fuzzing-patterns)
Your own site
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/fuzzing-patterns"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/fuzzing-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fuzzing-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/fuzzing-patterns"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/fuzzing-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,667 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00050 $0.01667
Opus 5 $0.00025 $0.00834
Sonnet 5 $0.00010 $0.00333
Haiku 4.5 $0.00005 $0.00167

Measured 7d ago against content hash 9df5b9bd7d23, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

fuzzing-patterns 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 7d 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.

skills/fuzzing-patterns/SKILL.md · 205 lines

How it starts

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

Fuzz Testing Patterns

Stateless vs Stateful Fuzzing

Type How It Works Use Case
Stateless Random inputs per test, fresh state each run Individual function properties
Stateful Random sequences of calls, accumulated state System-level invariants

Stateless = function testFuzz_*(uint256 x) — Foundry randomizes x each run. Stateful = invariant tests with handlers (see invariant-testing skill).

Basic Fuzz Test

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vault} from "../src/Vault.sol";

contract VaultFuzzTest is Test {
    Vault vault;

    function setUp() public {
        vault = new Vault(address(token));
        deal(address(token), address(this), type(uint128).max);
        token.approve(address(vault), type(uint256).max);
    }

    // Property: deposit then redeem never yields more than deposited
    function testFuzz_depositRedeemNoProfit(uint256 assets) public {
        assets = bound(assets, 1, type(uint128).max);

        uint256 shares = vault.deposit(assets, address(this));
        uint256 received = vault.redeem(shares, address(this), address(this));

        assertLe(received, assets, "profit from round-trip");
    }

    // Property: transfer preserves total supply
    function testFuzz_transferPreservesSupply(
        address to,
        uint256 mintAmount,
        uint256 transferAmount
    ) public {
        vm.assume(to != address(0) && to != address(this));
        mintAmount = bound(mintAmount, 1, type(uint128).max);
        transferAmount = bound(transferAmount, 0, mintAmount);

        vault.deposit(mintAmount, address(this));
        uint256 supplyBefore = vault.totalSupply();

        vault.transfer(to, transferAmount);
        uint256 supplyAfter = vault.totalSupply();

        assertEq(supplyBefore, supplyAfter, "supply changed on transfer");
    }
}

Input Constraining

bound() vs vm.assume()

Read the full file on GitHub · 205 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. 7d ago First seen · 205 lines · 50 tokens per session scan A 9df5b9bd7d23

Subscribe to this mod's changes

fuzzing-patterns is a skill published in the GitHub repository ccashwell/evm-cortex (128 stars, last pushed yesterday), licensed MIT. It adds 50 tokens to every session and 1,667 once invoked, about $0.0003 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-03.