# A math brain for your AI

When you force a poet to do math, you get a beautiful, confident, incorrect answer. SandScript gives the poet a calculator.
curl -fsSL sandscriptmath.ai/install | sh

Works with: Claude Code · Cursor · VS Code · Windsurf · Claude Desktop · Zed · Copilot · Codex · OpenCode · LM Studio

curl -fsSL sandscriptmath.ai/install | sh
$7 — Support the project

Works with: Claude Code · Cursor · VS Code · Windsurf · Claude Desktop · Zed · Copilot · Codex · OpenCode · LM Studio

## Trust the math

Agents reason brilliantly but compute poorly. They know that the volume of a sphere is (4/3)πr³ — they just can't multiply it out without fumbling.

SandScript executes the formula exactly as written, every time.

## Inspect everything

See exactly what your agent calculated. Every tool call is visible in the conversation. No black box.

Run the same commands yourself with the CLI. The session state lives on your machine — inspect it, export it, or continue where the agent left off.

## Sandboxed

Your agent can run code without risk. The sandbox does pure computation — no file access, no network, no side effects.

Code runs in a WebAssembly interpreter with fuel limits. The worst it can do is run out of fuel and pause.

## Why does it look like JavaScript?

SandScript is a strict subset of JavaScript. Every SandScript program is valid JS with identical semantics — you can paste it into a browser console and it works the same.

LLMs have been trained on millions of lines of JavaScript. That familiarity means they can write SandScript naturally, without special prompting or examples.

We kept the parts that matter for calculations: let, functions, objects, arrays, if/for/while, try/catch, and the full Math library. We left out classes, async/await, destructuring, and other features that add complexity without helping calculation tasks.

## How it works

SandScript runs in a WebAssembly interpreter. Your code is parsed into bytecode and executed in a sandbox with its own memory space.

Every operation costs fuel. When fuel runs out, execution pauses — no infinite loops, no runaway computations.

Everything lives in linear memory: the bytecode, variables, the call stack, intermediate values. Sessions can be saved, restored, and inspected at any point.

## Sessions

Variables persist across calls. When your agent sets let income = 85000, that value stays available for the next calculation.

You can name sessions for different projects — taxes-2024, mortgage-calc — and switch between them. Sessions are saved to disk and survive restarts.

## The sandbox

The interpreter has no access to the outside world. No network, no filesystem, no timers, no system calls. It can compute, and that's it.

Your agent can write and execute code without risk. The worst it can do is run out of fuel and pause.

## Try it yourself

Open the Playground to write code, step through execution, and inspect memory — all in your browser.

Read the Docs for the full API reference and language overview.