agentleFS
MicrosoftKnown publishermicrosoft/vscode/src/vs/platform/agentHost/common/state/AGENTS.md

vscode / state

AGENTS.md196k starsChanged 17 days agoMITView on GitHub

This directory contains the VS Code-facing wrappers around the Agent Host Protocol (AHP) state model. Read this before modifying protocol types. Before adding or changing protocol constructs or _meta, follow the protocol constructs before _meta rules. Existing protocol constructs must be used instead of metadata where possible; unmet requirements should be raised upstream, and optional metadata must tolerate alternate hosts and UIs that omit or ignore it. The generated protocol includes the Changesets model: The generated copy uses the .ahp-version…

Trending

More talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 1 mentionFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 2 mentionsMay 2026: 4 mentionsJun 2026: 2 mentionsJul 2026: 2 mentionsAug 2026: 0 mentionsSep 2026: 3 mentionsOct 2026: 1 mentionNov 2026: 2 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/vscode repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/vscode

The biggest 5 of 96 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 96

Talked about on Bluesky, Hacker News and GitHub (96 times).

On Bluesky · 48

43 more on Bluesky

On Hacker News · 39

34 more on Hacker News

On GitHub · 9

4 more on GitHub

The file

We split this AGENTS.md into the rules it gives an agent

11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Update the source files in the sibling agent-host-protocol repo.

    line 25
  2. Very specific:

    Run pnpm dlx tsx scripts/sync-agent-host-protocol.ts from the VS Code repo.

    line 26
  3. Distinctive:

    If VS Code consumers need short aliases or type guards, update the wrapper files in this directory after the sync.

    line 27
  4. Distinctive:

    Add the action interface and union membership in the source protocol repo.

    line 48
  5. Very specific:

    Add the action to ACTION_INTRODUCED_IN in protocol/version/registry.ts through the generated sync.

    line 49
  6. Very specific:

    Add the reducer case in the source protocol repo and sync it into protocol/reducers.ts.

    line 50
  7. Very specific:

    Update ../../../protocol.md and any affected AHP docs.

    line 52
  8. Very specific:

    Update the source protocol repo's version registry and sync it into protocol/version/registry.ts.

    line 60
  9. Distinctive:

    Update capability types when the feature needs client-visible capability negotiation.

    line 62
  10. Very specific:

    Update ../../../protocol.md version history and affected AHP docs.

    line 63
  11. Very specific:

    Use the same process as new action types, but register the new notification in NOTIFICATION_INTRODUCED_IN.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Protocol versioning instructions

This directory contains the VS Code-facing wrappers around the Agent Host Protocol (AHP) state model. Read this before modifying protocol types.

Before adding or changing protocol constructs or _meta, follow the protocol constructs before _meta rules. Existing protocol constructs must be used instead of metadata where possible; unmet requirements should be raised upstream, and optional metadata must tolerate alternate hosts and UIs that omit or ignore it.

Overview

  • sessionState.ts, sessionActions.ts, sessionReducers.ts, and sessionProtocol.ts are VS Code-facing wrappers and re-exports.
  • protocol/** is generated from the sibling agent-host-protocol repo by scripts/sync-agent-host-protocol.ts. Generated files carry a DO NOT EDIT banner; update the source protocol repo and sync the copy into VS Code.
  • protocol/version/registry.ts contains PROTOCOL_VERSION, ACTION_INTRODUCED_IN, NOTIFICATION_INTRODUCED_IN, and version helper functions. There is no versions/ directory in this tree.

Current changeset surface

The generated protocol includes the Changesets model:

  • SessionSummary.changesets is the lightweight catalogue shown in lists.
  • The old session/diffsChanged shape is replaced by five changeset/* actions: statusChanged, fileSet, fileRemoved, operationsChanged, and cleared.
  • invokeChangesetOperation lets clients invoke server-defined verbs against a changeset. The wire command and dispatch path exist even when no concrete operations are advertised yet.
  • Changeset actions are scoped to an expanded changeset URI (<sessionUri>/changeset/<id>); see ../changesetUri.ts for the build/parse helpers.
  • Session teardown uses changeset/cleared plus the corresponding session-level lifecycle notification. There is no separate changeset/disposed action in the VS Code protocol copy.

Updating generated protocol types

  1. Update the source files in the sibling agent-host-protocol repo.
  2. Run pnpm dlx tsx scripts/sync-agent-host-protocol.ts from the VS Code repo.
  3. If VS Code consumers need short aliases or type guards, update the wrapper files in this directory after the sync.
  4. Compile. The generated registry catches missing action/notification version map entries.

Current targeted backports

The generated copy uses the .ahp-version source commit 1928cd4e plus one targeted source backport: optional AuthenticateParams.idToken. The field matches the merged microsoft/agent-host-protocol#631 at c6388ccce7c78066f8f9982fcaef0e62bd20bd01. Preserve this delta when syncing until the recorded pin includes it. The older CreateChatParams.title, deprecated SessionChatSummary.archived, and ChatIsReadChanged compatibility deltas are already present in this pin.

For a narrow sync, set AHP_PROTOCOL_REPO to an isolated protocol source worktree at the recorded pin with those source backports applied, then run the normal sync script. Do not copy unrelated upstream changes or edit generated files to recover the existing deltas.

Initial-message transport delta

Host-facing IAgentCreateChatRequestOptions.initialMessage uses the existing CreateChatParams.initialMessage field and is deliberately not part of provider creation options: the host creates the provider chat first, then processes the message through its normal client-aware admission path. Message failures appear in the target chat's turn state rather than a special creation RPC error. Protocol clients serialize a supplied initial message unchanged except that a missing message model or agent inherits the corresponding request option. Do not add top-level model or agent fields to CreateChatParams.

Adding optional fields to existing types

Optional protocol fields are usually backwards-compatible. Add the field in the source protocol repo, sync protocol/**, and add wrapper exports only when VS Code code needs them.

Adding new action types

Adding a new server-produced action type is backwards-compatible when old clients can ignore it safely. Old clients at the same protocol version ignore unknown action types by leaving reducer state unchanged.

  1. Add the action interface and union membership in the source protocol repo.
  2. Add the action to ACTION_INTRODUCED_IN in protocol/version/registry.ts through the generated sync.
  3. Add the reducer case in the source protocol repo and sync it into protocol/reducers.ts.
  4. Re-export the new action from sessionActions.ts when VS Code callers need the type directly.
  5. Update ../../../protocol.md and any affected AHP docs.

When to bump the protocol version

Bump PROTOCOL_VERSION in protocol/version/registry.ts when you need a capability boundary; for example, when a client must know whether the server supports a feature before sending a command or rendering UI.

When bumping:

  1. Update the source protocol repo's version registry and sync it into protocol/version/registry.ts.
  2. Assign new action and notification types to the new version in ACTION_INTRODUCED_IN or NOTIFICATION_INTRODUCED_IN.
  3. Update capability types when the feature needs client-visible capability negotiation.
  4. Update ../../../protocol.md version history and affected AHP docs.

Adding new notification types

Use the same process as new action types, but register the new notification in NOTIFICATION_INTRODUCED_IN.

What the compiler catches

MistakeCompile error
Add action to union, forget ACTION_INTRODUCED_IN entryMapped type index is incomplete
Add notification to union, forget NOTIFICATION_INTRODUCED_IN entryMapped type index is incomplete
Remove action or notification type that the registry still referencesRegistry key no longer exists

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.