Firecracker
Firecracker microVM lifecycle management via SSH + the Unix-socket REST API. One model instance = one microVM socket.
Model @magistr/firecracker:
- Configure machine, boot source, drives, network interfaces, vsock, entropy.
- start / stop / pause / resume; send_ctrl_alt_del.
- snapshot / restore; wait_serial (poll serial log for snapshot baking).
- kill_vmm (precision kill via PID sidecar); start_vmm (idempotent warm-start).
- Host bootstrap: install_firecracker, install_guest_kernel (modern CI vmlinux), setup_tap, build_ubuntu_rootfs (debootstrap Ubuntu + glibc Claude Code, init=/opt/fc-agent.sh), update_agent_script (deploy PID-1 agent).
Workflows:
@magistr/fc-install-firecracker— install/upgrade the Firecracker binary.@magistr/fc-bake-snapshot— boot, wait for agent poll-state, snapshot, tear down — leaves a warm agent snapshot for fast restore.@magistr/fc-run-agent— run a Claude Code agent task inside a microVM, with guaranteed cleanup.
Merge pull request #11 from umag/chore/firecracker-utf8-release
release(firecracker): 2026.06.12.2 — UTF-8-safe fabric base64
Global Arguments
| Argument | Type | Description |
|---|---|---|
| host | string | SSH host/IP of the machine running Firecracker — host key verification is disabled; use on trusted networks only |
| user | string | SSH username (default: root) |
| socketPath | string | Path to the Firecracker Unix socket on the remote host (e.g. /run/firecracker.socket). One model instance = one microVM socket. |
| netns? | union | Optional Linux network namespace for this microVM. When set, start_vmm launches Firecracker inside it (ip netns exec) and kill_vmm tears it down — lets many clones of one base snapshot run without IP/gateway overlap. Pair with setup_tap's netns mode. Omit for the single-VM root-namespace path (unchanged). |
| Argument | Type | Description |
|---|---|---|
| vcpuCount | number | vCPU count (1–32) |
| memSizeMib | number | Memory in MiB (minimum 128) |
| smt? | boolean | Enable simultaneous multi-threading |
| trackDirtyPages? | boolean | Enable dirty-page tracking (needed for live migration) |
| Argument | Type | Description |
|---|---|---|
| kernelImagePath | string | Path to the uncompressed kernel image on the Firecracker host |
| bootArgs | string | Kernel boot arguments (e.g. 'console=ttyS0 reboot=k panic=1 pci=off') |
| initrdPath? | string | Optional path to initrd on the Firecracker host |
| Argument | Type | Description |
|---|---|---|
| driveId | string | Drive identifier (e.g. 'rootfs', 'data1') |
| pathOnHost | string | Path to the drive image file on the Firecracker host |
| isRootDevice | boolean | Whether this is the root block device |
| isReadOnly | boolean | Mount as read-only |
| Argument | Type | Description |
|---|---|---|
| ifaceId | string | Interface identifier (e.g. 'eth0') |
| hostDevName | string | Host tap device name (e.g. 'tap0', max 15 chars) |
| guestMac? | string | Guest MAC address — auto-assigned by Firecracker if omitted |
| Argument | Type | Description |
|---|---|---|
| guestCid | number | Guest CID (context identifier) for the vsock device — must be ≥ 3 |
| udsPath | string | Host-side Unix socket path for the vsock device (e.g. /tmp/fc-agent-1.vsock) |
| Argument | Type | Description |
|---|---|---|
| claudeCodeVersion | string | claude-code release tag (default: latest). Uses the glibc claude-linux-x64 build. |
| rootfsPath | string | Final path for the rootfs image on the Firecracker host |
| sizeMib | number | Size of the rootfs image in MiB |
| suite | string | Ubuntu suite/codename for debootstrap (e.g. noble, jammy) |
| force | boolean | Rebuild even if the ready-marker already exists |
| Argument | Type | Description |
|---|---|---|
| rootfsPath | string | Path to the rootfs image on the Firecracker host |
| mountPoint | string | Temporary mount point (created if absent) |
| Argument | Type | Description |
|---|---|---|
| target | string | String to wait for in the serial log (e.g. 'polling for task') |
| logPath? | string | Path to the FC log file on the host. Defaults to /var/log/<socket-basename>.log |
| timeoutSeconds | number | Max seconds to wait for the target string |
| Argument | Type | Description |
|---|---|---|
| snapshotPath | string | Host path to write the snapshot file (e.g. /opt/firecracker/agent-snapshot.snap) |
| memFilePath | string | Host path to write the memory file (e.g. /opt/firecracker/agent-snapshot.mem) |
| snapshotType | enum | Full captures the entire state; Diff captures only changes since last snapshot |
| Argument | Type | Description |
|---|---|---|
| snapshotPath | string | Path to the snapshot file |
| memFilePath | string | Path to the memory file |
| vsockUdsPath? | string | Override vsock UDS path for this instance (vsock_override) — required when running concurrent VMs from the same snapshot |
| ifaceId? | string | Network interface id baked into the snapshot (e.g. 'eth0') to remap on restore. Pair with hostDevName to emit network_overrides — lets a clone bind its own per-VM tap. |
| hostDevName? | string | Host tap device to bind the baked interface to on restore (network_overrides). Requires ifaceId. |
| Argument | Type | Description |
|---|---|---|
| vsockUdsPath? | string | vsock UDS base path — also removes {vsockUdsPath}_* side-car files |
| Argument | Type | Description |
|---|---|---|
| version? | string | Specific version tag to install (e.g. 'v1.12.0'). Defaults to latest GitHub release. |
| arch? | string | CPU architecture (e.g. 'x86_64', 'aarch64'). Auto-detected if omitted. |
| installPath | string | Destination path for the binary |
| Argument | Type | Description |
|---|---|---|
| kernelVersion | string | Kernel version available in the Firecracker CI bucket (e.g. 6.1.128, 5.10.233) |
| ciVersion | string | Firecracker CI artifacts prefix (e.g. v1.12) |
| arch? | string | CPU architecture (default: uname -m, e.g. x86_64) |
| installPath | string | Destination path for the kernel image |
| url? | string | Full override URL for the vmlinux image (bypasses ciVersion/kernelVersion) |
| force | boolean | Re-download even if the recorded version already matches |
| Argument | Type | Description |
|---|---|---|
| tapName | string | TAP device name (default: tap0) |
| hostIp | string | Host IP on the TAP subnet (guest default gateway) |
| prefix | number | Subnet prefix length (default: 24 → /24) |
| guestSubnet | string | Guest subnet for NAT masquerade rule |
| netns? | union | Optional network namespace. When set, the tap + veth + NAT are built INSIDE this namespace so many clones of one base snapshot run without overlap (reusing the same guest IP). Omit for the single-VM root-namespace path (unchanged). |
| vethSubnet | string | Host↔namespace veth subnet (netns mode only). MUST be unique per concurrent VM; .1 is the host side, .2 the namespace side. Derive per-VM (e.g. 10.0.<index>.0/30). |
| Argument | Type | Description |
|---|---|---|
| logPath? | string | Path to write Firecracker stderr/stdout on the host (default: /var/log/fc-<socket-basename>.log) |
| vsockUdsPath? | string | vsock UDS base path — stale files at this path and {path}_* are removed when starting fresh to avoid EADDRINUSE on snapshot restore |
| Argument | Type | Description |
|---|---|---|
| concurrency | number | Pool size = max concurrent worker VMs (configurable; ~512MiB RAM each) |
| snapshotPath | string | |
| memFilePath | string | |
| queueRoot | string | |
| netnsPrefix | string | |
| tapName | string | |
| tapIp | string | |
| guestSubnet | string | |
| port | number | |
| oauthToken | string | Claude Code OAuth token; the daemon injects it at serve time (never written to the queue) |
| Argument | Type | Description |
|---|---|---|
| queueRoot | string | |
| tasks | array |
| Argument | Type | Description |
|---|---|---|
| queueRoot | string | |
| ids? | array | If given, only report these ids |
| Argument | Type | Description |
|---|---|---|
| concurrency | number | Lower-bound fallback only; the real pool is discovered from host state |
| netnsPrefix | string | |
| queueRoot | string |
| Argument | Type | Description |
|---|---|---|
| concurrency | number | |
| timeoutSeconds | number | |
| queueRoot | string | |
| netnsPrefix | string | |
| tapName | string | |
| tapIp | string | |
| guestSubnet | string | |
| port | number | |
| snapshotPath | string | |
| memFilePath | string | |
| oauthToken | string |
Resources
Download and install the latest Firecracker binary on the remote host. Run once to upgrade from an old version that lacks /entropy-device support.
Update the agent script in the rootfs, boot a fresh Firecracker VM, wait for the agent to reach the polling-for-task state, snapshot, then tear down. Leaves /opt/firecracker/agent-snapshot.{snap,mem} ready for fc-run-agent. Uses only @magistr/firecracker methods — no @adam/cfgmgmt dependency.
Run a Claude Code agent task inside a Firecracker microVM. Guest reaches the internet via TAP networking + host NAT. A simple TCP HTTP server on the host TAP IP serves the task JSON (with OAuth token) to the guest and collects the result. Two-job structure ensures cleanup always runs: Job 1 (run-agent): setup-tap → ensure-vmm-ready → deploy-server → restore-snapshot → inject-task → collect-result Job 2 (cleanup): depends on run-agent with type:always → stop-server → kill-vmm → pre-warm-nex
release: firecracker + fc-task-server 2026.06.12.1 — bundle CHANGELOG
Bump both to 2026.06.12.1 and add CHANGELOG.md to additionalFiles so the published archive carries the changelog + the updated README (task-fabric methods in the Methods list). No model behaviour change. CI publishes to stable.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Merge pull request #9 from umag/feat/fc-task-factory
firecracker: fast task fabric — warm worker pool + queue (factory) on top of netns
Modified 1 models
fc-task-server + firecracker: default Claude Code agent effort to low
Adds a configurable reasoning-effort control to the Firecracker microVM agent flow, defaulting to "low" so sandboxed agent runs stay fast and cheap.
@magistr/fc-task-server 2026.06.09.3
- inject_task gains an
effortarg: z.enum([low,medium,high,xhigh,max]) defaulting to "low", written into the task JSON served to the guest. - 3 new unit tests (default low, accepts a level, rejects unknown).
@magistr/firecracker 2026.06.09.20
- Guest agent script reads
effortfrom the task JSON and passes ${EFFORT:+--effort "$EFFORT"} toclaude --print(double-quoted; the value is enum-validated upstream). Pick up the new script via update_agent_script (or re-bake the rootfs).
Effort levels match the Claude Code CLI --effort flag
(low/medium/high/xhigh/max; max is Opus-tier only).
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Add @magistr/firecracker and @magistr/fc-task-server extensions
Relocate both Firecracker microVM extensions into the workspace monorepo at Grade A (14/14), repackaged from the published registry versions.
@magistr/firecracker 2026.06.09.19
- Firecracker microVM lifecycle over SSH + the Unix-socket REST API: machine/boot/drive/network/vsock config, start/stop/pause/resume, snapshot/restore, precision kill_vmm + idempotent start_vmm, and host bootstrap (install Firecracker + guest kernel, setup_tap, build Ubuntu rootfs + agent).
- Ships the fc-install-firecracker, fc-bake-snapshot and fc-run-agent workflows.
@magistr/fc-task-server 2026.06.09.2
- Host<->guest task/result control-plane server (deploy / inject_task / collect_result / stop) for Claude Code agents in Firecracker microVMs.
Both gain a README + MIT LICENSE, repository metadata, unit tests (12 and 13 respectively, covering success and failure paths), and two labelled pre-flight checks: valid-ssh-host (policy) and host-reachable (live).
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Modified 1 models. Added 1 workflows
Modified 1 models
Modified 1 models
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned