agentleFS
MicrosoftKnown publishermicrosoft/intelligent-terminal/tools/wta/AGENTS.md

intelligent-terminal / wta

AGENTS.md2k starsChanged 4 months agoMITView on GitHub

These rules apply to tools/wta/. The repo-level AGENTS.md is the canonical source for build, deployment, supported providers, runtime paths, and log names. Do not duplicate those facts here. WTA is a Rust binary with three launch modes: - Master (--master <pipe>): owns a pool of agent CLI subprocesses and their ACP stdio connections, accepts helper named-pipe connections, and routes each ACP SessionId to its owning helper. Helpers with the same master-derived agent key share a process. Installed, policy-allowed native host…

Trending

Quiet since September.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 3 mentionsAug 2026: 2 mentionsSep 2026: 3 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/intelligent-terminal repository that our weekly crawl found: only 10 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about microsoft/intelligent-terminal

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

See all 10

Talked about on GitHub and Bluesky (10 times).

On GitHub · 9

4 more on GitHub

The file

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

12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Do not duplicate those facts here.

    line 5
  2. Very specific:

    Treat the bearer capability as the session identity.

    line 54
  3. Very specific:

    All Windows Terminal operations use CliChannel, which invokes wtcli.exe.

    line 60
  4. Very specific:

    Do not treat WT_COM_CLSID, pipe-id, or set-env as security boundaries.

    line 68
  5. Very specific:

    Keep routing decisions in the pure session_mgmt::decide_enter_action boundary and side effects in its dispatch callers.

    line 103
  6. Distinctive:

    Run the explicit-target commands in the repo-level AGENTS.md from the repository root.

    line 118
  7. Very specific:

    Run the WTA test suite for every behavior change covered by, or deserving, unit tests.

    line 123
  8. Distinctive:

    Use the smallest relevant test while iterating, then run:

    line 127
  9. Distinctive:

    If live processes lock the output, stop only PIDs whose executable paths exactly match the target being rebuilt.

    line 133
  10. Very specific:

    When Cargo.toml, Cargo features, or Cargo.lock changes the shipped dependency graph, regenerate and commit both tools/wta/cgmanifest.json …

    line 143
  11. Very specific:

    Use structured tracing fields and stable targets.

    line 158
  12. Distinctive:

    Add tests around reducers, routing decisions, protocol translation, and parsing rather than testing private implementation details.

    line 163

≈ “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

WTA development

These rules apply to tools/wta/. The repo-level AGENTS.md is the canonical source for build, deployment, supported providers, runtime paths, and log names. Do not duplicate those facts here.

Roles and ownership

WTA is a Rust binary with three launch modes:

  • Master (--master <pipe>): owns a pool of agent CLI subprocesses and their ACP stdio connections, accepts helper named-pipe connections, and routes each ACP SessionId to its owning helper. Helpers with the same master-derived agent key share a process. Installed, policy-allowed native host agents other than Gemini initialize in the background at startup and remain resident. Gemini is excluded from automatic sidebar discovery; explicit Gemini and other selections initialize on demand. Implementation: src/master/mod.rs.
  • Helper (--connect-master <pipe>): one ratatui UI per agent pane. It is an ACP client of master and owns pane-local UI state and ShellManager. Implementation: src/helper/mod.rs and src/app.rs.
  • CLI command: one-shot commands such as list-panes, capture-pane, resolve-command, delegate, hooks, and sessions. Dispatch: src/cli/.

Bare wta without a role flag or subcommand is invalid. The session MCP listener is a master-owned service, not a fourth launch mode.

Protocol boundaries

ACP

ACP means Agent Client Protocol and is used on two hops:

  1. Master is the ACP client of the agent CLI over stdio.
  2. Helper is an ACP client of master over the named pipe; master acts as the ACP agent and multiplexes requests.

The owning helper services ACP client requests such as permission and terminal/* operations. Ordinary agent-reported tool calls are display-only: WTA does not own those processes or invent process controls for them.

Session MCP

Master owns one loopback Streamable HTTP listener and publishes an independent server name and bearer capability for each eligible ACP session. WSL sessions use an on-demand distro-local relay to that listener. The endpoint exposes:

  • run_command_in_current_shell
  • create_workspace
  • delegate_task_in_new_workspace
  • request_user_input

Treat the bearer capability as the session identity. Revoke it when the exact agent CLI instance exits. Route requests through session_to_helper; the MCP endpoint must not execute terminal actions.

WT protocol

All Windows Terminal operations use CliChannel, which invokes wtcli.exe; wtcli activates the COM IProtocolServer discovered through WT_COM_CLSID.

  • WTA wrapper: src/shell/wt_channel/cli_channel.rs
  • CLI client: src/tools/wtcli/main.cpp
  • IDL: src/cascadia/TerminalProtocol/TerminalProtocol.idl
  • COM server: src/cascadia/WindowsTerminal/TerminalProtocolComServer.cpp

Do not treat WT_COM_CLSID, pipe-id, or set-env as security boundaries. The human-facing WTA CLI intentionally does not expose direct keystroke injection; internal ShellManager::wt_send_input uses wtcli send-keys.

Agent commands

The Terminal settings layer resolves built-in IDs to ACP command lines. src/cascadia/inc/AcpModelUtils.h is authoritative for those commands and adapter versions; do not copy them into WTA code or documentation.

Custom agents arrive as a resolved --agent command plus their canonical custom:<name> ID. Do not re-parse a known ID from an adapter command when the host supplied --agent-id.

State and routing invariants

  • session_to_helper is the authoritative ACP SessionId routing map.
  • Per-tab state mutations must preserve both tab and window identity.
  • Helper disconnect, agent exit, pane close, and master restart are distinct lifecycle events; do not collapse them into one generic failure.
  • ShellManager owns ACP client terminals. Agent-reported ordinary tool calls remain agent-owned.
  • Command resolution must preserve the active pane's cwd, host PATH, shell, and PowerShell profile behavior. Return exists, not_found, indeterminate, or unsupported precisely.
  • Runtime state and cache paths must go through runtime_paths.rs.

Session management

The registry models activity and liveness separately:

  • Activity: Idle, Working, Attention, or Error
  • Liveness: Live, Ended, or Historical

Agent-pane and shell-pane sessions have different focus/resume behavior. Keep routing decisions in the pure session_mgmt::decide_enter_action boundary and side effects in its dispatch callers.

The picker currently defaults to shell-pane sessions through MVP_SESSIONS_ORIGIN_FILTER; WTA_SESSIONS_SHOW_AGENT_PANE=1 is the debug override. Do not change that product behavior incidentally.

Detailed tracking and resume behavior belongs in:

  • doc/specs/hybrid-agent-session-tracking.md
  • doc/specs/per-cli-history-filtering.md
  • doc/specs/wsl-session-management.md

Build and test

Run the explicit-target commands in the repo-level AGENTS.md from the repository root. Do not alternate between host-target and explicit-target Cargo outputs in one worktree because the package project prefers the explicit-target binary.

Run the WTA test suite for every behavior change covered by, or deserving, unit tests. A successful Cargo build or C++ build does not compile #[cfg(test)] code.

Use the smallest relevant test while iterating, then run:

cargo test --target x86_64-pc-windows-msvc --manifest-path tools/wta/Cargo.toml

If live processes lock the output, stop only PIDs whose executable paths exactly match the target being rebuilt. Do not kill all WTA processes by name.

Dependencies and generated notices

CI resolves the ms-prod-1.93 pin in rust-toolchain.toml through MSRustup. The documented repo-root local commands use the installed active Rust toolchain while still loading the repo's static-CRT target configuration. Keep code compatible with Rust 1.93 and avoid dependencies that do not support static CRT.

When Cargo.toml, Cargo features, or Cargo.lock changes the shipped dependency graph, regenerate and commit both tools/wta/cgmanifest.json and the generated WTA block in /NOTICE.md:

$env:RUSTUP_TOOLCHAIN = 'stable'
pwsh -File .\build\scripts\Generate-WtaThirdPartyNotices.ps1

The generator requires PowerShell 7+. Generated artifacts are not edited by hand.

Rust implementation conventions

  • Localize user-facing strings through t!(...).
  • Use structured tracing fields and stable targets; do not log credentials, bearer capabilities, or full provider configuration.
  • Initialize logging once near process startup and flush it before any std::process::exit.
  • Preserve explicit error context across async/process/protocol boundaries.
  • Add tests around reducers, routing decisions, protocol translation, and parsing rather than testing private implementation details.
  • Format with cargo fmt; address relevant Clippy findings without broad, unrelated cleanup.

See .github/instructions/rust-wta.instructions.md for file-scoped coding rules and tools/wta/README.md for human-facing CLI and diagnostics.

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.