A tiny (~180-line), zero-dependency agentic coding agent that runs on any
Anthropic-compatible /v1/messages API. Built for Pioneer,
works with the Anthropic API too.
Drop it in a repo, give it a task, and it reads files, edits them, runs your build/tests, and reports what it changed — all from one small file you can read in five minutes. No framework, no install, no lock-in.
export PIONEER_API_KEY=pio_sk_...your_key...
node pioneer-agent.mjs "add a GET /api/health route that returns { ok: true }"Most coding agents are heavy frameworks. This is the opposite: one file, raw
fetch, the standard Anthropic tool-use loop. Use it to:
- Run agentic coding against a cheaper or alternative Anthropic-compatible endpoint (Pioneer, a self-hosted gateway, etc.) instead of your primary one.
- Drive headless code-gen on a server or in CI with zero dependencies.
- Read and understand a complete agent loop without wading through a framework.
- Node 20+ (uses the built-in global
fetch). Nonpm installneeded.
| Env var | Required | Default | Notes |
|---|---|---|---|
PIONEER_API_KEY |
yes | — | Sent as the X-API-Key header. |
PIONEER_BASE_URL |
no | https://api.pioneer.ai/v1 |
Use https://api.anthropic.com/v1 for Anthropic. |
PIONEER_MODEL |
no | claude-sonnet-4-6 |
Any model your endpoint serves. |
Run it from the root of the repo you want it to work on:
node pioneer-agent.mjs "your task in plain English"Optional convenience wrapper:
# /usr/local/bin/pio
#!/usr/bin/env bash
set -a; source ~/.pioneer-env; set +a # a file holding your env exports (gitignored!)
node /path/to/pioneer-agent.mjs "$@"pio "refactor lib/date.ts to use Intl.DateTimeFormat and update the tests"The agent has four tools, all confined to the current working directory:
list_dir— list a directoryread_file— read a filewrite_file— create/overwrite a file (full content)run_bash— run a shell command (build, test, grep,git diff, …)
It runs the standard tool-use loop until the model finishes, then prints the files it changed and the token usage.
- File ops are confined to the working directory (paths that escape are rejected).
run_bashexecutes arbitrary shell commands. Run this in a repo/VM you trust, ideally a sandbox or container. Treat it like letting a contributor run a script.- It never commits or pushes. Review the diff (
git diff) and commit yourself. - Never commit your API key. Keep it in an env var or a gitignored env file.
MIT — see LICENSE. Contributions welcome.