/hosted-agents:hosted-agentsfrom hosted-agents
Guides building and deploying hosted background coding agents with sandboxed VM execution, multiplayer sessions, and multi-client interfaces. Covers image registries, warm pools, self-spawning sub-agents, and Slack/web/Chrome integrations.
Ships in hosted-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Hosted agents run in remote sandboxed environments rather than on local machines. When designed well, they provide unlimited concurrency, consistent execution environments, and multiplayer collaboration. The critical insight is that session speed should be limited only by model provider time-to-first-token, with all infrastructure setup completed before the user starts their session.
What are you building?
│
├─ Agent runs remotely in sandboxed environment
│ ├─ Need pre-built environment images? → Image Registry Pattern
│ ├─ Need instant session start? → Warm Pool + Predictive Warm-Up
│ └─ Need multiple users in same session? → Multiplayer Support
│
├─ Agent needs to spawn sub-agents
│ ├─ Sub-agents work on same repo? → Self-Spawning with shared state
│ └─ Sub-agents work across repos? → Self-Spawning with API coordination
│
├─ Need multiple client interfaces
│ ├─ Internal team adoption priority? → Slack Integration
│ ├─ Need visual verification? → Web Interface with VS Code
│ └─ Non-engineering users? → Chrome Extension
│
└─ Not sure if hosted or local
├─ Need unlimited concurrency? → Hosted
├─ Need reproducible environments? → Hosted
└─ Single user, local dev only? → Local agent (not this skill)
Hosted agents address the fundamental limitation of local agent execution: resource contention, environment inconsistency, and single-user constraints. By moving agent execution to remote sandboxed environments, teams gain unlimited concurrency, reproducible environments, and collaborative workflows.
The architecture consists of three layers: sandbox infrastructure for isolated execution, API layer for state management and client coordination, and client interfaces for user interaction across platforms. Each layer has specific design requirements that enable the system to scale.
The Core Challenge Spinning up full development environments quickly is the primary technical challenge. Users expect near-instant session starts, but development environments require cloning repositories, installing dependencies, and running build steps.
Image Registry Pattern Pre-build environment images on a regular cadence (every 30 minutes works well). Each image contains:
When starting a session, spin up a sandbox from the most recent image. The repository is at most 30 minutes out of date, making synchronization with the latest code much faster.
Snapshot and Restore Take filesystem snapshots at key points:
This enables instant restoration for follow-up prompts without re-running setup.
Git Configuration for Background Agents Since git operations are not tied to a specific user during image builds:
user.name and user.email when committing and pushing changesWarm Pool Strategy Maintain a pool of pre-warmed sandboxes for high-volume repositories:
Server-First Architecture Choose an agent framework structured as a server first, with TUI and desktop apps as clients. This enables:
Code as Source of Truth Select frameworks where the agent can read its own source code to understand behavior. This is underrated in AI development: having the code as source of truth prevents hallucination about the agent's own capabilities.
Plugin System Requirements The framework should support plugins that:
tool.execute.before)Predictive Warm-Up Start warming the sandbox as soon as a user begins typing their prompt:
Parallel File Reading Allow the agent to start reading files immediately, even if sync from latest base branch is not complete:
Maximize Build-Time Work Move everything possible to the image build step:
Agent-Spawned Sessions Create tools that allow agents to spawn new sessions:
Frontier models are capable of containing themselves. The tools should:
Prompt Engineering for Self-Spawning Engineer prompts to guide when agents spawn sub-sessions:
Per-Session State Isolation Each session requires its own isolated state storage:
Real-Time Streaming Agent work involves high-frequency updates:
WebSocket connections with hibernation APIs reduce compute costs during idle periods while maintaining open connections.
Synchronization Across Clients Build a single state system that synchronizes across:
All changes sync to the session state, enabling seamless client switching.
Why Multiplayer Matters Multiplayer enables:
Implementation Requirements
With proper synchronization architecture, multiplayer support is nearly free to add.
User-Based Commits Use GitHub authentication to:
Sandbox-to-API Flow
Slack Integration The most effective distribution channel for internal adoption:
Build a classifier to determine which repository to work in:
Web Interface Core features:
Statistics page showing:
Chrome Extension For non-engineering users:
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Building images on-demand per session | Users wait minutes for environment setup | Use Image Registry Pattern with 30-min cadence pre-builds |
| Blocking file reads until git sync completes | Agent idles while user waits | Allow reads immediately; block only writes until sync finishes |
| Tying sessions to a single author in the data model | Multiplayer becomes impossible | Design authorship as per-prompt metadata, not session-level |
| Attributing commits to the app identity | Audit trail breaks; users see bot commits | Use the prompting user's GitHub identity for all commits |
| Warming sandboxes only on session request | Cold start latency kills adoption | Start warming when user begins typing (predictive warm-up) |
| Supervisor paraphrasing sub-agent responses | "Telephone game" loses fidelity | Implement forward_message tool for direct pass-through |
| Tracking sessions or PRs created as the success metric | Volume doesn't equal value | Track merged PRs as the primary metric |
| Storing all sessions in a shared database | Cross-session interference and contention | Use per-session isolated storage (e.g., SQLite per session) |
| Skipping WebSocket hibernation | Idle connections waste compute | Use hibernation APIs to reduce costs during idle periods |
Decide how to handle messages sent during execution:
Queueing is simpler to manage and lets users send thoughts on next steps while agent works. Build mechanism to stop agent mid-execution when needed.
Track metrics that indicate real value:
Internal adoption patterns that work:
This skill builds on multi-agent-patterns for agent coordination and tool-design for agent-tool interfaces. It connects to:
Internal reference:
Related skills in this collection:
External resources:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub viktorbezdek/skillstack --plugin hosted-agentsOther plugins' skills for the same job