---
title: "Building the Agent Host Protocol for sessions that continue across devices"
description: "The Agent Host Protocol (AHP) is an open, independently versioned standard that lets VS Code, the GitHub Copilot app, mobile apps and third-party clients share the same long-running agent sessions, history and state."
url: "https://swe.quest/articles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices-5d4cd3f360a7da03"
canonical: "https://blog.github.com/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","realtime","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://blog.github.com/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices/](https://blog.github.com/engineering/engineering-principles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices/)

## Summary

The Agent Host Protocol (AHP) is an open, independently versioned standard that lets VS Code, the GitHub Copilot app, mobile apps and third-party clients share the same long-running agent sessions, history and state. It is organized around URI-identified channels (required root, session and chat, plus optional terminal, MCP and telemetry). Each channel holds reducer-based state that the server arbitrates, and clients dispatch actions, which makes reconnection, replay and debugging straightforward. Two independent hosts, VS Code's in TypeScript and GitHub's in Rust, served as an acid test for portability, exposing protocol gaps such as non-PTY shell output and bad client assumptions about session URI structure. Libraries exist in six languages for building your own clients or hosts.

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)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [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))
- reducer-based state management ([easy posts on Engineering management](https://swe.quest/tags/engineering-management.md?difficulty=easy))
- client-server protocols

## Keywords

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

## Related posts

- [Building the Agent Host Protocol for sessions that continue across devices](https://swe.quest/articles/building-the-agent-host-protocol-for-sessions-that-continue-across-devices-588952b6d83cc2ec.md): GitHub Engineering · 2026-11-17 · Medium · 7 min read · AI agents, API design, AI for coding, Distributed systems, Developer tools
  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.
- [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.
- [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.
- [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.
- [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.

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)
