agentleFS
arcboxlabsarcboxlabs/arcbox/AGENTS.md

arcbox

AGENTS.md4.3k starsChanged 4 months agoApache-2.0View on GitHub

ArcBox is a high-performance container and virtual machine runtime in Rust, targeting macOS (primary) and Linux. The goal is to surpass OrbStack on every metric. The project is in alpha. Breaking changes (internal or user-facing) are acceptable — always prioritize consistency, coherence, and long-term maintainability, even if that means large-scale rewrites. ¹ Host cost is the high-water mark of guest-touched pages, not the configured memory_mb: a fresh idle 16 GB VZ VM measured ~718MB of host phys_footprint (2026-08-01). On VZ…

  • Reads credentials
  • Installs packages

Trending

Quiet since September.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 0 mentionsSep 2026: 3 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the arcboxlabs/arcbox repository that our weekly crawl found: only 6 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about arcboxlabs/arcbox

The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 6

Talked about on Bluesky, GitHub and Hacker News (6 times).

On GitHub · 2

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

21 rules. About 0 are common, 13 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a change touches files under a directory that has an AGENTS.md, read that file before editing — imported or not.

    line 80
  2. Very specific:

    Run cargo clippy and cargo fmt before committing.

    line 90
  3. Distinctive:

    All comments in English

    line 91
  4. Distinctive:

    When behavior or public API changes, update related comments and documentation in the same change.

    line 92
  5. Very specific:

    Use thiserror for crate-specific errors, anyhow in CLI/API layers

    line 94
  6. Very specific:

    Prefer extension traits over free helper functions when the operation is specific to a type (e.g.

    line 97
  7. Very specific:

    Prefer From/Into trait chains for error conversion.

    line 98
  8. Distinctive:

    Prefer refactoring over layered, patchy fixes.

    line 100
  9. Distinctive:

    No hacky workarounds. If a workaround is truly unavoidable, pause and get user approval first.

    line 101
  10. Distinctive:

    When the right choice is obvious, make the decision — don't ask unnecessary questions.

    line 102
  11. Distinctive:

    If a request appears to conflict with these guidelines, double-check intent with the user before proceeding.

    line 103
  12. Distinctive:

    When project conventions or processes change, this file (AGENTS.md) must be updated promptly.

    line 104
  13. Very specific:

    Every new file goes into the index in docs/README.md.

    line 128
  14. Very specific:

    Commit messages: type(scope): summary (e.g.

    line 135
  15. Distinctive:

    Keep each commit atomic — compilable, runnable.

    line 136
  16. Distinctive:

    Commit along the way. Do not batch all changes into a single commit at the end.

    line 137
  17. Very specific:

    Use cargo add / cargo remove for dependency changes, not manual Cargo.toml edits.

    line 138
  18. Distinctive:

    Keep that token narrowed to this repo and to contents.

    line 164
  19. Distinctive:

    All crates: MIT OR Apache-2.0

    line 185
  20. Very specific:

    fallocate: Not available on macOS. Use ftruncate as fallback.

    line 215
  21. Distinctive:

    VirtIO batching: Not batching virtqueue pop/push causes excessive VM exits.

    line 216

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Repository Guidelines for Coding Agents

Project Overview

ArcBox is a high-performance container and virtual machine runtime in Rust, targeting macOS (primary) and Linux. The goal is to surpass OrbStack on every metric.

The project is in alpha. Breaking changes (internal or user-facing) are acceptable — always prioritize consistency, coherence, and long-term maintainability, even if that means large-scale rewrites.

Performance Targets

MetricTargetOrbStack
Cold boot<1.5s~2s
Warm boot<500ms<1s
Idle memory<150MB¹~200MB
Idle CPU<0.05%<0.1%
File I/O≥100% of the best competitor guest²75-95% (vs native, their claim)
Network throughput>50 Gbps~45 Gbps

¹ Host cost is the high-water mark of guest-touched pages, not the configured memory_mb: a fresh idle 16 GB VZ VM measured ~718MB of host phys_footprint (2026-08-01). On VZ that mark is a one-way ratchet — guest RAM lives in Apple's XPC process, out of the daemon's reach — so the guest freeing 3GB leaves the host paying for it forever. On HV the guest's free page reporting drains it back (measured 2026-09-25 on a 16 GB VM: 1.9 GB → 5.0 GB while the guest held 3 GiB of tmpfs → 1.95 GB ten seconds after it freed it). The mechanism, and the madvise dead ends, are in virt/arcbox-vmm/AGENTS.md "Releasing guest RAM" and engine/arcbox-engine/src/vm_lifecycle/balloon/mod.rs. ² Same-context comparison (container vs container, same-day pairing). Cache-hot native is not a valid denominator for FUSE metadata — methodology and current numbers in docs/benchmarks/virtiofs.md.

Platform Priority

  1. P0: macOS Apple Silicon
  2. P1: macOS Intel
  3. P2: Linux x86_64/ARM64

Project Structure

  • common/ — shared error types, constants, asset utilities
  • virt/ — Virtualization.framework bindings, cross-platform hypervisor traits, VMM, VirtIO devices, VirtioFS, networking (NAT/DHCP/DNS)
  • rpc/ — protobuf definitions, gRPC services, vsock/unix transport
  • runtime/ — container state, OCI image/runtime
  • engine/ — embeddable, daemon-free engine library (boot assets, machine images, VM/machine lifecycle, agent client; growing per the architecture charter in the company repo)
  • computer/ — agent-computer domain layer: transport-free sandbox protocols behind the SandboxHost seam
  • app/ — core orchestration, API server, Docker Engine API compat, thin CLI (abctl, not arcbox), daemon binary (arcbox-daemon), facade crate
  • guest/ — in-VM agent (cross-compiled for Linux)
  • tests/ — test resources and fixture build scripts
  • .agents/skills/ — shared coding-agent skills (symlinked from .claude/skills/)
  • docs/ — engineering docs: reference guides at the top level, then architecture/ (designs), adr/ (decisions), plans/, experiments/ (question → method → verdict), benchmarks/ (stable method, dated results), logs/ (changes, investigations, incidents); layout, templates and the index in docs/README.md

Component Rules

Per-directory agent rules live in AGENTS.md files next to the code they govern, and are imported here:

@virt/AGENTS.md @virt/arcbox-vmm/AGENTS.md @virt/arcbox-vz/AGENTS.md @virt/arcbox-virtio-blk/AGENTS.md @engine/AGENTS.md @computer/AGENTS.md @app/AGENTS.md @guest/AGENTS.md @rpc/AGENTS.md @common/AGENTS.md @runtime/AGENTS.md @tests/e2e/AGENTS.md @xtask/AGENTS.md

(common/arcbox-route/AGENTS.md is crate-local reference material and is loaded on demand rather than imported.)

When a change touches files under a directory that has an AGENTS.md, read that file before editing — imported or not. The set above is the complete list; if you add a new AGENTS.md, add it here too.

Planning

When asked to plan, the plan must be fully resolved before implementation begins. Every decision must be locked — no "TBD", no "option A or B", no open questions. The plan should have exactly one possible outcome. If anything is unclear or uncertain, ask the user before finalizing.

Code Standards

  • Run cargo clippy and cargo fmt before committing. All code must pass both with zero warnings.
  • All comments in English
  • When behavior or public API changes, update related comments and documentation in the same change.
  • unsafe blocks require // SAFETY: comments
  • Use thiserror for crate-specific errors, anyhow in CLI/API layers
  • Hot paths: prefer lock-free / RwLock over Arc<Mutex<T>>, use #[repr(C, align(64))] to avoid false sharing
  • Performance-critical paths (VirtioFS, network stack, VirtIO devices) are all custom-built, not vendored
  • Prefer extension traits over free helper functions when the operation is specific to a type (e.g. request.machine_id()? not extract_machine_id(&request)?; self.runtime.ready()? not get_runtime(&self.runtime)?).
  • Prefer From/Into trait chains for error conversion. Don't write manual mapping helpers like core_to_status() — instead, implement From<LocalError> for ForeignType (using a crate-local error type to satisfy the orphan rule) and let .map_err(LocalError::from)? drive the conversion.
  • Section dividers (// ===...) mean the file should be split. If you find or are about to add a // ==== section divider, that is the signal that the file contains multiple distinct implementations and must be refactored into a module directory (foo/mod.rs + one file per logical unit). Do not add new section dividers to keep a monolithic file — split immediately. Shared types and trait extensions go in mod.rs.
  • Prefer refactoring over layered, patchy fixes. Code changes must be coherent, not duct-taped on.
  • No hacky workarounds. If a workaround is truly unavoidable, pause and get user approval first.
  • When the right choice is obvious, make the decision — don't ask unnecessary questions. But when a plan or request is blocked or infeasible, surface the blocker with enough context for the user to decide the path forward.
  • If a request appears to conflict with these guidelines, double-check intent with the user before proceeding.
  • When project conventions or processes change, this file (AGENTS.md) must be updated promptly. All changes to this file require human approval. It is the only root instruction file — there is no CLAUDE.md; Claude Code reads AGENTS.md directly and expands the @ imports above.

Architecture Principles

  • Resource ownership: each component manages its own resources. Servers own their sockets (remove-before-bind), the daemon owns its lock file. Never centralize cleanup of resources owned by other components — it creates ordering dependencies and race conditions.
  • Daemon ↔ CLI contract: arcbox-daemon and arcbox-cli share a contract via daemon.lock (flock-based liveness) and socket paths. When changing daemon internals (lock mechanism, socket paths, startup protocol), always check and update the CLI's matching logic.
  • Daemon startup order is load-bearing: the 5-phase sequence (init_early → acquire_lock → start_grpc → wait_for_resources → init_runtime) has specific ordering constraints. gRPC must start before slow phases so desktop clients can connect. The lock must be acquired before gRPC so the old daemon's sockets are freed. Changes to startup ordering require careful analysis of these dependencies. See docs/daemon-lifecycle.md.

Testing

  • Tests are expected for code changes. Only test meaningful logic (branching, transformations, error handling). Don't test code that can only break if the language, runtime, or a dependency breaks.

Documentation

  • Work that produced numbers or a verdict is recorded in the same commit series, in the category docs/README.md defines: a question answered with data is a docs/experiments/YYYY-MM-DD-<slug>.md entry; a measurement that will be repeated is a dated row in docs/benchmarks/<subject>.md; a change, root-cause hunt or incident is a docs/logs/YYYY-MM-DD-<slug>.md entry. The probes behind the numbers are checked in under tests/bench/<name>/ or as an e2e target so the entry can be rerun. Retiring a mechanism, choosing between designs, or setting a rule a later change must not undo silently gets an ADR in docs/adr/; the ADR cites the entries, it does not repeat their tables. Every new file goes into the index in docs/README.md.

Change Discipline

  • Changes land on master directly. Work on master or on a local type/short-description branch (e.g. feat/virtio-console, fix/dhcp-lease-expiry) that you fast-forward onto master when done, then push. A pull request is opt-in, for work that wants a review. The master ruleset still blocks force-pushes and branch deletion; the repository admin role bypasses its pull-request requirement, a contributor without that role goes through a PR.
  • CI runs after the push, so run its gates before every push to master, cheapest first: cargo fmt --check, cargo clippy --workspace --exclude arcbox-agent -- -D warnings, cargo xtask check-layers, cargo test --workspace --exclude arcbox-agent, and xcrun swift-format lint --strict --parallel --recursive virt/arcbox-vz/shim when the VZ shim changed. The macOS workspace build, Clippy, and test commands exclude arcbox-agent. Workspace formatting includes the guest agent. The Linux Unit tests job runs the guest agent's lib, bin, and dns_aliases targets (.github/workflows/test-vm-linux.yml). When the guest agent changes, run Clippy for aarch64-unknown-linux-musl locally (guest/AGENTS.md). A change to the guest agent, the VMM, or the daemon's boot path also gets a daemon-level e2e run on the backend it touches (app/AGENTS.md "Validation ladder").
  • fleet/arcbox-fleet-proto/proto is a vendored copy of arcboxlabs/platform's proto/public (BSR module buf.build/arcboxlabs/fleet); make fleet-proto-sync (buf export) overwrites it from the registry. Keep the copy byte-identical to platform's file. A fleet protocol change lands in this order: platform PR (its proto.yml runs buf breaking on the PR and publishes to the BSR on merge) → arcbox vendored copy + agent change. When the arcbox side must land first, copy platform's file by hand and do not run make fleet-proto-sync until the platform PR has merged — the export would roll the copy back to the registry's previous version. Nothing checks the copy: CI's buf breaking job covers fleet/arcbox-fleet-control-proto only, and no job compares the vendored copy with the registry, so drift is silent. An additive change (new field, new oneof variant) is safe to ship agent-first: the gateway skips an AttachRequest whose oneof it does not know (msg: None) and decodes an unknown field as absent.
  • Commit messages: type(scope): summary (e.g. fix(net): correct checksum on fragmented packets). Do not add Co-Authored-By or "Generated by" lines — the master branch ruleset rejects commits whose messages match AI-attribution patterns.
  • Keep each commit atomic — compilable, runnable. Target ~200 lines changed (excluding generated files); hard limit 400. Don't make commits too small either — group related changes into one coherent commit unless that's all there is.
  • Commit along the way. Do not batch all changes into a single commit at the end.
  • Use cargo add / cargo remove for dependency changes, not manual Cargo.toml edits. Check the lockfile diff afterwards: cargo add has bumped unrelated crates and cargo remove has dropped an unrelated workspace dependency — git checkout Cargo.toml Cargo.lock and cargo check re-adds only the intended edge.
  • When a PR is used: the ruleset requires every review thread to be resolved (0 approvals required; squash or rebase only — merge commits are disabled). Address or answer each bot/reviewer thread, resolve it (GraphQL resolveReviewThread if working from the CLI), then merge normally — do not reach for --admin. For stacked PRs, merge the base PR first — and expect GitHub to close the stacked PR when the base branch is deleted; recovery is: re-push the old base ref, reopen the PR, retarget it to master, delete the ref again, then close/reopen once more to trigger CI (pushes made while a PR is closed fire no events).
  • Review-bot findings (pullfrog/Codex/Greptile) get verified against the code first, then either fixed with a reply + thread resolution, or refuted with evidence in the reply. Never resolve a thread silently.

Releasing (the ordering is the contract)

A release runs: merge the release PR → release-please creates the tag and a draft GitHub release → the tag push starts Release Build → package-and-release attaches the tarball and then publishes → the arcbox-desktop bump is announced. Each arrow is load-bearing; changing one without the others reintroduces a failure already paid for.

  • The release stays a draft until its assets exist. release-please-config.json sets draft + force-tag-creation. v0.6.4 published the moment its tag was cut, its macOS build then timed out, and the assetless release sat at the top of the releases page — and told arcbox-desktop to bump to it, whose DMG build failed eight hours later on a missing protoc, three layers from the cause.
  • force-tag-creation is not optional alongside draft. GitHub withholds the git tag for a draft release, and Release Build triggers on tag pushes; without it nothing builds at all.
  • draft belongs on the root package only. fleet, sdk/typescript and sdk/python publish from other workflows and would sit as drafts forever. Their tags carry component prefixes, so they never trigger Release Build.
  • Publishing uses the app token, not GITHUB_TOKEN. A draft created by one integration cannot be modified by another — arcbox-desktop spent a release cycle discovering that as a 403 on the update, after finding the draft. Keep that token narrowed to this repo and to contents.
  • update-desktop waits for the assets and is not gated on the trigger. workflow_dispatch is how a half-finished release is recovered, which is the case that job exists for; gating on push would re-attach assets there and leave desktop un-bumped in silence. The guard that replaces it is a newest-release check, not a trigger check: the dispatch tag is free-form and flows straight into the bump, so recovering a superseded tag would propose moving desktop's arcbox.version backwards. A redundant bump is cheap; a downgrade is not. Do not remove that check believing the worst case is a no-op.
  • The release cache is written from master, never from a tag. A tag cannot read another tag's caches, so no release can warm the next one. ci.yml writes macOS-cargo-release-*; Release Build restores only, and must not fall back to CI's macOS-cargo- debug cache — that fallback made the build look cached while it recompiled the whole graph.
  • A red release run is not evidence of a missing artifact, and green is not evidence of a present one. Check gh release view <tag> --json assets before concluding anything about a release.

Licensing

  • All crates: MIT OR Apache-2.0

macOS Development

  • Virtualization.framework requires Developer ID signing after every build (ad-hoc -s - will NOT work — restricted entitlements cause the binary to be killed on launch):
    codesign --force --options runtime \
        --entitlements bundle/arcbox.entitlements \
        -s "Developer ID Application: ArcBox, Inc. (422ACSY6Y5)" \
        target/debug/arcbox-daemon
  • Requires Developer ID certificate (.p12) + provisioning profile (.provisionprofile). See CONTRIBUTING.md "Code Signing" section for setup.
  • Requires Xcode Command Line Tools
  • Some tasks require a running daemon. Start it in a background terminal: abctl daemon start
  • Keep git worktrees outside the checkout. A worktree nested inside it (e.g. .claude/worktrees/) makes cargo merge both .cargo/config.toml files, and the duplicated -Wl,-rpath,/usr/lib/swift makes dyld refuse every host build script and test binary (duplicate LC_RPATH). If one must be nested, build from outside the tree with --manifest-path <wt>/Cargo.toml --config <wt>/.cargo/config.toml.

Guest Agent Cross-Compilation

The arcbox-agent crate runs inside Linux guest VMs and must be cross-compiled:

brew install FiloSottile/musl-cross/musl-cross
rustup target add aarch64-unknown-linux-musl
cargo build -p arcbox-agent --target aarch64-unknown-linux-musl --release

Platform-Specific Pitfalls

  • libc mode_t: u16 on macOS, u32 on Linux. Always use u32::from(libc::S_IFMT) for cross-platform code.
  • xattr API: Parameter order differs between macOS and Linux. Implement separately with #[cfg(target_os)].
  • fallocate: Not available on macOS. Use ftruncate as fallback.
  • VirtIO batching: Not batching virtqueue pop/push causes excessive VM exits.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.