Building on Solana with AI: practical guides

Short answer

To build Solana programs with AI reliably, make a test decide when the work is done, run it on a local chain, give the model Solana references and your real toolchain versions, decode errors from the program’s own tables, and keep funded keys away from anything the agent can run. These guides show each step with standard Solana tools first, then with Oh My Sol.

Who it’s for
Solana developers using Claude Code, Codex, Cursor or Oh My Sol who want AI-written programs that build, pass tests and do not touch their keys.
Last checked
, against Oh My Sol 0.1.0

Which AI coding tool should I use for Solana?

OMS beats both Codex CLI and Claude Code on Solana Bench and on fresh Solana tasks. The comparison pages show the numbers and set out how OMS differs from Claude Code, Codex CLI and other Solana AI tools.

Frequently asked questions

Can AI write Solana programs?

Yes. Models write Anchor and native Rust programs well when the setup around them is right: Solana references and your real toolchain versions to work from, decoded errors, a local chain to run the program on, and a test that decides when the work is done.

What is the most important rule when using an AI agent on Solana?

Let a test, not the model, decide when the work is done, and run it on a local chain. The second rule is to keep funded keys away from anything the agent can run.

Do these guides only work with Oh My Sol?

No. Each guide first shows how to do the job with standard Solana tools (Anchor, the Solana CLI, Surfpool, LiteSVM, Mollusk) and any coding agent, then shows how Oh My Sol does it.

What is Oh My Sol?

Oh My Sol (OMS) is a terminal harness from Barestate for building, testing and debugging Solana programs with the model you already use, such as Codex or Claude Code. It gives the model Solana references, error decoding and toolchain checks, runs your program on a local Surfpool chain, works in a Git worktree per task, and closes a task only when your requirements pass.

Which AI coding tool is best for Solana?

For writing and testing Solana programs, OMS beats both Codex CLI and Claude Code. On Solana Bench it averaged 377 in the basic environment against 273 for Codex CLI on GPT-6.1 Sol, and 303 against 252 for Claude Code on Claude Opus 5.5, and on fresh Solana tasks it passed 96% of runs against 76% for Codex CLI with GPT-6.1 Sol. The comparison pages cover the other tools.

Try it on your own program

Oh My Sol 0.1.0 runs on macOS and Linux, and on Windows through WSL 2. You need Node 22.19.0 or newer and Git. You bring your own model access: an API key, a ChatGPT subscription or a Claude subscription.

npx @barestate/oms doctor --install
npx @barestate/oms