Home
cd ../playbooks
Developer ToolsAdvanced

Smart Contract Auditor

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

5 minutes
By andreolfSource
#smart-contracts#security-audit#blockchain#solidity#web3#defi

Professional smart contract audits cost $50K+ and take weeks, but you need security feedback during development, not just before launch. This playbook provides a structured audit framework that checks access control, reentrancy, integer overflow, MEV exposure, and delivers go/no-go recommendations.

Who it's for: blockchain developers wanting continuous security feedback during smart contract development, DeFi teams building internal audit processes between expensive external audits, security-focused Solidity engineers creating pre-audit checklists for their contracts, Web3 protocol teams evaluating third-party contract integrations for security risks, smart contract bootcamp students learning systematic vulnerability identification

Example

"Run a security audit on our DEX router contract" → Audit framework pipeline: systematic vulnerability checklist (reentrancy, access control, integer overflow, front-running), function-by-function security analysis with severity ratings, state variable mutation tracking across external calls, recommended fixes with code snippets, and executive summary with go/no-go deployment recommendation

CLAUDE.md Template

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

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
{{input}}

TASK
Audit the contract changes and produce an actionable report.

RULES
- If information is missing or unknown, state "Unknown" explicitly
- State all assumptions clearly in the Assumptions section
- Do not fabricate or hallucinate facts
- Be deterministic: same input should produce consistent output structure
- Ask at most 3 clarifying questions only if scope or threat model is missing
- Prioritize exploitable issues first
- Provide concrete PoC steps (no code needed) and exact remediation guidance

OUTPUT SCHEMA
1) Clarifying questions (only if needed)
- Q1:
- Q2:
- Q3:

2) Assumptions
- Privileged roles: (admin keys, ownership patterns - state "Unknown" if not visible in code)
- Upgradeability pattern: (UUPS/Transparent/Beacon/None/Unknown - analyze proxy patterns)
- External dependencies: (Oracles, external contracts - list specific addresses/interfaces or state "None detected")
- Trust model: (Who is trusted, what can they do - be explicit about admin powers)

3) Executive risk summary
- Overall risk: (Low/Medium/High/Critical)
- Top 3 risks (bullets)

4) Findings
A) Critical
- Title:
  - Impact:
  - Exploit scenario:
  - Root cause:
  - Fix:
  - Test to add:

B) High
(same schema)

C) Medium
(same schema)

D) Low
(same schema)

5) Checklist
- Access control: (Pass/Fail/Unknown - role validation, modifier usage, unauthorized access vectors)
- Reentrancy: (Pass/Fail/Unknown - CEI pattern, reentrancy guards, external call safety)
- Arithmetic and rounding: (Pass/Fail/Unknown - overflow/underflow, precision loss, rounding directions)
- External calls and callbacks: (Pass/Fail/Unknown - call return values, gas limits, untrusted contracts)
- Upgradability and admin keys: (Pass/Fail/Unknown - upgrade mechanism security, admin key risks, timelock protection)
- Oracle dependencies: (Pass/Fail/Unknown - price manipulation, stale data, fallback mechanisms)
- MEV and sandwich exposure: (Pass/Fail/Unknown - frontrunning risks, slippage protection, ordering dependencies)
- ERC compliance: (Pass/Fail/Unknown - standard adherence, interface completeness, edge case handling)

6) Go or No Go recommendation
- Recommendation:
- Conditions to ship:

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

Acts as a senior smart contract auditor. You provide contract code or diffs, and it produces an actionable audit report with categorized findings, an 8-point security checklist, and a go/no-go shipping recommendation.


Quick Start

Step 1: Download the Template

Click Download above to get the CLAUDE.md file.

Step 2: Provide Context

Fill in the template variables: project name, chain, scope, threat model, and risk tolerance.

Step 3: Run the Audit

claude

Say: "Audit this contract" and paste or reference your contract code.


What Gets Checked

Area Details
Access Control Role validation, modifier usage, unauthorized access vectors
Reentrancy CEI pattern, guards, external call safety
Arithmetic Overflow/underflow, precision loss, rounding
External Calls Return values, gas limits, untrusted contracts
Upgradability Upgrade mechanism, admin keys, timelocks
Oracles Price manipulation, stale data, fallbacks
MEV Frontrunning, slippage, ordering dependencies
ERC Compliance Standard adherence, interface completeness

Example Output

## Executive Risk Summary
- Overall risk: High
- Top 3 risks:
  - Unprotected admin function allows rug pull
  - Missing reentrancy guard on withdraw()
  - Oracle price can be manipulated via flash loan

## Findings
### Critical
- Title: Unprotected withdrawAll()
  - Impact: Admin can drain contract
  - Exploit scenario: Call withdrawAll() with owner key
  - Root cause: No timelock or multisig requirement
  - Fix: Add 48h timelock + multisig
  - Test to add: Verify timelock enforced on withdrawAll

## Go or No Go
- Recommendation: No Go
- Conditions to ship: Fix critical finding, add timelock

Tips

  • Scope matters: Narrow the scope to changed files for faster, more focused audits
  • Provide threat model: The more specific your threat model, the better the findings
  • Iterate: Run follow-up questions on specific findings for deeper analysis
  • Combine with tools: Feed in Slither or Mythril output for cross-validation

Commands

"Audit this contract for security issues"
"Focus on access control and reentrancy"
"What are the top 3 exploit scenarios?"
"Give me the go/no-go recommendation"
"Check ERC-20 compliance"

$Related Playbooks

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

Three.js Scroll World Builder

Build a scroll-controlled real-time Three.js experience as one persistent 3D world instead of stacked sections — a scene-ledger data model for authoring chapters, native-scroll-to-deterministic-state mapping with separate exact and smoothed progress, cinematic camera composition, a measurable per-device performance budget, and mandatory reduced-motion and WebGL-failure fallbacks.

20 minutes
Advanced
Developer Tools

Visual Explainer HTML Pages

Generate self-contained HTML explanations instead of walls of chat text or terminal ASCII — a design-judgment pass before any HTML is written (palette, type, layout concept, audited against genericness), Mermaid diagram invariants that force labeled mechanism over decoration, and a hard list of generic-default patterns to avoid (gradient heroes, violet accents, centered-everything layouts).

5 minutes
Intermediate
Developer Tools

Web Animation Design Principles

Design web animations that feel natural and purposeful — a decision-first easing blueprint (ease-out for entrances, ease-in-out for movement, ease for hover), duration and frequency rules, spring configuration, the GPU-only performance rule, and mandatory prefers-reduced-motion accessibility patterns with working CSS and Framer Motion code.

5 minutes
Intermediate
Developer Tools

Web Technique to Skill Extractor

Turn a one-off web visual or interaction technique into a reusable, well-scoped skill — the one-sentence mechanism test that separates a real technique from mere styling, a mechanism-vs-staging sort for what belongs in the skill versus the demo, rules anchored to named failures instead of adjectives, and a demo craft bar that treats the acceptance reference as a target, not inspiration.

10 minutes
Advanced
Developer Tools

Tool Interface Design for Agents

Design agent-facing tools as contracts an agent must infer entirely from the description alone — the consolidation principle over narrow overlapping tools, architectural reduction toward primitives, actionable error-recovery messages, and an 8-point audit checklist.

10 minutes
Advanced
Developer Tools

Vercel Analytics & Speed Insights Setup

Wire up Vercel Analytics, Speed Insights, and SPA routing rewrites into a React/Vite project in one pass — including the routing fix most people miss.

5 minutes
Beginner
Developer Tools

Unslop UI Skill for Claude: Kill the AI Design Tells

A frontend guardrail built from a 3.2M-post Reddit analysis of what people actually call AI slop, with a build mode that forces design decisions up front and an audit mode that scans existing code for the tells

10 minutes
Intermediate
Developer Tools

Tunnel Doctor

Diagnose and fix conflicts between Tailscale and proxy/VPN tools on macOS — route hijacking, proxy env vars, SSH double-tunneling, and the ~60s DNS resolver stall.

15 minutes
Advanced
Developer Tools

Windows RDP Connection Doctor

Diagnose Windows App / AVD / W365 remote-desktop connection quality on macOS — transport selection (UDP Shortpath vs WebSocket), VPN/proxy interference with STUN/TURN, and Shortpath failures from the logs.

15 minutes
Intermediate
Developer Tools

Vibe Coder: Idea to Prototype

Describe what you want to build and get clean, working code with a simple approach explanation, setup instructions, and optional improvements — optimized for shipping over perfecting.

5 minutes
Beginner

Browse all Developer Tools playbooks →