Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsMar 29, 2026·2 min de lectura

Claude Code Agent: Smart Contract Auditor — Web3 Security

Claude Code agent for auditing Solidity smart contracts. Reentrancy, overflow, access control, gas optimization, and best practices.

Listo para agents

Instalación con revisión previa

Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.

Needs Confirmation · 62/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Agent
Instalación
Single
Confianza
Confianza: Established
Entrada
Claude Code Agent: Smart Contract Auditor
Comando con revisión previa
npx -y tokrepo@latest install bdf1e117-e30b-40eb-8ebf-fb63d7eaee34 --target codex

Primero dry-run, confirma las escrituras y luego ejecuta este comando.

TL;DR
A Claude Code agent that audits Solidity smart contracts for reentrancy, overflow, access control, and gas optimization.
§01

What it is

Smart Contract Auditor is a specialized Claude Code agent for blockchain and Web3 security tasks. It conducts security assessments of Solidity smart contracts, detecting vulnerabilities like reentrancy attacks, integer overflow, access control issues, flash loan exploits, and MEV attack vectors. The agent uses a systematic approach combining automated scanning with manual inspection for business logic flaws.

This agent targets Solidity developers and security researchers who need automated vulnerability detection before deploying contracts to mainnet. It integrates with static analysis tools like Slither, Mythril, and Semgrep.

§02

How it saves time or tokens

Manual smart contract auditing requires deep expertise and hours of line-by-line review. This agent automates the first pass, identifying common vulnerability patterns and flagging suspicious code sections. The token estimate is approximately 500 tokens for the agent configuration.

The agent generates structured audit reports with severity classifications, so development teams can prioritize fixes by impact rather than reviewing findings in random order.

§03

How to use

  1. Install the agent from Claude Code Templates:
npx claude-code-templates@latest --agent blockchain-web3/smart-contract-auditor --yes
  1. The agent activates automatically when Claude Code detects Solidity files or blockchain-related tasks.
  1. Ask the agent to audit a contract:
Audit the Vault.sol contract for security vulnerabilities.
Focus on reentrancy, access control, and economic attack vectors.
§04

Example

The agent produces structured findings like this:

§05

Audit Report: Vault.sol

Critical

  • Reentrancy in withdraw(): External call before state update

on line 45. Move the balance update before the transfer.

High

  • Missing access control on setFee(): Any address can change

the protocol fee. Add onlyOwner modifier.

Medium

  • Unchecked return value: transferFrom on line 78 does not

check the boolean return. Use SafeERC20.safeTransferFrom.

Gas Optimization

  • Storage reads in loop: balances[msg.sender] read 3 times

in processRewards(). Cache in a local variable.


The agent can also generate proof-of-concept exploit code:

// Reentrancy exploit PoC

contract Exploit {

Vault public vault;

constructor(address _vault) {

vault = Vault(_vault);

}

function attack() external payable {

vault.deposit{value: msg.value}();

vault.withdraw();

}

receive() external payable {

if (address(vault).balance >= 1 ether) {

vault.withdraw();

}

}

}

§06

Related on TokRepo

§07

Common pitfalls

  • Automated auditing catches common patterns but misses business logic vulnerabilities. Always pair automated scanning with manual review of economic incentives and edge cases.
  • The agent works with Solidity contracts. Vyper, Cairo, and Move contracts require different tooling and analysis approaches.
  • Static analysis tools (Slither, Mythril) need to be installed separately. The agent integrates with them but does not install them. Run pip install slither-analyzer and pip install mythril before using those features.

Preguntas frecuentes

What vulnerability types does the agent detect?+

The agent checks for reentrancy, integer overflow/underflow, access control issues, flash loan attack vectors, MEV vulnerabilities, unchecked return values, and gas optimization opportunities. It follows OWASP guidelines adapted for smart contracts.

Does it work with any Solidity version?+

The agent analyzes Solidity contracts across versions. It understands both older patterns (SafeMath for pre-0.8) and newer built-in overflow checks. Specify the compiler version in your pragma for accurate analysis.

Can it generate proof-of-concept exploits?+

Yes. For critical and high severity findings, the agent can generate Solidity exploit contracts that demonstrate the vulnerability. These PoCs help developers understand the attack vector and verify their fixes.

Does it integrate with Slither and Mythril?+

Yes. The agent can run Slither for static analysis and Mythril for symbolic execution if they are installed in your environment. Results from these tools are incorporated into the audit report.

How do I install the agent?+

Run 'npx claude-code-templates@latest --agent blockchain-web3/smart-contract-auditor --yes' to install. The agent activates automatically in Claude Code when it detects Solidity files or blockchain security tasks.

Referencias (3)
  • Claude Code Templates— Claude Code Templates provide specialized agent configurations
  • Slither GitHub— Slither static analysis framework for Solidity
  • OWASP— OWASP Smart Contract Security guidelines
🙏

Fuente y agradecimientos

Created by Claude Code Templates by davila7. Licensed under MIT. Install: npx claude-code-templates@latest --agent blockchain-web3/smart-contract-auditor --yes

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados