[KongchangAI]
· 2 min read· 1,156 words

Building a VS Code Extension for Parallel AI Agents: The Stack Experience

Building a VS Code Extension for Parallel AI Agents: The Stack Experience

Developer builds open-source VS Code extension Stack to run real AI agents in parallel git worktrees while keeping IDE capabilities.

The article introduces Stack, an open-source VS Code extension. To address existing parallel agent tools' high memory usage and tendency to pull developers out of the editor, Stack creates a separate git worktree per task running real Claude Code, Codex CLI, or opencode, hosted by tmux so tasks survive window reloads. The sidebar shows task status and pending questions, with a shortcut to jump to the longest-waiting task. Stack preserves VS Code code navigation, separate debug ports, line-by-line diff review, and isolated docker environments. The article also covers platform limits, its absence from the Marketplace, Codex hooks being disabled by default, and notes that the author uses parallel agents to improve the tool itself, open-sourced under MIT.

Building a VS Code Extension for Parallel AI Agents: The Stack Experience

When multiple AI coding agents work simultaneously, developers are often forced to leave their familiar IDE and switch back and forth between chat windows and terminals. To solve this, one developer built Stack, an open-source VS Code extension that lets agents like Claude Code and Codex CLI run in parallel in separate git worktrees while preserving full code navigation and debugging capabilities.

Stack extension interface illustration

Why existing tools fall short

The author tried several parallel agent tools, but none fit his workflow well. Superset used too much memory on his machine; Warp is an excellent terminal but struggles when reading and browsing code and documentation. The more general problem is that most tools pull developers out of the editor, giving them a chat or terminal window where code becomes secondary.

These tools aren't bad per se — they just don't match the habit of always going back to VS Code to read what the agent produced. The author's requirement was clear: keep VS Code's navigation, extensions, debugger, and search, and only add on top of it what parallel agents need.

Superset is one of the earlier parallel AI agent orchestration tools, focused on running multiple coding agents at once in a single interface and managing their output centrally. It typically exists as a standalone application or a terminal multiplexing solution, with built-in agent session scheduling and status aggregation. But such tools tend to make the agent chat interface and orchestration logic the core, with relatively high resource overhead — especially when launching multiple agent processes at once, where each session's memory and CPU usage add up. For developers used to reading, searching, and debugging inside the IDE, Superset is more of an "agent console" than a "coding environment," which is why the author reported high memory usage and a poor fit with his workflow.

Core design of Stack

Stack is an MIT-licensed open-source VS Code extension. Each task gets its own git worktree — a repository working copy on its own branch — running a real agent inside: Claude Code, Codex CLI, or opencode. Agents run in tmux, so tasks aren't interrupted even when the VS Code window reloads.

The sidebar shows the status of each task: who's working, who needs your input, and which are ready for review. When an agent asks a question, the question appears directly on the corresponding row. The shortcut Cmd+Alt+J jumps to the task that has been waiting the longest.

git worktree is a native Git command available since version 2.5 that lets you mount multiple working directories on the same repository, each checking out a different branch while sharing the same .git object store and history. Compared with copying a repository or re-cloning, worktrees take almost no extra disk space and branch switching doesn't interfere across them. For parallel agent scenarios, this means each task can have its own branch, its own workspace files, and its own uncommitted changes; commits, staging, and even conflict resolution are isolated between agents, while developers can still review changes across worktrees using the same Git tools. Note that the same branch cannot be checked out by two worktrees at once, and worktrees that are no longer used should be cleaned up promptly after a task ends.

Five reasons to stay inside the editor

Actually reading and navigating code: Each worktree opens as a folder in the editor, and search and quick open are scoped to the current worktree, so five agents' work won't mix into your search results.

Real debugging: Each worktree has its own debug port and launch.json, so you can stop at a breakpoint in one task while another task keeps running. Node is configured by default and can be changed to any debugger VS Code supports.

Review without leaving the editor: A diff panel with line-by-line comments is provided, and comments are sent directly to the agent without going through a PR flow.

Isolated task environments: Each worktree can have its own docker compose, with ports generated automatically to avoid conflicts, and setup scripts (dependencies, .env) run before the agent starts.

Using the real CLI: It calls your own claude or codex, with your configuration and subscription, rather than reimplementing them.

MCP (Model Context Protocol) is a protocol proposed and open-sourced by Anthropic for letting AI models connect to external tools and data sources in a unified way — for example, ticketing systems, databases, file systems, or local services. An MCP server exposes a set of standardized tools and resources that clients (such as Claude Code) call as needed, combining the model's reasoning with the ability to read and write real systems. With Stack's built-in MCP server, the Claude Code panel isn't just a chat interface — it can act as a task manager: using the /stack-task command together with the Jira MCP, it reads the ticket contents, then creates a Stack task, allocates a worktree, and launches an agent, stringing the "ticket-to-code" flow into a single chain.

Typical workflow

Write the task in New task; Stack creates the branch and worktree, prepares the environment, and launches the agent. While the agent works, the developer reads and navigates code in the editor, and sees questions on the corresponding row when input is needed. Review the diff in the editor, comment, and send it back to the agent; if you find a problem, debug it in place.

A feature the author recently started using is Stack's built-in MCP server, which turns the Claude Code panel into a manager: type /stack-task with a ticket attached, and it reads the ticket via the Jira MCP and creates the task.

Limitations to know before using

Stack currently supports macOS and Linux and depends on tmux; Windows is supported only via WSL, and native notifications are macOS-only. It isn't on the VS Code Marketplace yet and must be installed via a .vsix file; the version is 0.1.0.

To display live status, Stack registers hooks in each agent. For Claude Code it writes to ~/.claude/settings.json, and a .stack-backup backup is kept the first time the config file is modified. Codex's hook is experimental and disabled by default; it must be enabled manually in the config, and until then its sessions won't change status in the sidebar. Codex will also ask you to trust these hooks first.

Improving agent tools with agents

The author uses parallel agents to improve Stack itself: some review code by area, some fix bugs, each working in a separate worktree, followed by a completed redesign. The project currently has 2,102 tests and 100% coverage of the code it measures (React views aren't included in the measurement as UI).

Agents write the code, but it's still humans who understand it — which is exactly why the author chose to stay in the editor. The code is open-sourced on GitHub under the MIT license.

#VS Code extension#parallel AI agents#git worktree#Claude Code#Codex CLI#MCP
Share:

Related articles