Home
cd ../playbooks
Developer ToolsAdvanced

Smart Contract Audit

Audit smart contract changes with a structured, actionable report covering security, access control, reentrancy, and MEV exposure.

5 minutes
By communitySource
#smart-contract#security#audit#blockchain#solidity#web3

A single missed vulnerability in a Solidity contract can drain millions in minutes — and manual code review often misses subtle reentrancy or access control flaws. This playbook audits smart contract changes with a structured security report covering access control, reentrancy, MEV exposure, and gas optimization.

Who it's for: Solidity developers reviewing contract changes before deployment to mainnet, DeFi protocol teams auditing upgradeable proxy contracts for security regressions, blockchain security researchers identifying vulnerability patterns in smart contracts, Web3 startup CTOs ensuring contract security before launch, audit firms using automated pre-screening before manual deep-dive reviews

Example

"Audit our updated staking contract before deploying to mainnet" → Smart contract audit pipeline: diff analysis of changed functions and state variables, reentrancy vulnerability scan on external calls, access control verification for privileged functions, MEV exposure assessment for sandwich attack vectors, gas optimization recommendations, and go/no-go deployment recommendation with severity-rated findings

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add smart-contract-audit
SYSTEM
You are a senior smart contract auditor. You are strict, practical, and specific.

CONTEXT
Project: {{project}}
Chain: {{chain}}
Scope: {{scope}}
Threat model: {{threat_model}}
Risk tolerance: {{risk}}
Date: {{date}} (UTC {{time_utc}})

INPUT

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Turns Claude into a senior smart contract auditor that produces structured, actionable audit reports. It covers access control, reentrancy, arithmetic, oracle dependencies, MEV exposure, and more — with concrete exploit scenarios and remediation guidance.


Quick Start

Step 1: Download the Template

Click Download above to get the CLAUDE.md file.

Step 2: Provide Context

Tell Claude the project name, chain, scope, and threat model.

Step 3: Paste Your Contract

Share the contract code or diff you want audited.

Step 4: Get Your Report

Say: "Audit this contract"


What the Report Covers

Section Details
Assumptions Privileged roles, upgradeability, external deps, trust model
Executive Summary Overall risk level + top 3 risks
Findings Critical/High/Medium/Low with impact, exploit scenario, root cause, fix
Checklist Access control, reentrancy, arithmetic, external calls, MEV, ERC compliance
Go/No-Go Ship recommendation with conditions

Finding Format

Each finding includes:

  • Title — Clear, specific name
  • Impact — What goes wrong
  • Exploit scenario — Concrete steps (no code needed)
  • Root cause — Why the vulnerability exists
  • Fix — Exact remediation guidance
  • Test to add — Verification test

Tips

  • Be specific about scope: Tell Claude exactly which contracts/functions to audit
  • Include threat model: "Attacker is an external user" vs "Attacker has admin keys" changes everything
  • State your chain: Different chains have different gotchas (e.g., Arbitrum sequencer, L2 gas)
  • Unknown is okay: The template explicitly handles unknowns rather than guessing

Commands

"Audit this contract for a DeFi lending protocol on Ethereum"
"Focus on the access control and upgradeability patterns"
"What are the top MEV risks in this swap function?"
"Generate the full checklist for this token contract"

Troubleshooting

Report is too generic Provide more context: chain, threat model, and what the contract does.

Missing findings you expected Try: "Also check for [specific vulnerability class]"

Too many low-severity findings Say: "Focus on Critical and High severity only"

$Related Playbooks

Developer Tools

Smart Contract Auditor

Structured audit framework for smart contract security - access control, reentrancy, MEV exposure, and go/no-go recommendations.

5 minutes
Advanced
Developer Tools

Skill Creator

Create modular skills that extend Claude's capabilities with specialized knowledge, workflows, and tool integrations.

20 minutes
Advanced
Developer Tools

Skill Share

Create new Claude skills with proper structure and automatically distribute them to team Slack channels via Rube integration.

15 minutes
Intermediate
Developer Tools

Tech Debt Analyzer

Identify, analyze, document, and track technical debt in JavaScript/TypeScript codebases with automated detection and prioritized remediation plans.

10 minutes
Intermediate
Developer Tools

Test Specialist

Comprehensive JavaScript/TypeScript testing guidance with test writing, bug analysis, coverage analysis, and proactive issue detection.

10 minutes
Intermediate
Developer Tools

Accessibility Engineering for Components

Build accessible UI components at the code level, not just the audit level — 14 concrete engineering principles (focus-visible over bare :focus, roving tabindex for composite widgets, inert-based modal focus trapping, WCAG 2.5.8 hit-area minimums), a common-mistakes table with fixes, and a severity-rated review format ending in a hard Block/Needs-changes/Approve verdict.

5 minutes
Intermediate
Developer Tools

Adversary Emulation: MuddyWater

An intelligence-grounded, authorized purple-team emulation profile for MuddyWater (MITRE ATT&CK G0069), Iran's MOIS-linked cyber-espionage group — attribution, targeting, representative TTPs by ATT&CK tactic, emulation guidance mapped to generic red-team tooling, and paired detection/defense recommendations for every offensive technique, all under an explicit authorized-use caveat.

15 minutes
Advanced
Developer Tools

Adversary Emulation: Turla

An intelligence-grounded, authorized purple-team emulation profile for Turla (MITRE ATT&CK G0010), Russia's FSB-linked espionage group — attribution, distinctive TTPs (satellite C2 hijacking, steganographic email backdoors, parasitizing rival APT infrastructure), emulation guidance mapped to generic red-team tooling, and paired detection recommendations, under an explicit authorized-use and lab-only caveat for rootkit techniques.

15 minutes
Advanced
Developer Tools

AI Agent Red Team Methodology

A first-principles methodology for authorized red-team exercises against AI products, agents, MCP servers, skills, and repositories — capability and trust-boundary modeling, AI-specific attack hypothesis families (prompt injection, tool misuse, data leakage, SSRF), harmless-proof testing with canaries, one-variable-at-a-time adaptive iteration, and business-language evidence-based reporting.

10 minutes
Advanced
Developer Tools

Contribution PR Review

Review an external contributor's PR the way an open-source maintainer should — check automated bot security findings first (across every channel they might post to), watch specifically for suspicious AGENTS.md or workflow-permission changes, scale size and test-coverage expectations by contributor experience, and separate intent/scope alignment from code quality that bots already covered.

10 minutes
Intermediate
Developer Tools

Agent DX CLI Scale

A 7-axis, 0-21 scoring scale for evaluating how well a CLI is designed for AI agents rather than humans — machine-readable output, raw payload input, schema introspection, context-window discipline, input hardening, safety rails, and agent knowledge packaging.

5 minutes
Intermediate
Developer Tools

Agent Design Philosophy

A mental model for designing AI agents in any domain — the model already knows how to be an agent, so design is about capabilities, knowledge, and context, added only as far as a Progressive Complexity ladder (basic → planning → subagents → skills) that real usage actually demands.

10 minutes
Intermediate

Browse all Developer Tools playbooks →