Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

AI Agents

The Solidity language server works with AI coding agents. Each agent integrates differently — some connect directly to the LSP, others rely on configuration files and tool access.

Comparison

AgentLSP IntegrationConfig FileDiagnosticsCode Intelligence
OpenCodeDirect (built-in)opencode.jsonAutomatic via LSPHover, definition, references, symbols, call hierarchy
Claude CodeNoneCLAUDE.mdVia forge build / shellFile read/write/edit, bash, MCP servers
CodexNoneAGENTS.mdVia forge build / shellTerminal commands, test harnesses

How it works

With LSP (OpenCode)

OpenCode connects directly to solidity-language-server over stdio. The AI agent receives real-time diagnostics, can query hover info for type signatures and NatSpec docs, jump to definitions, find references, and trace call hierarchies — all through standard LSP methods.

Without LSP (Claude Code, Codex)

Claude Code and Codex don't have built-in LSP support. Instead, they rely on:

  • Instruction files (CLAUDE.md / AGENTS.md) that tell the AI how to work with your Solidity project
  • Shell commands (forge build, forge test) to get compiler diagnostics
  • File tools to read and edit source code directly

The instruction files should describe your project structure, how to build and test, and any conventions the AI should follow.