build-program

build-program is a command for Claude Code from solanabr/solana-ai-kit. It costs 9 tokens per session (991 once invoked), scanned A, original, MIT.

A build checklist for Solana programs, which are applications running on the Solana blockchain, using Anchor or native Rust.

In plain words
What is it for?
Use it to build and inspect Anchor or native Rust Solana programs, including verifiable builds, program IDs, and generated IDLs.
Why use it?
It helps identify the program type, build the deployable file, check its size and identifier, and verify generated interface files where applicable.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/solanabr/solana-ai-kit/build-program
Clone the repo
git clone --depth 1 https://github.com/solanabr/solana-ai-kit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-program

README.md
[![agentmods](https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/build-program.svg)](https://agentmods.dev/commands/solanabr/solana-ai-kit/build-program)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/build-program"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/build-program.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 991 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.00991
Opus 5 $0.00005 $0.00495
Sonnet 5 $0.00002 $0.00198
Haiku 4.5 $0.00001 $0.00099

Measured 4d ago against content hash 5c2d2bcdd5a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

build-program scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/commands/build-program.md · 189 lines

How it starts

The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are building a Solana program. Follow these steps:

Step 1: Identify Program Type

Check which framework is being used:

# Check for Anchor
if [ -f "Anchor.toml" ]; then
    echo "Anchor program detected"
fi

# Check for Cargo
if [ -f "Cargo.toml" ]; then
    echo "Native Rust program detected"
fi

Step 2: Build Program

For Anchor Programs

# Clean build
anchor clean
anchor build

# Build specific program
anchor build -p program-name

# Build with verifiable build
anchor build --verifiable

# Check build output
ls -lh target/deploy/*.so

For Native Rust Programs

# Build BPF program
cargo build-sbf

# Build with specific BPF SDK
cargo build-sbf --bpf-sdk /path/to/bpf-sdk

# Check output
ls -lh target/deploy/*.so

Step 3: Verify Build

# Check program size (should be < 400KB ideally)
ls -lh target/deploy/*.so | awk '{print $5, $9}'

# Verify program ID
solana address -k target/deploy/program-keypair.json

# If Anchor, verify IDL generated
ls -lh target/idl/*.json

Step 4: Run Format and Lint

After successful build:

# Format code
cargo fmt

# Run clippy
cargo clippy -- -W clippy::all

# Check for warnings
cargo clippy --all-targets --all-features -- -D warnings

Common Build Issues

Compilation Errors

  • Check Rust version: rustc --version (need 1.79+)
  • Update dependencies: cargo update
  • Clean and rebuild: anchor clean && anchor build

Binary Size Too Large

# Check current size
ls -lh target/deploy/*.so

# Optimize in Cargo.toml:
# [profile.release]
# opt-level = "z"
# lto = "fat"
# codegen-units = 1

Missing Dependencies

# For Anchor
npm install

# For Rust
cargo fetch

BPF SDK Issues

# Update Solana CLI
agave-install update

# Reinstall BPF SDK
cargo build-sbf --force-tools-install

Read the full file on GitHub · 189 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 189 lines · 9 tokens per session scan A 5c2d2bcdd5a7

Subscribe to this mod's changes

build-program is a command published in the GitHub repository solanabr/solana-ai-kit (98 stars, last pushed 14d ago), licensed MIT. It adds 9 tokens to every session and 991 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other commands, from other repositories

dmaic-fit-improvement

Drive a Six Sigma DMAIC (Define / Measure / Analyze / Improve / Control) cycle for a clinic-wide socket-fit improvement programme — produces the project charter, measurement plan, analysis findings, improvement piloting, and control-phase lock-in.

DaxxSec/cognitropy-lab · 0 tokens

derive-access-deliverables

Define and batch-produce the public-facing deliverables derived from preservation masters — access copies, IIIF tile pyramids, OCR/transcription, and thumbnails — so the digitized collection is usable, not just safely stored.

DaxxSec/cognitropy-lab · 0 tokens

recap-module

Generate the four-audience recap that closes a module: a learner recap, a manager nudge, a facilitator log, and (when sponsor is Definitive) a sponsor highlight.

DaxxSec/cognitropy-lab · 0 tokens

map-evidence

Bind each learning objective to the assessment items that evidence it and define the evidence model — the slip and guess parameters that make Bayesian updating possible (ECD evidence model).

DaxxSec/cognitropy-lab · 0 tokens

responsive-design-specialist

Use when a layout breaks between sizes. Arbitrary breakpoints, type that does not scale, images that blow out the grid, or a desktop design retrofitted onto mobile.

imsaif/design-with-claude · 36 tokens

doctor

DeepInit preflight — tools, scope, resolved config (and whether it's valid), enabled issue families, estimated cost. 0 tokens, no LLM. Offers to install the freshness hooks.

deepfusionlabs/deep-init · 39 tokens