v0.0.1 · Experimental · Pure JavaScript ESM · AGPL

The agent runner you
can read in one sitting.

agent-micro is a zero-dependency, open-source replacement for the Claude Code runner inside jsclaw containers — the Anthropic API over fetch, six tools, and nothing else. No node_modules. No black boxes.

$ git clone https://github.com/jsclaw/agent-micro Copied
Then: docker build
0
Dependencies
~1,000
Lines
18
Tests passing
~150 MB
Image
Why

Open source, top to bottom.

jsclaw's default container runs the proprietary Claude Code harness — 238 MB you can't read. agent-micro speaks the same container contract with code you can audit before your coffee cools.

agent-microdefault runner
Agent harness~50 kB of plain JS, AGPLClaude Code — proprietary, 238 MB
npm dependencies0claude-code, MCP SDK, cron-parser
Container image~150 MB~1.5 GB
Auditable every linepartially
Container contract identical
MCP passthrough · subscription authnot yet · API key only
Inside

Six files. The whole stack.

Built entirely on the Node standard library. The container is the sandbox; the loop is just a REPL with hands.

Drop-in contract

runner.js reads ContainerInput on stdin and writes sentinel-delimited output on stdout. Identity files, memory/*.md, IPC polling — identical to the default runner. Swap with one config line.

Fetch, nothing else

api.js speaks the Anthropic Messages API in ~80 lines: retries with backoff, prompt caching via cache_control, and ANTHROPIC_BASE_URL for proxies and alternative providers.

The agent loop

loop.js: send, execute tool calls, append results, repeat until the model stops. Context trimming keeps long sessions under the window.

Six core tools

bash, read_file, write_file, edit_file, glob, grep — unrestricted inside the container, because the container is the boundary.

IPC without MCP

send_message, schedule_task and friends as plain in-process functions writing atomic JSON files the host watcher picks up. No transport, no SDK.

Sessions are JSON

A session is the raw messages array on disk. Resume is a file read. No daemon, no database, nothing to migrate.

Quick start

One build, one config line.

Build the image and point jsclaw at it — or run the runner bare on your machine for development. No npm install in sight.

agent-micro — zsh
$ git clone https://github.com/jsclaw/agent-micro && cd agent-micro
$ docker build -t jsclaw-agent-micro:latest -f container/Dockerfile .
$ npx jsclaw config set containerImage jsclaw-agent-micro:latest

# or standalone, no container:
$ export ANTHROPIC_API_KEY=sk-ant-…
$ echo '{"prompt": "list the files here"}' | node runner.js

---JSCLAW_OUTPUT_START---
{"status":"success","result":"…","newSessionId":"…"}
---JSCLAW_OUTPUT_END---

Status: experimental. The loop, tools, sessions, and jsclaw IPC integration work and are tested; external MCP servers and web tools are on the roadmap. Bring an API key — subscription auth needs Claude Code.

Source map

Read it before your coffee cools.

Every file works standalone. The whole runner is ~1,000 lines.

Audit your entire agent stack before lunch.

From the jsclaw gateway to the API wire — every line open, every line yours.

$ git clone https://github.com/jsclaw/agent-micro Copied
Read the docs