New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@blockrun/runcode

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockrun/runcode

RunCode — AI coding agent powered by 55+ models. Pay per use with USDC.

latest
Source
npmnpm
Version
2.8.0
Version published
Maintainers
1
Created
Source

RunCode

Open-source AI coding agent. 55+ models. Pay per use with USDC.


npm version License: Apache-2.0 TypeScript x402 Telegram

Why RunCode?

Claude CodeCursorAiderRunCode
ModelsClaude onlyMixed (limited)Bring your key55+ models, one tool
Pricing$200/mo subscription$20/mo + usageFree + API costsPay per request
PaymentCredit cardCredit cardAPI keysUSDC — no accounts
Open sourceNoNoYesYes
Switch models mid-sessionNoNoYesYes

RunCode gives you the same agent capabilities — file editing, shell commands, web search, sub-agents — across every major model provider. You pay only for what you use, with stablecoin. No API keys to manage, no accounts to create, no subscriptions to cancel.

Quick Start

npm install -g @blockrun/runcode
runcode setup base     # Create a Base wallet (or: runcode setup solana)
runcode                # Launch — picks model interactively

Fund the wallet address with USDC on Base, or use free models immediately — no funding required to start.

Features

Agent Capabilities

RunCode is a full coding agent with 10 built-in tools:

ToolDescription
ReadRead files with line numbers
WriteCreate or overwrite files
EditTargeted find-and-replace edits
BashRun shell commands with timeout
GlobFind files by pattern
GrepSearch file contents (uses ripgrep)
WebSearchSearch the web
WebFetchFetch and read web pages
AgentSpawn sub-agents for parallel tasks
TaskTrack tasks within a session

Model Selection

Launch with the interactive model picker, or specify directly:

runcode                          # Interactive picker
runcode -m sonnet                # Claude Sonnet 4.6
runcode -m gpt                   # GPT-5.4
runcode -m deepseek              # DeepSeek V3
runcode -m free                  # Nemotron Ultra 253B (free)

Switch models mid-session:

/model              # Interactive picker
/model flash        # Switch to Gemini 2.5 Flash
/cost               # Check session cost
All model shortcuts (30+)
ShortcutModelPrice (in/out per 1M)
sonnetClaude Sonnet 4.6$3 / $15
opusClaude Opus 4.6$5 / $25
gptGPT-5.4$2.5 / $15
geminiGemini 2.5 Pro$1.25 / $10
flashGemini 2.5 Flash$0.15 / $0.6
deepseekDeepSeek V3$0.28 / $0.42
r1DeepSeek R1$0.28 / $0.42
haikuClaude Haiku 4.5$0.8 / $4
miniGPT-5 Mini$0.25 / $2
nanoGPT-5 Nano$0.05 / $0.4
o3O3$2 / $8
o4O4 Mini$1.1 / $4.4
grokGrok 3varies
glmGLM-5 (Zhipu)$0.001/call
glm-turboGLM-5-Turbo (Zhipu)$0.001/call
freeNemotron Ultra 253BFREE
devstralDevstral 2 123BFREE
qwen-coderQwen3 Coder 480BFREE
maverickLlama 4 MaverickFREE

Token Optimization

Nine layers of automatic optimization keep context usage low and costs down:

  • Thinking block stripping — removes old reasoning from history
  • Tool result budgeting — caps large outputs at 50K chars with preview
  • Microcompaction — clears old tool results (keeps last 8)
  • Time-based cleanup — clears stale results after 60min idle
  • Auto-compact — summarizes history when approaching context limit
  • Adaptive max_tokens — starts at 8K, escalates to 64K on demand
  • Prompt-too-long recovery — auto-compacts and retries up to 3x
  • Anthropic prompt caching — automatically adds cache_control markers on system prompt, tools, and recent messages; cuts cached input cost ~90%
  • GLM-5 tuning — sets temperature=0.8 (Zhipu spec), enables thinking mode for -thinking- variants; flat $0.001/call billing tracked accurately

Permission System

By default, read-only tools run automatically. Destructive tools (Write, Edit, Bash) prompt for permission:

  Permission required: Bash
  Execute: rm -rf node_modules

  Allow? [y]es / [n]o / [a]lways:

Use --trust to skip all prompts:

runcode --trust

Configure rules in ~/.blockrun/runcode-permissions.json:

{
  "allow": ["Bash(git *)"],
  "deny": ["Bash(rm -rf *)"]
}

Streaming Tool Execution

Concurrent-safe tools (Read, Glob, Grep) start executing while the model is still streaming. Sequential tools (Write, Edit, Bash) wait for the full response. This reduces latency on multi-tool turns.

Proxy Mode

Use any model through Claude Code by running RunCode as a payment proxy. It translates between OpenAI and Anthropic formats, handles x402 payments, and adds automatic fallback when a model is unavailable.

runcode proxy                    # Start payment proxy on :8402
runcode proxy -m deepseek        # With default model

One-command setup for Claude Code:

runcode init                     # Auto-configures Claude Code + LaunchAgent

This writes the proxy endpoint into Claude Code's config and installs a macOS LaunchAgent so the proxy starts automatically on login. Run runcode uninit to undo.

How it works:

Claude Code → RunCode proxy (:8402) → BlockRun API → 55+ models
                 ↓
          x402 payment (USDC)
          SSE format translation
          Auto-fallback on failure

Payment

RunCode uses the x402 protocol for pay-per-request payments with USDC stablecoins. No accounts, no API keys, no subscriptions.

Supported chains

ChainDefaultAPI endpointGas token
Baseblockrun.ai/apiETH (tiny, ~$0.00)
Solanasol.blockrun.ai/apiSOL (tiny, ~$0.00)

Both chains use USDC (USD Coin) as the payment token. USDC is a stablecoin pegged 1:1 to USD — $1 USDC = $1.

Quick setup

Option A — Base (recommended for most users):

runcode setup base         # Create an EVM wallet (Base chain)
runcode balance            # Check USDC balance

Fund with USDC on Base:

  • Buy ETH on Coinbase → bridge to Base → swap to USDC on Aerodrome
  • Or: buy USDC directly on Coinbase and withdraw to Base network
  • Or: transfer USDC from any Base wallet to the address shown by runcode balance

Option B — Solana:

runcode setup solana       # Create a Solana wallet
runcode balance            # Check USDC balance

Fund with USDC on Solana:

  • Buy SOL on Coinbase/Binance → swap to USDC on Jupiter
  • Or: buy USDC on any exchange and withdraw to Solana network
  • Or: transfer USDC from any Solana wallet (e.g., Phantom, Backpack)

Switching chains

runcode solana             # Switch to Solana
runcode base               # Switch to Base

Or via environment variable (useful for CI/CD):

RUNCODE_CHAIN=solana runcode
RUNCODE_CHAIN=base runcode

Wallets are stored locally in ~/.blockrun/. Each chain has its own wallet — switching doesn't affect the other.

What does it cost?

Model~Cost per request
Free models (Nemotron, Devstral, etc.)$0
DeepSeek V3 / Gemini Flash~$0.001
GLM-5 / GLM-5-Turbo$0.001/call (flat rate, any token count)
Claude Haiku / GPT-5 Mini~$0.005
Claude Sonnet / GPT-5.4~$0.01
Claude Opus~$0.05

The balance shown in the status bar updates in real-time as you spend — no need to wait for on-chain confirmation.

Typical usage: $5-20/month for active development. Start with free models — no funding required.

Where to get USDC

SourceChainNotes
CoinbaseBase (native)Cheapest — withdraw directly to Base
BinanceSolanaWithdraw as USDC-SPL
JupiterSolanaSwap any Solana token → USDC
AerodromeBaseSwap ETH/USDC on Base
UniswapBaseSwap on Base network

Commands

CommandDescription
runcodeStart the agent (interactive model picker)
runcode -m <model>Start with a specific model
runcode --trustStart in trust mode (no permission prompts)
runcode --debugStart with debug logging
runcode setup [base|solana]Create payment wallet for Base or Solana
runcode baseSwitch to Base chain
runcode solanaSwitch to Solana chain
runcode balanceCheck USDC balance
runcode modelsList all models with pricing
runcode statsView usage statistics and savings
runcode config listView configuration
runcode proxyRun as payment proxy for Claude Code
runcode initAuto-configure Claude Code + LaunchAgent
runcode uninitRemove Claude Code proxy config

Session Commands

CommandDescription
/modelInteractive model picker
/model <name>Switch model (shortcut or full ID)
/costShow session cost and savings
/helpList all commands
/exitQuit

Architecture

src/
├── agent/                  # Core agent loop, LLM client, token optimization
├── tools/                  # 10 built-in tools (read, write, edit, bash, ...)
├── ui/                     # Terminal UI + model picker
├── proxy/                  # Payment proxy for Claude Code
├── router/                 # Smart model routing
├── commands/               # CLI commands (setup, balance, stats, ...)
├── wallet/                 # Wallet management
├── stats/                  # Usage tracking
├── config.ts               # Global configuration
└── index.ts                # Entry point

Development

git clone https://github.com/BlockRunAI/runcode.git
cd runcode
npm install
npm run build
npm test             # Deterministic local test suite (no live model required)
npm run test:e2e     # Live end-to-end suite (hits real model API)
node dist/index.js --help

Contributing

Contributions are welcome. Please open an issue first to discuss what you'd like to change.

License

Apache License 2.0

Keywords

runcode

FAQs

Package last updated on 10 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts