---
title: "Building the Agent Host Protocol for sessions that continue across devices"
description: "The Agent Host Protocol (AHP) is an open standard that lets multiple clients (VS Code, the Copilot app, mobile apps, custom tools) share the same long-running agent sessions, so work started on one device can continue on another."
url: "https://swe.quest/articles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices-588952b6d83cc2ec"
canonical: "https://github.blog/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices/"
source: "GitHub Engineering"
published: "2026-11-17"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["ai-agents","api-design","ai-coding","distributed-systems","developer-tools"]
---

# Building the Agent Host Protocol for sessions that continue across devices

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2026-11-17, 7 min read, Case study. Original: [https://github.blog/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices/](https://github.blog/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices/)

## Summary

The Agent Host Protocol (AHP) is an open standard that lets multiple clients (VS Code, the Copilot app, mobile apps, custom tools) share the same long-running agent sessions, so work started on one device can continue on another. It is organized around URI-identified channels (required root, session and chat channels, plus optional terminal, MCP and telemetry channels), each holding server-arbitrated reducer-based state that clients mutate by dispatching actions. This makes reconnection and replay over flaky networks straightforward and fits UI frameworks like React. Two independent hosts, VS Code's in TypeScript and GitHub's in Rust, exposed protocol gaps such as non-PTY shell output and client assumptions about session URI structure, and libraries now exist in six languages.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- AI coding agents ([easy posts on AI for coding](https://swe.quest/tags/ai-coding.md?difficulty=easy))
- client-server protocols
- reducer-based state management ([easy posts on Engineering management](https://swe.quest/tags/engineering-management.md?difficulty=easy))

## Keywords

Agent Host Protocol, GitHub Copilot, VS Code, Copilot SDK, MCP, Language Server Protocol

## Related posts

- [Unlocking the Codex harness: how we built the App Server](https://swe.quest/articles/unlocking-the-codex-harness-how-we-built-the-app-server-3ac987fd7baeae92.md): OpenAI · 2026-02-04 · Medium · 14 min read · AI agents, API design, AI for coding, System design
  The Codex App Server is a bidirectional JSON-RPC protocol over stdio (JSONL), plus a long-lived process that hosts Codex core threads.
- [Scaling Managed Agents with stable interfaces](https://swe.quest/articles/scaling-managed-agents-with-stable-interfaces-06b4cb4f85923c79.md): Anthropic Engineering · 2026-04-08 · Medium · 9 min read · AI agents, System design, Sandboxing & isolation, Resilience, LLMs
  Claude Managed Agents splits a long-running agent into three virtualized interfaces: an append-only session log, a stateless harness that calls Claude and routes tool calls, and sandboxes reached through a generic \`execute(name, input) → string\` tool call.
- [Designing the hf CLI as an agent-optimized way to work with the Hub](https://swe.quest/articles/designing-the-hf-cli-as-an-agent-optimized-way-to-work-with-the-hub-e1ef73909553085b.md): Hugging Face · 2026-06-04 · Medium · 14 min read · Developer tools, AI agents, AI for coding, Evaluation
  Hugging Face rebuilt its hf CLI to serve both humans and coding agents.
- [Claude Code in the cloud: a field guide to cloud sessions](https://swe.quest/articles/claude-code-in-the-cloud-a-field-guide-to-cloud-sessions-77547c26ca9824eb.md): claude.dev · 2026-10-06 · Medium · 22 min read · AI for coding, AI agents, Developer tools, Sandboxing & isolation
  Claude Code cloud sessions run each task in a fresh VM with the repository cloned onto its own branch, so several agents can work on one repo in parallel without sharing files, ports, or the developer's credentials.
- [The New MCP Roadmap](https://swe.quest/articles/the-new-mcp-roadmap-4077f4d0443ba601.md): Model Context Protocol · 2026-08-22 · Easy · 6 min read · AI agents, API design, Identity & auth
  The updated Model Context Protocol roadmap sets five priority areas for upcoming specification releases: agentic messaging primitives (server-initiated events, maturing the Tasks extension), HTTP-native transport unification including Streamable HTTP over stdio, agent identity and enterprise security via DPoP, Workload Identity Federation and token exchange, improved primitives with a single tools/call result contract and progressive tool discovery, and better SDK ergonomics.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
