An autonomous smart contract security audit agent for Claude Code. Orchestrates 15β95 specialized AI agents across 8 phases to produce comprehensive security audit reports β from reconnaissance to verified PoC exploits.
Supports EVM/Solidity, Solana/Anchor, Aptos Move, and Sui Move via a tree architecture with shared rules and language-specific analysis branches.
Built for Claude Opus 4.6 (1M context). Works on Max (Core/Thorough) and Pro (Light mode) subscriptions.
Shell: All commands use Unix syntax. On Windows, use Git Bash (included with Git for Windows). On macOS/Linux, use your regular terminal. If
pip/pythondon't work, trypip3/python3instead.
Why
~/.claude? Claude Code reads its configuration, slash commands, agent definitions, and MCP server settings from~/.claude/. This is not configurable β the repo must be cloned to this exact location for/plamenand all pipeline features to work.
Existing Claude Code users:
~/.claudewill be overwritten. Back up your existing config first:mv ~/.claude ~/.claude.backup
# 1. Clone into ~/.claude (required β Claude Code reads config from this path)
git clone https://github.com/PlamenTSV/plamen.git ~/.claude
cd ~/.claude
# 2. Initialize submodules (slither-mcp, farofino-mcp)
git submodule update --init --recursive
# 3. Install Python deps
pip install -r requirements.txt
# 4. Install MCP server deps (~2GB download β includes PyTorch for embeddings)
pip install -r custom-mcp/unified-vuln-db/requirements.txt
pip install -r custom-mcp/solodit-scraper/requirements.txt
pip install -r custom-mcp/defihacklabs-rag/requirements.txt
pip install -e custom-mcp/solana-fender
pip install -r custom-mcp/farofino-mcp/requirements.txt
# 4b. EVM users only β install slither MCP (requires Python 3.11+, solc)
pip install -e custom-mcp/slither-mcp # skip if not auditing Solidity
# 5. Configure MCP servers + API keys (BEFORE building RAG)
cp mcp.json.example mcp.json
cp settings.json.example settings.json
# Edit mcp.json β add your API keys (see Configuration below)
# At minimum, get a free Solodit key: https://solodit.cyfrin.io
# Then set it for the current shell:
export SOLODIT_API_KEY=your_key_here # needed for step 6
# 6. Build the RAG vulnerability database (~5 min, requires internet)
# Without SOLODIT_API_KEY: only ~700 entries indexed (vs ~4000 with it)
cd custom-mcp/unified-vuln-db
python -m unified_vuln.indexer index -s solodit --max-pages 10
python -m unified_vuln.indexer index -s defihacklabs
python -m unified_vuln.indexer index -s immunefi
cd ../..
# 7. Run (terminal wrapper with interactive UI)
python plamen.py
# Or from Claude Code: /plamen
# Or add ~/.claude to PATH and just type: plamenYou'll need a smart contract project to audit (e.g., a Foundry or Hardhat project). The Setup menu inside the wrapper can install chain-specific tools (Foundry, Solana, Aptos, Sui) for you.
Having trouble? Open Claude Code and paste the contents of
SETUP.mdβ it contains step-by-step instructions that Claude Code can follow to install everything for you automatically.
- Architecture
- Audit Modes
- How It Works
- Language Support
- Skill System
- Security Rules
- MCP Servers
- Prerequisites
- Installation
- Configuration
- Building the RAG Database
- Two Ways to Run
- Repository Structure
- Severity Matrix
- Cost Estimation
- Contributing
- License
βββββββββββββββββββββββββββββββββββ
β ORCHESTRATOR (CLAUDE.md) β
β Detects language, reads phase β
β prompts, spawns agents, β
β enforces gates β
ββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Phase 1 β β Phase 2 β β Phase 3 β
β RECON βββββββββΊ β INSTANTIATE βββββββββΊ β BREADTH β
β (4 agents) β β (orchestr.) β β (2-7 agents)β
ββββββββββββββββ ββββββββββββββββ ββββββββ¬ββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Phase 3b β β Phase 3c β β Phase 4a β
β RE-SCAN ββββΊ β PER-CONTRACTββββΊ β INVENTORY β
β (sonnet, β β (sonnet, β β + Side Effect β
β 2 iters) β β 1/cluster) β β Trace Audit β
ββββββββββββββββ ββββββββββββββββ ββββββββ¬βββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββ βββββββββββββββββββ ββββββββββββββββ
β Phase 4a.5 β β Phase 4b β β Phase 4c β
β SEMANTIC ββββΊ β DEPTH LOOP ββββΊ β CHAIN β
β INVARIANTS β β (8+ agents Γ β β ANALYSIS β
β (sonnet) β β 1-3 iters) β β + Enablers β
ββββββββββββββββ β + Niche agents β ββββββββ¬ββββββββ
β + Inv. Fuzz β β
β + Medusa Fuzz β β
β + Design Stressβ β
βββββββββββββββββββ β
β
ββββββββββββββββββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ
β Phase 5 β β Phase 5.1 β β Phase 6 β
β VERIFY ββββΊ β SKEPTIC- ββββΊ β REPORT β
β (N verifier β β JUDGE β β Index β 3 Tier β
β agents) β β (Thorough) β β Writers β β
ββββββββββββββββ ββββββββββββββββ β Assembler β
ββββββββββββββββββββ
β
βΌ
AUDIT_REPORT.md
The workflow is fully autonomous β provide a smart contract project and optionally documentation. The orchestrator detects the language, loads the appropriate branch, and handles everything from pattern detection to PoC verification to final report assembly.
| Dimension | Light | Core | Thorough |
|---|---|---|---|
| Target plan | Pro | Max | Max |
| Agent models | All Sonnet/Haiku | Opus + Sonnet | Opus + Sonnet |
| Recon | 2 sonnet (no RAG) | 4 agents | 4 agents (full RAG) |
| Breadth | 2-3 sonnet | 2-7 opus | 2-7 opus |
| Re-scan (3b/3c) | Skip | Skip | Full (2 iter + per-contract) |
| Depth loop | 4 merged sonnet, iter 1 | 8+ agents, iter 1 | Iter 1-3 (Devil's Advocate) |
| Niche agents | Skip | Flag-triggered | Flag-triggered |
| Semantic invariants | Skip (state consistency tradeoff) | Pass 1 | Pass 1 + Pass 2 |
| Confidence scoring | None (verdicts only) | 2-axis | 4-axis |
| RAG Sweep | Skip | 1 haiku | 1 haiku |
| Invariant / Medusa fuzz | Skip | Skip | Yes (EVM) |
| Chain analysis | 1 sonnet (merged) | 2 agents | 2 agents + iteration 2 |
| Verification (PoC) | Medium+ (sonnet) | Medium+ | ALL severities + fuzz |
| Skeptic-Judge | Skip | Skip | HIGH/CRIT |
| Report | 2 agents | 5 agents | 5 agents |
| Agent count | ~15-18 | ~25-45 | ~35-95 |
Proven-only mode (--proven-only): Available in all modes. Caps findings with only [CODE-TRACE] evidence (no executed PoC or fuzzer counterexample) at Low severity. Useful for benchmark comparisons where only mechanically proven findings should drive severity.
Split into 4 agents to prevent timeout:
- Agent 1A (sonnet): RAG queries β unified-vuln-db, Solodit live search
- Agent 1B (opus): Documentation parsing, fork ancestry research, trust model extraction
- Agent 2 (sonnet): Build environment, static analysis (Slither β Farofino/Aderyn β grep fallback), test suite
- Agent 3 (opus): Pattern detection, attack surface mapping, template recommendations with BINDING MANIFEST
Produces 17+ scratchpad artifacts consumed by all downstream phases.
Reads the BINDING MANIFEST, resolves skill templates, applies merge hierarchy (max 3 skills/agent), and composes agent prompts with instantiated parameters.
All agents spawned in a single message. Each runs a targeted sweep per vulnerability class across its scope, producing findings with precondition/postcondition analysis.
- Re-scan: 2-3 sonnet agents re-analyze with an exclusion list of known findings. Counters LLM attention saturation.
- Per-contract: 1 agent per contract/cluster at maximum depth. Zero distraction from other contracts.
Consolidates all findings, promotes static analysis results, performs side effect trace audit on external token interactions.
Sonnet agent enumerates write sites, defines semantic invariants, detects mirror variables, flags conditional writes and accumulation exposures. Pass 2 (Thorough) traces consequences recursively.
Iteration 1 (always): 4 depth agents + 3 blind spot scanners + validation sweep + niche agents, all in parallel.
| Depth Agent | Model | Focus |
|---|---|---|
| depth-token-flow | opus | Balance invariants, mint/burn, transfer side effects |
| depth-state-trace | opus | Cross-function state mutation, constraint enforcement |
| depth-edge-case | sonnet | Boundary values, zero state, overflow, first-user |
| depth-external | sonnet | External call effects, oracle integrity, cross-chain timing |
| Scanner | Focus |
|---|---|
| Blind Spot A | External token coverage, parameter governance, msg.value loops, returnbomb |
| Blind Spot B | Guards, visibility, inheritance, override safety |
| Blind Spot C | Role lifecycle, capability exposure, reachability |
| Validation Sweep | Write completeness, struct validation, sibling propagation |
Niche agents (flag-triggered, 1 budget slot each):
- EVENT_COMPLETENESS β event emission coverage
- SEMANTIC_GAP_INVESTIGATOR β sync gaps, accumulation exposure, conditional writes
- SPEC_COMPLIANCE_AUDIT β spec-to-code compliance
- SIGNATURE_VERIFICATION_AUDIT β replay, malleability, EIP-712, nonces
- SEMANTIC_CONSISTENCY_AUDIT β cross-contract unit mismatches, formula drift, magic numbers
Invariant fuzzing (EVM Thorough only):
- Foundry invariant fuzz campaign (from semantic invariants)
- Medusa stateful fuzz campaign (parallel, standalone harness, 15-min timeout)
Iterations 2-3 (Thorough): Devil's Advocate agents re-examine uncertain findings with structural adversarial role, contrastive path summaries, fresh MCP calls.
Confidence scoring (haiku, batched): 4-axis model (Evidence Γ 0.25 + Consensus Γ 0.25 + Analysis Quality Γ 0.3 + RAG Match Γ 0.2). Routes findings to CONFIDENT/UNCERTAIN/LOW_CONFIDENCE with severity-weighted spawn priority.
- Agent 1: Exhaustive enabler enumeration (5 actor categories per dangerous state), finding grouping with anti-absorption rules
- Agent 2: Postconditionβprecondition chain matching, composition coverage map, RAG validation for chains
Mandatory PoC execution. Every finding gets:
- Written PoC from language-specific templates
- Compiled and executed (max 5 retry attempts with structured recovery)
- Fuzz variant (Medium+, Thorough mode)
- Evidence tagged:
[POC-PASS],[POC-FAIL],[CODE-TRACE],[MEDUSA-PASS]
Pre-PoC feasibility gates (Reachability + Math Bounds) prevent wasted verification effort.
After standard verification:
- Skeptic (sonnet): INVERSION MANDATE β if standard said CONFIRMED, skeptic tries to REFUTE, and vice versa
- If skeptic AGREES β high confidence (dual-confirmed)
- If skeptic DISAGREES β Judge (haiku): "prove it or lose it" β stronger mechanical evidence wins
- Index Agent (haiku): Clean ID assignment, root-cause consolidation, tier assignment, strict mode demotion
- 3 Tier Writers (parallel): Opus for Critical+High, Sonnet for Medium, Sonnet for Low+Info
- Assembler (haiku/sonnet): Merges sections, quality checks, writes
AUDIT_REPORT.md
Tree architecture β shared root with language-specific branches. No file contains content for more than one language.
| Language | Skills | Build | Static Analysis | Fuzz | On-chain |
|---|---|---|---|---|---|
| EVM/Solidity | 18 | Foundry, Hardhat | Slither MCP, Farofino/Aderyn, grep | Foundry invariant, Medusa | etherscan, fork testing |
| Solana/Anchor | 19 | Anchor, cargo-build-sbf | Fender MCP, grep | Trident, proptest | Helius |
| Aptos Move | 21 | aptos move compile | Move Prover, grep | Boundary-value parameterized | β |
| Sui Move | 21 | sui move build | grep | Boundary-value parameterized | β |
Language detection is automatic (Step 0) based on config files and source file patterns.
Skills are methodology files loaded into agents at instantiation time. Three tiers:
Always-available skills triggered by pattern flags from recon. Examples: ORACLE_ANALYSIS, SEMI_TRUSTED_ROLES, TOKEN_FLOW_TRACING, FLASH_LOAN_INTERACTION.
Loaded only when recon classifies the protocol as a matching type. Appended to existing agents (no new agent spawned):
| Skill | Trigger |
|---|---|
| VAULT_ACCOUNTING | vault protocol type |
| ACCOUNT_ABSTRACTION_SECURITY | ERC-4337, EntryPoint, UserOperation |
| NFT_PROTOCOL_SECURITY | ERC721/1155 with marketplace/staking/collateral |
| GOVERNANCE_ATTACK_VECTORS | Governor, Timelock, voting, proposal |
| OUTCOME_DETERMINISM | Finite-pool selection with depletion fallback + time-gated actions |
Spawn as independent agents (1 depth budget slot each). Used when a concern needs dedicated focus:
| Agent | Trigger | Checks |
|---|---|---|
| EVENT_COMPLETENESS | MISSING_EVENT |
Event coverage, parameter accuracy, cross-contract gaps |
| SEMANTIC_GAP_INVESTIGATOR | Semantic invariant flags | SYNC_GAP, ACCUMULATION_EXPOSURE, CONDITIONAL, CLUSTER_GAP |
| SPEC_COMPLIANCE_AUDIT | HAS_DOCS |
Spec-to-code compliance, testable claim verification |
| SIGNATURE_VERIFICATION_AUDIT | HAS_SIGNATURES |
Replay, malleability, EIP-712, permit, nonces |
| SEMANTIC_CONSISTENCY_AUDIT | HAS_MULTI_CONTRACT |
Unit mismatches, formula drift, magic number consistency |
16 rules (R1βR16) enforced across all agents:
| Rule | Name | Summary |
|---|---|---|
| R1 | External Return Types | Verify all external call return values |
| R2 | Keeper/Admin Griefability | Check both directions of privileged action abuse |
| R3 | Transfer Side Effects | Document token type and side effects |
| R4 | Adversarial Assumption | CONTESTED/unknown β assume adversarial |
| R5 | Combinatorial Impact | N-entity systems need combinatorial analysis |
| R6 | Bidirectional Role | Semi-trusted roles analyzed in both directions |
| R7 | Donation-based DoS | Check thresholds vulnerable to donations |
| R8 | Cached Parameters | Multi-step ops with stale external state |
| R9 | Stranded Assets | Check recovery paths for locked funds |
| R10 | Worst-State Severity | Use worst realistic state, not current snapshot |
| R11 | Unsolicited Token Transfer | Trace impact of uninitiated transfers |
| R12 | Exhaustive Enabler Enum | 5 actor categories per dangerous state |
| R13 | Anti-Normalization | "By design" is not a valid severity dismissal |
| R14 | Cross-Variable Invariant | Aggregate variables, constraint coherence, setter regression |
| R15 | Flash Loan Precondition | Flash-loan-accessible state manipulation |
| R16 | Oracle Integrity | Staleness, decimals, zero, failure modes |
Plamen uses 9 MCP servers configured in mcp.json. 2 are bundled in custom-mcp/, 2 are git submodules, 5 are npm packages. Two additional bundled libraries (solodit-scraper, defihacklabs-rag) serve as data sources for the RAG database.
| Server | Purpose | Required? |
|---|---|---|
| unified-vuln-db | RAG vulnerability database β Solodit, DeFiHackLabs, Immunefi. Semantic search, hypothesis validation, root cause analysis | Required |
| solodit-scraper | Solodit API scraper with SQLite cache, rate limiting | Required by unified-vuln-db |
| defihacklabs-rag | DeFiHackLabs exploit analysis with ChromaDB embeddings | Optional (enriches RAG) |
| solana-fender | Solana program static security analysis | Optional (Solana only) |
| Server | Purpose | Required? |
|---|---|---|
| slither-mcp | Slither static analyzer by Trail of Bits | Optional (EVM, falls back to grep) |
| farofino-mcp | Aderyn + pattern analysis fallback | Optional (EVM, when Slither fails) |
| Server | Purpose | API Key? |
|---|---|---|
| foundry-suite | Anvil fork testing, Forge scripts, Heimdall bytecode | No |
| evm-chain-data | On-chain ABI/state queries via Etherscan | Optional (free key) |
| tavily-search | Web search for fork ancestry + documentation | Optional (free key) |
| helius | Solana on-chain account/transaction data | Optional (free key) |
| memory | Persistent memory across sessions | No |
| Tool | Purpose | Install |
|---|---|---|
| Claude Code CLI | The AI runtime | docs.anthropic.com |
| Python 3.11+ | MCP servers, plamen.py wrapper | python.org |
| Node.js 18+ / npx | npm MCP servers (foundry-suite, tavily, etc.) | nodejs.org |
| Git | Dependency resolution, submodules | git-scm.com |
EVM/Solidity:
| Tool | Purpose | Install |
|---|---|---|
| Foundry (forge, anvil, cast) | Build, test, fork testing | curl -L https://foundry.paradigm.xyz | bash && foundryup |
| Slither | Static analysis | pip install slither-analyzer |
| Medusa | Stateful fuzzing (Thorough mode) | github.com/crytic/medusa |
Solana:
| Tool | Purpose | Install |
|---|---|---|
| Solana CLI | Toolchain, account dumps | docs.anza.xyz |
| Anchor | Build Anchor programs | avm install latest && avm use latest |
| Trident | Stateful fuzzing | cargo install trident-cli |
Aptos Move:
| Tool | Purpose | Install |
|---|---|---|
| Aptos CLI | Build, test, prove | aptos.dev/build/cli |
Sui Move:
| Tool | Purpose | Install |
|---|---|---|
| Sui CLI | Build, test | docs.sui.io |
git clone https://github.com/PlamenTSV/plamen.git ~/.claude
cd ~/.claude
git submodule update --init --recursiveNote: This clones into
~/.claudewhich is where Claude Code looks for its configuration. If you already have a~/.claudedirectory, back it up first.
# Plamen wrapper
pip install -r requirements.txt
# MCP servers (~2GB download β includes PyTorch for embeddings)
pip install -r custom-mcp/unified-vuln-db/requirements.txt
pip install -r custom-mcp/solodit-scraper/requirements.txt
pip install -r custom-mcp/defihacklabs-rag/requirements.txt
pip install -e custom-mcp/solana-fender
pip install -r custom-mcp/farofino-mcp/requirements.txt
# EVM users only (requires Python 3.11+, solc)
pip install -e custom-mcp/slither-mcpcp mcp.json.example mcp.json
cp settings.json.example settings.jsonEdit mcp.json with your API keys. See Configuration. At minimum, get a free Solodit API key β it's needed to index the largest RAG data source (3400+ findings).
The default settings.json.example auto-approves all tool calls required for autonomous auditing. Critical permissions β removing any of these will break the pipeline:
| Permission | Why Required |
|---|---|
Agent(*) |
Spawns all subagents (depth, scanner, verifier, chain analysis). Without this, the pipeline silently fails. |
Bash(*) |
Runs forge build/test, cargo test, aptos move test, etc. |
Read(*), Write(*), Edit(*) |
Reads source code, writes PoC tests, edits scratchpad artifacts |
mcp__* |
All MCP server tool calls (Slither, RAG, Solodit, Foundry, etc.) |
The deny list blocks destructive operations (rm -rf, sudo, force push). Review and adjust if desired.
The env block sets MCP timeouts: MCP_TIMEOUT (30s connection) and MCP_TOOL_TIMEOUT (300s = 5 min execution). The 5-minute tool timeout accounts for ChromaDB cold start on first use β the RAG database and embedding model load into memory on the first MCP call per session, which can take 1-5 minutes. After warm-up, calls return in seconds.
Set your Solodit key first, then build:
export SOLODIT_API_KEY=your_key_hereSee Building the RAG Database for full instructions.
python plamen.pyThe startup screen runs a dependency check showing which tools are available.
Copy mcp.json.example to mcp.json and configure:
The example below shows a subset. Copy mcp.json.example for the full 9-server configuration including solana-fender, farofino, and memory.
{
"mcpServers": {
"slither-analyzer": {
"command": "slither-mcp",
"args": []
},
"unified-vuln-db": {
"command": "python",
"args": ["-m", "unified_vuln.server"],
"cwd": "./custom-mcp/unified-vuln-db"
},
"foundry-suite": {
"command": "npx",
"args": ["-y", "@pranesh.asp/foundry-mcp-server"],
"env": { "RPC_URL": "YOUR_RPC_URL" }
},
"evm-chain-data": {
"command": "npx",
"args": ["-y", "@mcpdotdirect/evm-mcp-server"],
"env": { "ETHERSCAN_API_KEY": "YOUR_KEY" }
},
"tavily-search": {
"command": "npx",
"args": ["-y", "tavily-mcp"],
"env": { "TAVILY_API_KEY": "YOUR_KEY" }
},
"helius": {
"command": "npx",
"args": ["-y", "helius-mcp@latest"],
"env": { "HELIUS_API_KEY": "YOUR_KEY" }
}
}
}Path notes: The cwd fields use relative paths (./custom-mcp/...). Claude Code resolves these relative to ~/.claude/. If you installed elsewhere, use absolute paths.
| Key | Where to Get | Cost | Used For |
|---|---|---|---|
| Solodit | solodit.cyfrin.io | Free | RAG database indexing (3400+ findings) + live search |
| Etherscan | etherscan.io/apis | Free | Contract ABI verification |
| Tavily | tavily.com | Free tier | Fork ancestry web search, RAG fallback |
| Helius | helius.dev | Free tier | Solana on-chain data |
| RPC URL | Alchemy, Infura, or public | Free/Paid | Fork testing |
All keys are optional. The pipeline degrades gracefully β missing keys mean reduced coverage, not failure. You can leave YOUR_* placeholders in mcp.json and the pipeline will skip those services.
Recommended: Get the free Solodit API key β it provides 3400+ indexed findings vs ~700 without it. The Tavily key is also recommended as the WebSearch fallback when RAG MCP tools are slow on first use.
The unified-vuln-db MCP server uses a ChromaDB vector database populated from three sources. Build it before your first audit.
cd custom-mcp/unified-vuln-db
# Index from all sources
python -m unified_vuln.indexer index -s solodit --max-pages 10
python -m unified_vuln.indexer index -s defihacklabs
python -m unified_vuln.indexer index -s immunefi
# Verify
python -m unified_vuln.indexer stats# Index ALL Solodit findings (thousands of pages)
python -m unified_vuln.indexer index -s solodit --max-pages 100
# Clone DeFiHackLabs dataset for deeper coverage
git clone https://github.com/SunWeb3Sec/DeFiHackLabs.git data/DeFiHackLabs
python -m unified_vuln.indexer index -s defihacklabs
# Immunefi
python -m unified_vuln.indexer index -s immunefipython -m unified_vuln.indexer clear
# Then run the index commands aboveThe data/ directory (ChromaDB, caches) is gitignored. Each user builds their own database.
The first MCP tool call in each Claude Code session loads the ChromaDB database and sentence-transformers embedding model into memory. This can take 1-5 minutes depending on your hardware. Subsequent calls are instant. The pipeline handles this automatically β the recon agent's probe-first pattern detects slow MCP responses and falls back to WebSearch (Tavily) or code-level analysis.
Plamen can be launched from its dedicated terminal wrapper or from inside Claude Code. Both go through the same audit pipeline β the difference is how you start it.
The terminal wrapper is a standalone Rich + InquirerPy application that handles dependency checking, tool installation, cost estimation, and launches Claude Code for you.
plamenThis opens an interactive UI with arrow-key menus:
βββββββ βββ ββββββ ββββ ββββββββββββββββ βββ
βββββββββββ βββββββββββββ ββββββββββββββββββ βββ
βββββββββββ βββββββββββββββββββββββββ ββββββ βββ
βββββββ βββ βββββββββββββββββββββββββ ββββββββββ
βββ βββββββββββ ββββββ βββ ββββββββββββββ ββββββ
βββ βββββββββββ ββββββ ββββββββββββββ βββββ
⬑ Web3 Security Auditor v1.0.0
> Select audit mode:
Light 15-18 agents | Pro plan | best under 3k LOC
Core 25-45 agents | Max plan | ALL severities
Thorough 35-95 agents | Max plan | ALL severities + fuzz
ββββββββββ
Compare variable | DELTA report
Setup install tools + build RAG DB
The Setup option shows your full toolchain status and lets you install missing tools (Foundry, Solana, Aptos, Sui, Medusa, etc.) and build the RAG database β all from the same UI, with automatic prerequisite detection and cross-platform support (Windows, macOS, Linux).
After selecting a mode, the wrapper walks you through target selection, documentation, scope, proven-only mode, shows a cost estimate, then hands off to Claude Code.
To make plamen available as a command, add ~/.claude to your PATH:
# Unix/macOS β add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/.claude:$PATH"
# Windows β run once in PowerShell
[System.Environment]::SetEnvironmentVariable("Path", "$env:USERPROFILE\.claude;" + $env:Path, "User")Or run directly without PATH setup:
python ~/.claude/plamen.py # any platform
./plamen.sh # Unix/macOS
plamen.bat # WindowsCLI fast path (skip the wizard):
plamen core /path/to/project --docs whitepaper.pdf
plamen thorough /path/to/project --scope scope.txt --network ethereum --proven-only
plamen setup # just run the installerIf you're already in a Claude Code session, type /plamen to launch the audit wizard directly:
> /plamen
This presents a mode selection dialog with previews inside Claude Code, then walks you through target, docs, scope, and launches the full pipeline β all within the same session.
You can also skip the wizard with arguments:
> /plamen core /path/to/project docs: /path/to/docs
> /plamen thorough /path/to/project scope: scope.txt proven-only: true
> /plamen compare report: audit.md ground_truth: reference.md
Terminal Wrapper (plamen) |
Claude Code (/plamen) |
|
|---|---|---|
| First time | Use this β Setup installs tools + builds RAG | Need tools already installed |
| Cost estimate | Shows token/cost estimate before launch | No estimate |
| Dependency check | Full toolchain box with install option | Basic toolchain probe |
| Daily use | Quick CLI: plamen core . |
Quick command: /plamen core . |
| Already in Claude | Opens new Claude session | Uses current session |
~/.claude/
βββ CLAUDE.md # Orchestrator β mode table, critical rules, file refs
βββ plamen.py # Terminal wrapper (Rich + InquirerPy)
βββ plamen.sh / plamen.bat # Launcher scripts
βββ VERSION # Semantic version
β
βββ commands/
β βββ plamen.md # /plamen slash command β wizard + full workflow
β
βββ rules/ # Shared rules (all languages)
β βββ finding-output-format.md # Finding template, Rules Applied, Depth Evidence Tags
β βββ phase3b-rescan-prompt.md # Breadth re-scan (Thorough)
β βββ phase4-confidence-scoring.md # 4-axis scoring, anti-dilution, convergence
β βββ phase4c-chain-prompt.md # Chain analysis β enabler enum + chain matching
β βββ phase5-poc-execution.md # Mandatory PoC execution protocol
β βββ phase6-report-prompts.md # Report pipeline β Index β Tier Writers β Assembler
β βββ report-template.md # Report format, severity matrix, consolidation
β βββ skill-index.md # Master skill registry (all trees)
β βββ post-audit-improvement-protocol.md # Compare mode methodology
β
βββ agents/ # Agent definitions (language-agnostic)
β βββ depth-token-flow.md
β βββ depth-state-trace.md
β βββ depth-edge-case.md
β βββ depth-external.md
β βββ security-analyzer.md
β βββ security-verifier.md
β
βββ prompts/ # Language-specific prompts
β βββ evm/ # 10 files (includes invariant-fuzz)
β βββ solana/ # 9 files
β βββ aptos/ # 9 files
β βββ sui/ # 9 files
β # Each tree contains:
β # phase1-recon-prompt.md β 4-agent recon with BINDING MANIFEST
β # phase4a-inventory-prompt.md β inventory + side effect trace
β # phase4b-loop.md β adaptive depth loop orchestration
β # phase4b-depth-templates.md β 4 depth agent prompts
β # phase4b-scanner-templates.md β 3 scanners + validation sweep + design stress
β # phase5-verification-prompt.md β verifier + skeptic-judge (EVM)
β # generic-security-rules.md β R1-R16 enforcement
β # self-check-checklists.md β per-phase quality gates
β # mcp-tools-reference.md β MCP tool usage guide
β
βββ agents/skills/
β βββ evm/ # 18 EVM skill templates
β βββ solana/ # 19 Solana skill templates
β βββ aptos/ # 21 Aptos skill templates
β βββ sui/ # 21 Sui skill templates
β βββ injectable/ # 5 protocol-type-specific skills
β βββ niche/ # 5 flag-triggered niche agents
β
βββ custom-mcp/ # MCP servers
β βββ unified-vuln-db/ # RAG vulnerability database (code only, data/ gitignored)
β β βββ unified_vuln/
β β β βββ server.py # MCP server entry point
β β β βββ indexer.py # CLI: index, clear, stats
β β β βββ database.py # ChromaDB interface
β β β βββ schema.py # Vulnerability data model
β β β βββ chunking.py # Document chunking
β β β βββ sources/ # Data source adapters
β β β βββ solodit.py # Solodit API + content parser
β β β βββ defihacklabs.py # DeFiHackLabs exploit corpus
β β β βββ immunefi.py # Immunefi bug bounty data
β β β βββ huggingface.py # Disabled (diluted results)
β β βββ requirements.txt
β β βββ setup.py
β βββ solodit-scraper/ # Solodit API scraper with SQLite cache
β β βββ solodit_mcp/
β β β βββ server.py
β β β βββ scraper.py
β β β βββ database.py
β β βββ requirements.txt
β βββ defihacklabs-rag/ # DeFiHackLabs ChromaDB embeddings
β β βββ defihacklabs_mcp/
β β β βββ server.py
β β β βββ indexer.py
β β βββ requirements.txt
β βββ solana-fender/ # Solana static analysis
β β βββ solana_fender_mcp/
β β β βββ __init__.py
β β β βββ __main__.py
β β βββ setup.py
β βββ farofino-mcp/ # [submodule] Aderyn + pattern analysis
β βββ slither-mcp/ # [submodule] Trail of Bits Slither
β
βββ mcp.json.example # MCP server config template
βββ settings.json.example # Permissions config template
βββ requirements.txt # Python deps (Rich, InquirerPy)
βββ .gitmodules # Submodule refs (farofino, slither)
βββ .gitignore
Impact Γ Likelihood:
| Likelihood: High | Likelihood: Medium | Likelihood: Low | |
|---|---|---|---|
| Impact: High (direct fund loss) | Critical | High | Medium |
| Impact: Medium (conditional fund loss) | High | Medium | Medium |
| Impact: Low (non-fund) | Medium | Low | Low |
| Impact: Info (quality, style) | Informational | Informational | Informational |
Downgrade modifiers: on-chain-only exploit (β1 tier), view-function-only (cap Medium), fully-trusted actor required (β1 tier, floor Info).
The plamen.py wrapper estimates token usage before launch, accounting for multi-turn context accumulation per agent. Estimates displayed in the launch summary:
- Input/Output tokens (millions)
- API cost (USD, at current Anthropic pricing)
- Weekly plan usage (% of Pro, Max x5, and Max x20 allowances)
Estimates are rough β actual usage varies with protocol complexity and finding count. Run /cost after an audit for actuals.
Findings carry evidence tags that determine confidence scoring:
| Tag | Weight | Meaning |
|---|---|---|
[PROD-ONCHAIN] |
1.0 | Verified against production on-chain state |
[PROD-SOURCE] |
0.9 | Verified against production source code |
[PROD-FORK] |
0.9 | Verified on Anvil fork of production |
[MEDUSA-PASS] |
1.0 | Medusa fuzzer found counterexample |
[POC-PASS] |
1.0 | PoC compiled, executed, assertions passed |
[POC-FAIL] |
β | PoC executed but assertions failed |
[CODE] |
0.8 | Code-level evidence with specific locations |
[CODE-TRACE] |
0.6 | Manual trace with concrete values, no execution (caps at CONTESTED) |
[DOC] |
0.4 | Documentation-based evidence |
[MOCK] |
0.2 | Mock-based (not production-representative) |
[EXT-UNV] |
0.1 | External/unverified claim |
See CONTRIBUTING.md. In short:
- Fork the repository
- Create a feature branch
- Follow the anti-bloat gates from
post-audit-improvement-protocol.md - Submit a PR with the template
- Trail of Bits β Slither MCP server
- Farofino β Aderyn integration
- SunWeb3Sec β DeFiHackLabs exploit corpus
- Solodit β Audit finding database
- Anthropic β Claude Code runtime