New to Claude Skills? Learn how to install them →

microsoft on GitHub

Agent Host Debug Logs

OfficialFree

Analyze Agent Host debug logs for deeper insights.

by microsoft188.6k stars on microsoft/vscode
3 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Agent Host Debug Logs does

The Agent Host Debug Logs skill is designed for developers and engineers who need to analyze debug log exports from the Agent Host environment. This skill is particularly useful when working with bundles generated by the 'Export Agent Host Debug Logs...' command in Visual Studio Code. The logs can contain sensitive information, including tokens and user prompts, so it's important to handle them with care. This skill allows users to extract and analyze log files effectively while ensuring that sensitive data remains secure.

When you receive a bundle, it may be in the form of a zip file or an unpacked folder. The skill provides a Python script to extract the contents of zip files, making it easy to access the logs. The files included in the bundle can vary, but they typically contain important logs such as events.jsonl, usage.jsonl, and various .log files that capture the behavior of the Agent Host and the Copilot SDK. Each file serves a specific purpose, allowing users to track events, monitor usage, and diagnose issues.

To get started, users should familiarize themselves with the contents of the bundle and the significance of each log file. The skill guides users through the process of identifying symptoms and correlating them with the appropriate log files. This structured approach helps streamline the debugging process, making it easier to pinpoint issues related to client-server interactions, token usage, and SDK behavior. By leveraging this skill, developers can gain valuable insights into their Agent Host environment and improve their debugging efficiency.

Overall, the Agent Host Debug Logs skill is an essential tool for anyone working with the Agent Host environment, providing a systematic way to analyze debug logs and enhance the development workflow.

When to use it

Use this skill when you need to analyze debug log exports from the Agent Host environment for troubleshooting or performance monitoring.

When not to use it

This skill is not suitable for general log analysis outside the Agent Host context or for users unfamiliar with log file structures.

What you can build with it

Debugging a Session Issue

When a user reports issues during a session, use the skill to analyze the relevant logs and identify the root cause.

Monitoring Token Usage

Analyze the usage.jsonl file to track token usage and costs associated with model calls for better resource management.

Investigating SDK Behavior

Use the copilot-logs to understand the behavior of the Copilot SDK during specific interactions and troubleshoot accordingly.

How to install Agent Host Debug Logs

View source

1. Install with the skills CLI

npx skills add microsoft/vscode/agent-host-logs --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by microsoft

Agent Host Debug Logs

Use this skill to orient to bundles produced by Developer: Export Agent Host Debug Logs.... These are different from the normal timestamped Code OSS log directory.

Treat the bundle as sensitive: it can contain tokens, prompts, file contents, terminal output, paths, and settings. Keep analysis local and avoid quoting secrets or unrelated user content. Timestamps, event names, IDs, status values, and general property values are fine.

Open the Bundle

The export name usually starts with ah-logs and may be a zip or an already-unpacked folder. For a zip, use the bundled extractor:

python3 .github/skills/agent-host-logs/scripts/extract.py "<archive>.zip"

The final line gives the temporary extraction path. Work from that folder and delete only that exact folder when finished.

Files are collected best-effort, so a valid bundle may contain only some of these:

events.jsonl
usage.jsonl
customizations.json
Agent Host.log
Window.log
Shared.log
ahp/*.jsonl
copilot-logs/*.log
remote-agenthost.log

What the Files Mean

The basic flow is:

Window/client <-> AHP <-> Agent Host process <-> Copilot SDK
PathWhat it shows
events.jsonlPersisted Copilot SDK events for the selected session: turns, messages, tools, permissions, hooks, skills, and subagents. It can cover a much longer period than the other logs.
usage.jsonlClient-captured token/credit usage, one record per model call (turnId, model, input/output/cache tokens, cumulative totalNanoAiu). The SDK's assistant.usage event is ephemeral and never reaches events.jsonl, so this is the only per-call usage record. Present only when agent-host debug logging was on.
customizations.jsonSnapshot of the skills/hooks/agents/MCP servers loaded for the session. The SDK's session.*_loaded events are ephemeral, so this is the only record of what was actually active. Present only when agent-host debug logging was on.
ahp/*.jsonlAHP traffic for a client connection. _ahpLog.dir is c2s or s2c; _ahpLog.ts is the wire timestamp. Use this to see requests, responses, subscriptions, actions, notifications, and client-visible ordering.
Agent Host.logLocal Agent Host process behavior: startup, auth, sessions, provider events, tools, Git/worktrees, and host-side errors.
copilot-logs/*.logCopilot SDK process logs that mention the selected session ID. A process log may contain other sessions too.
Window.logRenderer/client behavior: connections, session adapters, UI state, permissions, rendering, and client-side errors.
Shared.logShared-process activity. Usually secondary evidence and often noisy.
Agent Host (<name>).logForwarded logs from a named remote Agent Host.
remote-agenthost.logA directly downloaded remote agenthost.log, when available.

How to Start

  1. List the files and note their sizes.
  2. Identify the reported symptom, approximate time, local or remote host, and any known session, chat, turn, request, or tool ID.
  3. Start with the file closest to the symptom:
    • Turn or provider behavior: events.jsonl
    • Token/credit usage or cost questions: usage.jsonl
    • Client/server state or ordering: ahp/*.jsonl
    • Host implementation failure: Agent Host.log
    • SDK behavior: copilot-logs/*.log
    • UI behavior: Window.log
  4. Search by the known time or ID, then follow the same operation into the adjacent layer.

Useful correlation fields include the raw session ID, session/chat URI, turnId, interactionId, tool/request IDs, JSON-RPC request id, AHP serverSeq, and event id/parentId.

Important Tips

  • events.jsonl, Copilot SDK logs, and AHP timestamps are normally UTC. The plain .log files may use local machine time; remote logs may use another timezone.
  • An AHP log is connection-scoped and can contain multiple sessions. A Copilot SDK process log can also contain multiple sessions.
  • AHP files rotate as .jsonl, .1.jsonl, .2.jsonl, and so on. Use _ahpLog.ts to reconstruct order.
  • A subscribe result can contain a full snapshot; its contents did not necessarily change at subscription time.
  • _ahpLog.truncated: true means large values were omitted from that log record.
  • Warning or error severity alone does not prove causality. Look for the matching failed response, missing completion, or user-visible consequence.
  • Missing files are normal because export collection is best-effort.

Frequently asked questions about Agent Host Debug Logs

Similar skills