Where the credits go
Every tool round trip re-sends the agent's whole conversation. A Forge program does the same work inside one call, so the conversation is sent once.
Tool by tool 6 round trips
- 1web_search "agent languages"↻ resend chat
- 2http_get result 1↻ resend chat
- 3http_get result 2↻ resend chat
- 4http_get result 3↻ resend chat
- 5write_file digest.md↻ resend chat
- 6read result, reply↻ resend chat
With Forge 1 round trip
- 1forge_run(program)sent once
STEP s TOOL web_search INPUT { q: $topic, n: 3 } OUTPUT hits FOR EACH h IN $hits OUTPUT pages STEP get TOOL http_get INPUT { url: $h.url } OUTPUT page YIELD $page.text END STEP doc TOOL join INPUT { list: $pages } OUTPUT digest STEP save TOOL write_file INPUT { path: "digest.md", body: $digest } OUTPUT saved
How much this saves depends on how many steps the job has and how long the conversation already is.
Measure it on your own model with ./forge credit-test.
Made for AI emission
Uppercase keywords, $variables, no operator precedence to get wrong. The whole language fits in an agent's context.
Errors an AI can fix
Typos, unknown tools and undefined variables are caught before anything runs, all at once, with the valid options listed. One retry usually fixes it.
Safe to hand an agent
Step and time budgets, file access limited to the working folder, cloud-metadata addresses blocked, and a cap on what each REASON sends to the LLM.
How Forge compares
Writing one program instead of many tool calls isn't unique to Forge. Anthropic, Cloudflare and Hugging Face let models write Python or TypeScript in a sandbox ("code mode"). Forge uses a small language instead. Each has a real advantage.
| One tool call per step | Python / TypeScript code mode | Forge | |
|---|---|---|---|
| Round trips for a 6-step job | 6 | 1 | 1 |
| Model already knows the language | — | Yes | No: a ~900-token spec rides along |
| What a program can do | — | Anything the sandbox allows | Only call the listed tools |
| Needs a sandbox to run safely | No | Yes: container, isolate or restricted interpreter | No: safe by construction |
| Checked before anything runs | — | Syntax | Syntax, unknown tools, undefined variables |
| Where it works | Everywhere | Varies by vendor and platform | Any model, any MCP client, zero dependencies |
Pick code mode if you already run a sandbox and want full flexibility.
Pick Forge if you'd rather not execute model-written code, want one setup across
models and MCP clients, or run small local models. forge agent-bench
measures all three on the same tasks and model.
Playground
Edit a program and run it. This is the real Forge runtime, running in your browser with Python compiled to WebAssembly. Nothing is sent to a server.
REASON steps get a placeholder "mock AI" reply here (connect a real model in the CLI or MCP server), and the network tools (http_get, http_post) need the CLI or MCP server.
The whole language
Loop (in parallel), think, act, verify, recover, return. That's all of it: no imports, no framework.
AGENT "page-digest" MEMORY { urls: ["https://example.com", "https://iana.org"] } FOR EACH url IN $urls OUTPUT digests STEP fetch TOOL http_get INPUT { url: $url } OUTPUT page IF $page.status == 200 REASON "One-sentence summary" ON $page.text OUTPUT s YIELD { url: $url, summary: $s } END END VERIFY $digests != [] RETURN $digests
Primitives, not libraries
The language is the agent workflow.
19 built-in tools: web (http_get, http_post, web_search),
files, and data (sort, pick, sum, format…).
Add your own with one Python function.
Text syntax or JSON AST, same runtime. forge spec prints the whole
reference for an AI's context window.
Give your agent Forge
Forge ships an MCP server. Any MCP client (Claude Code, Claude Desktop, Cursor and others)
gets two tools: forge_run and forge_check.
The language reference rides along in the tool description, so the agent needs no other docs.
Claude Code plugin: MCP server plus a skill that knows when to use it
/plugin install forge --marketplace kungFuDOOM/forge
Or install the forge command
pip install git+https://github.com/kungFuDOOM/forge.git
…and add it to Claude Code as an MCP server
claude mcp add forge -- forge mcp
Add your own tools
forge mcp --tools my_tools.py
Any MCP client config (JSON)
{
"mcpServers": {
"forge": {
"command": "forge",
"args": ["mcp"]
}
}
}
Start in 60 seconds
No API key needed for the demos. Add Ollama, a free Groq / Gemini key, or an xAI Grok key for ./forge ask and live REASON steps.
# clone & go git clone https://github.com/kungFuDOOM/forge.git cd forge ./forge quickstart ./forge run examples/deal_triage.forge ./forge ask "Fetch example.com and summarize it" ./forge spec