Modern AI models can operate autonomously for hours or days, but developers need the ability to check in on their work from any device or application. The problem: agent sessions were previously confined to individual tools. GitHub and VS Code have addressed this by building the Agent Host Protocol (AHP), an open standard that keeps agent sessions accessible whether you're working in an editor, a terminal, a mobile app, or custom tooling.
Why single-client integrations became a bottleneck
When GitHub Copilot first launched in VS Code as an extension, agents lived within that single window. Closing the editor meant losing the session. Updating VS Code would restart the extension and terminate running agents. Connecting to a remote machine created an entirely separate extension host. Meanwhile, GitHub was building the Copilot app and mobile clients for iOS and Android, each with its own distinct integration to cloud-based agents.
Each product solved the problem for itself, but developers wanted to pull agents into their own workflows—whether custom editors, terminals, phones, or proprietary tools. This fragmentation meant every client needed a one-off integration. A shared protocol became essential: a standard, independently versioned language that would work across VS Code versions, the GitHub Copilot app, mobile platforms, and any other client. This approach ensures every client sees the same agents, history, and state without bespoke engineering.
Building a protocol that stays out of the way
The protocol had to permit multiple clients to interact with the same agents seamlessly. Starting a session on your phone and continuing it on a laptop. Tolerating network interruptions, reconnections, and concurrent changes across clients. Remaining full-featured enough for real work from each surface.
Equally important: the protocol needed to avoid encoding how agents actually behave. Unlike the Language Server Protocol or Debug Adapter Protocol, the agent landscape evolves rapidly. AHP sidesteps prescribing agent behavior and instead focuses on how users interact with them. The design also prioritizes simplicity for implementers building their own clients or servers.
The result centers on URI-identified "channels"—the coarsest unit of functionality. Every server must implement root, session, and chat channels, but can optionally add terminal support, MCP extensions, or OpenTelemetry reporting. Within each channel sits a reducer-based state object that drives most client logic. The server arbitrates state; clients send action sequences that either mutate state or trigger side effects like sending a message.
This architecture brings practical benefits. Reconnection and replay during poor network conditions become straightforward: a client queues actions, shows appropriate loading states, and waits for server reconciliation before confirming. Debugging clients and servers is direct. Reducer-based state also integrates naturally with UI frameworks like React.
Shipping with five clients and two independent hosts
Adopting AHP in VS Code required building a new harness and agentic stack from scratch. The Copilot Chat extension, which had grown over three years to more than 400,000 lines of TypeScript (excluding tests), was structured around VS Code window lifecycle and dependent on VS Code extension APIs. Neither would be available in a standalone agent host process.
When AHP development began in early 2026, the Copilot SDK was also under development, making it a natural foundation for the new stack. Building a basic harness that edits files proved quick—the team used the agent host to develop itself within weeks—but covering the long tail of features developers expected from Copilot Chat required sustained effort.

GitHub had operated cloud agents for a couple of years, letting developers run tasks in the cloud from any device. As VS Code quietly developed AHP, GitHub sought to expand that capability to coordinate sessions across personal devices via the Copilot app and cloud sandboxes. This N:M coordination problem was precisely what AHP was designed to solve, so adopting the same technology made immediate sense.
VS Code and GitHub built separate implementations with different requirements. VS Code runs the host locally and can drop it onto other compute via SSH, containers, WSL, or Dev Tunnels—it ships as part of VS Code Server. The GitHub Agent Host runs in the cloud across diverse infrastructure, environments, and security constraints. This led to two implementations in different languages: VS Code's in TypeScript and GitHub's in Rust.
Having two independent implementations proved valuable as a protocol stress test. After several months of parallel development, the teams inventoried how each had extended the protocol. Some extensions reasonably remained GitHub-specific, such as metadata linking to project boards. Other variance revealed protocol gaps—early versions could not accurately represent shell tool output lacking PTY backing. Some represented incorrect assumptions, like VS Code's client expecting particular session URI structures. A protocol with only one implementation lacks true portability; as clients and servers learned to talk across implementations, AHP became portable in practice, not just theory.

Using the Agent Host Protocol
AHP was engineered for ease of implementation. Libraries exist in Rust, TypeScript, Kotlin, Swift, .NET, and Go. Developers have built everything from macropad state reflectors to smart watch apps to Kanban task management tools against the protocol. Whether creating a companion app for personal agents, integrating agent sessions into team tools, or adding AHP support to a custom editor, the protocol remains open for extension.
To connect to an agent host in the Copilot app, enable Experimental > Direct Connections, then navigate to Environments > Add Agent Host Protocol Host. In VS Code, use Add Remote Agent Host in the Agents window. Spawn a standalone VS Code agent host by running code agent host in your terminal, or view editor endpoints with code agent endpoints. Samples are available to help developers and agents get started.
The Agent Host Protocol is an open standard. Questions and suggestions are welcome on GitHub.