yonso-claude-vscode
AGENTS.md0 starsChanged 3 months agoMITView on GitHub
This file is the canonical project context for coding agents working in this directory. Read it before changing the extension. CLAUDE.md imports this file so Claude Code and tools that support AGENTS.md receive the same instructions. Yonso VScode Claudes (display name; the internal id deliberately stays ai-agent-manager so installs update in place and persisted state survives — never change name/publisher) is a strict-mode TypeScript VS Code extension that presents Claude Code terminals as named, persistent agents. It supplements VS Code's…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 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.
6
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
- Very specific: line 22
Keep one flat, WhatsApp-style agent list.
- Distinctive: line 25
No search bar in the sidebar (removed 2026-08-06 at the user's request, along with the filter toolbar buttons and the orphaned fuzzy …
- Distinctive: line 27
Use the active project's workspace folder as the new agent's working directory.
- Very specific: line 34
No unread counter is displayed anywhere: neither a number badge on the Activity Bar icon (do not set WebviewView.badge) nor a pill on list …
- Very specific: line 37
Use the pixel Clawd character in media/clawd.svg, not a robot, initials, or the Anthropic starburst.
- Very specific: line 50
Keep provider-specific behavior out of the view.
- Very specific: line 51
Never scrape terminal buffers or patch a user's Claude configuration.
- Very specific: line 79
Use npm ci, not a copied node_modules directory, to reproduce the dependencies locked in package-lock.json.
- Distinctive: line 81
Run this before handing off a code change:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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.
Files
Yonso VScode Claudes — Agent Handoff
This file is the canonical project context for coding agents working in this directory. Read it before changing the extension. CLAUDE.md imports this file so Claude Code and tools that support AGENTS.md receive the same instructions.
Project
Yonso VScode Claudes (display name; the internal id deliberately stays ai-agent-manager so installs update in place and persisted state survives — never change name/publisher) is a strict-mode TypeScript VS Code extension that presents Claude Code terminals as named, persistent agents. It supplements VS Code's integrated terminal; it does not replace it.
- Current extension version:
0.9.0 - VS Code engine:
^1.93.0 - Entry point:
src/extension.ts - Production bundle:
dist/extension.js - Tests: Vitest files under
test/ - Package manager: npm; keep
package-lock.jsonin sync
This project is a standalone Git repository. Do not stage, commit, or push unless the user explicitly asks.
Product decisions to preserve
These are deliberate UX decisions made with the user. Do not reverse them without an explicit request.
- Keep one flat, WhatsApp-style agent list. Do not restore groups, a native Agent Outline, or a redundant
AGENTSsection label. - The sidebar header must read
AI AGENTSwith no colon: the view'snameinpackage.jsonmust equal the container title exactly, and nothing may assignwebviewView.titleat runtime. Any mismatch (the pre-0.6.0 state used a no-break-space name) makes VS Code render the merged single-view header asAI AGENTS: <name>(2026-08-06). - The view title bar holds exactly one button:
+New Agent. The Switch Agent and Refresh toolbar buttons were removed 2026-08-06 at the user's request; both commands stay available from the Command Palette. Do not add title-bar buttons back. - No search bar in the sidebar (removed 2026-08-06 at the user's request, along with the filter toolbar buttons and the orphaned fuzzy utility). The Switch Agent quick pick is the keyboard path to an agent.
- Creating an agent is one click: launch Claude Code immediately, with no provider, name, command, group, or working-directory questions.
- Use the active project's workspace folder as the new agent's working directory.
Ctrl+Shift+Ccreates an agent and always ends with a maximized Terminal panel. It must never toggle an already-maximized panel back to its normal size; the keybinding is split on thepanelMaximizedcontext key so the maximized case runs plain New Agent. The sidebar New Agent button creates one without forcing maximization.Ctrl+Tab/Ctrl+Shift+Tabcycle focus through agent terminals in sidebar order, wrapping at the ends (aiAgents.nextAgent/aiAgents.previousAgent), and must work no matter what is focused — including inside a terminal. Chosen by the user 2026-08-06 (superseding, same day, both theCtrl+Alt+]/[brackets and theCtrl+Alt+Tabcombos), deliberately shadowing VS Code's editor-historyCtrl+Tab; do not restore the older bindings.- Terminal-focus reality: keystrokes inside a terminal go to the shell unless the resolved keybinding's command is in
terminal.integrated.commandsToSkipShell, and extensions cannot contribute defaults to that list — this is whyCtrl+Alt+Tabwas dead in terminals.ensureCommandsSkipShell()inextension.tstherefore merges the extension's keybound command ids into the user-level setting on activation (additive, idempotent, never removes entries). Keep that list in sync withcontributes.keybindings. - Close guard (2026-08-06): while any agent terminal exists (even idle) and
aiAgents.confirmWindowCloseis on, theaiAgents.closeGuardActivecontext key reroutes the close-window keyboard paths (Cmd+W/Ctrl+Wwith no editors open,Cmd+Shift+W/Ctrl+Shift+W) toaiAgents.confirmCloseWindowand quit (Cmd+Q,Ctrl+Qnon-Windows) toaiAgents.confirmQuit: a blocking modal names the live agents, cancel is the safe default, confirm runs the stock workbench command. The guard must never fire with no live agents, must not intercept the kill-focused-agentCmd+Wcase, and cannot cover mouse-initiated closes (no extension API). It replaces the pre-0.6.0 per-machine-workbench.action.closeWindowuser-keybinding workaround. Cmd+W(Ctrl+Won Windows/Linux) kills the focused agent (aiAgents.killFocusedAgent) while an agent's terminal has focus — the user explicitly wants it to replace VS Code's default close-a-tab / close-the-window chain there (2026-08-06). The keybinding is scoped byterminalFocus && aiAgents.activeTerminalIsAgent;extension.tsmaintains that context key from active-terminal and agent-list changes. The kill is guarded by an are-you-sure modal naming the agent (user request 2026-08-06, superseding the same-day no-confirmation decision — Cmd+W is close-tab muscle memory and was killing agents by mistake); Cancel/Esc is the safe default, and confirming closes the terminal and removes the record. The sidebar's right-click redKill agentaction stays confirmation-free (a right-click menu choice is already deliberate). Outside agent terminalsCmd+Wmust keep stock VS Code behavior — never widen this binding.- New Claude agents start with auto mode on:
ClaudeProviderappends--permission-mode autoat launch unless the configured command already sets a permission mode or skips permissions. The flag lives in the launch command, not the stored agent command. - No unread counter is displayed anywhere: neither a number badge on the Activity Bar icon (do not set
WebviewView.badge) nor a pill on list rows. The internal unread tracking stays, but nothing renders it. - Popup notifications are off by default (
aiAgents.showNotifications: false, user request 2026-08-06). The sidebar is the status surface; do not add new popups. - The list webview reconciles rows in place, keyed by agent id. Never rebuild the row list on a state update (
replaceChildren+ recreate): streaming agents refresh the list continuously, and a rebuild landing between mousedown and mouseup destroys the pressed row so its click never fires — that regression made opening an agent take several clicks. (The preview subtree is re-rendered only when its text actually changes; that in-place swap is fine.) - Use the pixel Clawd character in
media/clawd.svg, not a robot, initials, or the Anthropic starburst. - Each row shows the name, status, model, 24-hour timestamp, and latest human-visible message preview. Do not show the working directory or the redundant words
Claude Codein the row. - The model chip sits beside the status label as a quiet monospace pill (
Opus 5,Fable 5,Haiku 4.5) and is hidden entirely when no model is known — never show a placeholder there (user request 2026-08-08). It is read from the transcript's assistant rows (message.model), not from the launch command or a config file, because that is the only source that reflects a mid-session/modelswitch. Sidechain (sub-agent) rows and Claude Code's<synthetic>placeholder rows must stay excluded so a helper model never replaces the session's own.formatModelLabel()insrc/util/model.tsowns id → label mapping (currentclaude-opus-5ids, legacyclaude-3-5-sonnet-…, and Bedrock/Vertex decorations); unknown ids degrade to a trimmed id rather than disappearing. - The agent name renders as a terminal-style tag — dark text (
--vscode-terminal-background) on--vscode-terminal-ansiCyan, monospace — matching the session-name statusline tag Claude Code prints in the terminal (user request 2026-08-06). - The latest-message preview spans the row's available width, wraps to at most 15 lines, and stores at most 1,500 characters. It preserves line structure and renders minimal markdown (bold, inline code, code fences, lists, headings, quotes) through DOM-safe
createElement/textContentbuilding only — neverinnerHTML. Slash-command transcript rows (<command-name>…) and hook-injected<system-reminder>content never become previews, and a/clearresets the stored preview. - The preview shows only
runtime.messagePreview. Lifecycle placeholder strings (Output received,Command running,Waiting for input…) must never render in the row — a ready agent with no message shows an empty preview (user request 2026-08-06;runtime.activityis still written and persisted, just not displayed). - Claude usage meters render at the bottom of the sidebar styled like the CLI's
/usagescreen (user request 2026-08-06): per meter a bold title (Current session,Current week (all models),Current week (Fable)…), a periwinkle#b1b9f9bar — the CLI's own bar color, sampled from its output; keep the 70%/90% warn/hot recolors — withN% usedbeside it and a CLI-phrasedResets 6pm (Asia/Jerusalem)line under it. Meters parse the usage payload'slimitsarray first (session/weekly_all/weekly_scopedwithscope.model.display_name, e.g. Fable) because the legacy top-levelseven_day_opus-style buckets are null on current responses — that was exactly the bug that hid the Fable meter; the legacy buckets remain as a fallback for older payloads. Fed byClaudeUsageService, which reads the local Claude Code sign-in read-only and calls the same endpoint the CLI's/usagescreen uses. Credential sources:~/.claude/.credentials.jsonand the macOS Keychain are both read every fetch and tried freshest-first (orderCredentials), with 401/403 falling through to the next token — a stale credentials file beside a live Keychain sign-in was exactly the bug that hid the meters until 0.6.0. When no meters can be fetched the strip shows the reason (Usage unavailable: …) instead of hiding (user request 2026-08-06 — the user may ask to remove that diagnostic line later); onlyaiAgents.showUsage: falsehides the strip entirely. The service must never write, refresh, or log credentials. - The sidebar's bottom holds exactly one button — Resume a closed session — between the agent list and the usage meters (user request 2026-08-08). Pressing it unfolds an in-sidebar list (deliberately not a quick pick, chosen by the user) of this workspace folder's stored Claude sessions, newest first: title, last-active time, model chip, git branch. Clicking one starts a new agent whose command is
claude --resume <id>, which keeps the never-revive-a-record rule intact — the old agent record is gone for good; only the conversation comes back. The stored command keeps--resumeso a later Restart returns to the same conversation. Session ids reach a shell command line, soisSessionId()shape-validates them before launch. - The closed-session list reads Claude Code's own transcripts under
~/.claude/projects/<encoded cwd>/, so sessions this extension never managed appear too. It must stay read-only (never write, rename, or delete under~/.claude), stay lazy (loaded only while the panel is open — these files reach tens of megabytes), and stay bounded (48 KB head + 48 KB tail per file, newest 60 files; ~20 ms for 87 sessions). Sessions already open as live agents are filtered out viaruntime.sessionId, and sessions with no non-sidechain assistant answer are treated as stubs and hidden. - Rows have no hover actions. Right-clicking a row opens a one-item context menu whose red
Kill agentaction closes the terminal and removes the agent, with no extra confirmation. Do not restore the hoverX, the overflow/action menu, or separate terminal/stop hover buttons. - An agent record exists only while its terminal exists. Never relaunch an existing agent: clicking a row, Open Terminal, and Switch Agent only reveal. When an agent's terminal closes, its process exits, or its launch fails, the record is removed immediately — a terminal-less agent must never be listed. Explicit relaunch exists only as the Restart command on a live agent and the off-by-default
restoreOnStartup/autoRestartsettings. - Startup reattachment is PID-verified (2026-08-06): a name-matching terminal is adopted only when its
processIdequals the agent's persistedruntime.processId. A window reload keeps the pty process, so reattachment still works; after a full VS Code close the process is dead even when VS Code "revives" the pane with a fresh shell — those revived look-alike panes are disposed (claimRestoredinTerminalController, mirrored inhandleOpenedTerminal) and the record is dropped, because a row pointing at a dead, empty terminal is worse than no row. Never adopt or dispose a terminal whose PID cannot be read. - When the agent's process exits cleanly on its own (the user typed
exitin Claude — shell integration reports exit code 0/unknown, or a SessionEnd reason that exits the CLI:prompt_input_exit,logout,exit), the terminal closes together with the record (user request 2026-08-06, reversing the earlier keep-the-shell decision). A non-zero exit keeps the terminal open so the error stays readable, and a session end that leaves the CLI running (/clear, unknown reasons) must never close the terminal. - Keep provider-specific behavior out of the view. New providers belong behind
AgentProviderand monitoring implementations behindAgentMonitor. - Never scrape terminal buffers or patch a user's Claude configuration. Claude state,
/rename, and the latest-message preview come from the bundled per-terminal Claude plugin and hook bridge. - Claude lifecycle hook events are authoritative. Terminal redraw or shell output must not change an already completed response from
Idleback toExecuting. - Continue using the built-in VS Code terminal and supported APIs. Degrade gracefully when shell integration or Claude hooks are unavailable.
Architecture map
src/agent/: durable agent model and lifecycle orchestrationsrc/providers/: provider interface, Claude provider, and generic providersrc/monitor/: shell integration, Claude hook file source, and future monitor adapterssrc/terminal/: integrated-terminal creation and controlsrc/sessions/: stored Claude sessions for the closed-session list (ClaudeSessionRecordsis pure/testable;ClaudeSessionHistoryholds the filesystem side)src/usage/: Claude plan usage meters (ClaudeUsageRecordsis pure/testable;ClaudeUsageServiceholds the vscode/network side)src/views/: rich sidebar webview and status barsrc/storage/: versioned persistence codecsrc/commands/: command workflows and registrationclaude-plugin/: bundled hook manifest and event bridge used only by managed Claude terminals
src/extension.ts is the dependency-composition root. Avoid global mutable state. Keep agent-provided text escaped or assigned through DOM text properties, retain the webview content-security policy, and never persist VS Code Terminal handles.
Required checks
On a new machine, install Node.js 20 or newer, clone this repository, and initialize the project with:
cd yonso-claude-vscode
npm ciUse npm ci, not a copied node_modules directory, to reproduce the dependencies locked in package-lock.json. Make changes in src/, test/, claude-plugin/, or the project documentation; do not hand-edit generated dist/extension.js.
Run this before handing off a code change:
npm run checkFor a production bundle and VSIX:
npm run packageThe package command performs type checking, linting, tests, and a production build before creating ai-agent-manager-<version>.vsix in this directory. Verify the artifact with unzip -t. For a release change, update package.json, package-lock.json, and CHANGELOG.md consistently before packaging.
Current implemented behavior
Version 0.9.0 includes the flat rich list with in-place row reconciliation (single-click open even while agents stream), drag reordering, quick-pick switching plus Ctrl+Tab/Ctrl+Shift+Tab cycling that works even with a terminal focused (commands auto-added to terminal.integrated.commandsToSkipShell), Cmd+W killing the focused agent behind an are-you-sure modal while an agent terminal has focus, the close guard modal on the close-window/quit keyboard shortcuts while agents are alive, a colon-free AI AGENTS header, a title bar with only the New Agent button, persistence with PID-verified terminal reattachment across window reloads (dead revived terminals are disposed and their records dropped after a full VS Code close), Claude hook-driven lifecycle status, /rename synchronization, bounded last-message previews rendered with Claude-terminal-like markdown formatting (slash-command rows filtered, /clear resets the preview, lifecycle placeholders like Output received never shown), cyan terminal-style name tags, per-row model chips read from the transcript, the bottom Resume-a-closed-session panel listing this folder's stored Claude sessions, 24-hour row timestamps, Claude-style usage meters at the sidebar bottom mirroring the CLI /usage screen — titled periwinkle bars with N% used and Resets … lines, parsed from the payload's limits array so the Fable weekly meter shows (multi-source freshest-first sign-in reads, visible failure reasons) — no search bar, no visible unread counters, popup notifications off by default, the Clawd artwork, one-click agent creation, Claude launches with auto mode on, the Ctrl+Shift+C always-maximized flow, the red Kill agent right-click action, and automatic removal of any agent whose process exits, whose terminal closes, or whose launch fails — a clean self-exit also closes the terminal, and clicking a row never relaunches an agent. Read README.md and CHANGELOG.md for the public behavior and release history before making substantial changes.
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
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.

