cd /news/ai-agents/portable-context-does-not-mean-porta… · home topics ai-agents article
[ARTICLE · art-83683] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Portable Context Does Not Mean Portable Runtimes

APC and APX, two components of a portable agent project, separate portable context from runtime availability. APC stores project contracts in the repository, while APX detects local runtimes via `apx env detect` before execution, ensuring portability does not assume identical runtimes across machines.

read3 min views1 publishedAug 2, 2026

A portable agent project should not pretend every machine can run the same AI CLI.

That is the distinction APC and APX get right when used together.

APC is the portable context layer. It keeps the project contract in the repository: AGENTS.md

, .apc/agents

, .apc/project.json

, skills, commands, and MCP hints. Clone the repo somewhere else and that meaning can travel with it.

APX is the daily-use runtime and tooling layer. It makes that context runnable through a local daemon, CLI, web admin, and bridges to external coding CLIs such as Claude Code, Codex, OpenCode, Aider, Cursor Agent, Gemini CLI, and Qwen Code.

But those runtimes are not part of APC.

That matters because a repo can be portable while the machine is not.

One laptop may have codex

and claude

installed. Another may only have gemini

and ollama

. A CI runner may have none of them. If a system treats runtime availability as if it were durable project context, it starts lying. The repo says one thing, the host can do another, and now every handoff becomes fragile.

APX avoids that by making runtime detection a local operation.

The APX runtime docs are explicit: before picking a runtime, run:

apx env detect

That command reports which runtime CLIs, engines, and tools are actually available on the current machine. In other words, APC defines the project, but APX checks the ground truth before execution.

That is a better boundary than storing runtime assumptions in the repo.

A practical flow looks like this:

apx env detect
apx run reviewer --runtime codex "Review the diff in src/ for regressions"

If codex

is installed, APX can spawn it. If it is not installed, the runtime is missing on that host, regardless of how cleanly the APC files travel.

This is also why APX separates apx run

from apx exec

.

apx run

delegates to an external runtime binary. APX builds the system prompt, spawns the CLI, captures the output, and stores a session record. The external tool performs the actual model interaction and shell work.

apx exec

, by contrast, stays inside APX and calls a configured engine directly. Different path, different dependency surface, same APC project context.

That split is useful because it keeps portability honest.

You can move the same APC project between machines without editing the repository. Then APX can answer a local question:

Those are runtime questions, not project-contract questions.

The APX introduction docs make the broader design even clearer: the filesystem is the source of truth for durable project meaning, while sessions, conversations, messages, caches, and other runtime state live under ~/.apx/

and never belong in the repo. Runtime availability follows that same philosophy. Installed binaries and local engine setup are machine facts.

So the practical rule is simple:

That makes APC more trustworthy, not less. The project contract stays small and durable. APX handles the messy part: local capability, runtime invocation, and session tracking.

Portable context is valuable because it avoids vendor lock-in and repeated setup. But portability only works when it stops at the right boundary.

The project can travel.

The runtime must still be checked.

That is why apx env detect

is not a convenience feature. It is the operational guardrail that keeps APC portable and APX honest.

── more in #ai-agents 4 stories · sorted by recency
── more on @apc 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/portable-context-doe…] indexed:0 read:3min 2026-08-02 ·