DEV Community

Damian Plewa
Damian Plewa

Posted on

Building a desktop application to manage AI coding agents across git worktrees

Building a desktop application to manage AI coding agents across git worktrees

At our company we manage dozens of projects across multiple languages. We started using tools like Claude Code and Gemini CLI on multiple pull request branches simultaneously.

The workflow degraded fast. I often had 20 to 30 terminal tabs open. Each tab ran a different agent. Add the frontend and backend browser tabs for each project and it became impossible to track which agent was working, idle or waiting for input. The cognitive load of context switching was too high.

We built Canopy to solve this problem. Our team usually builds applications for other companies. We wanted a product of our own to fix our specific workflow issue.

Canopy is an Electron application built with Svelte 5 and xterm.js. It creates an isolated workspace for each git worktree. Every workspace gets its own terminal, agent session and an integrated browser tab. We spawn the agents as child processes and read stdout. The application does not proxy API calls or inject hidden instructions.

The sidebar provides a visual overview of all active worktrees. Color indicators show if an agent is working or waiting for a prompt reply. There is an Inspector panel that tracks token usage and context window fill per session. You can visually track when a session reaches 90 percent capacity and run a compact command before the agent fails.

We also built a diff panel where you can click a line in the uncommitted changes view and send a comment directly to the agent's stdin.

Here are the technical choices and trade-offs we made:

  • Electron: The application uses about 1 to 2.5 GB RAM depending on the number of open worktrees. We profiled the application to optimize the scrollback buffers and keep it stable during large agent outputs. We chose Electron because Chromium provides xterm.js and a real browser view per worktree without reinventing those components.
  • Security: API keys are pulled directly from the native system keychain. Agents run in a filtered environment to prevent shell profile secrets from leaking. We do not proxy API calls through our servers.
  • Telemetry: Just to count the Daily Active Users. The application makes one HTTP request per day to log basic system information like the operating system and application version. There are no user IDs and no IPs logged. A single checkbox in the settings turns this off completely. We self-host our analytics instance.
  • Source distribution: The code is public so you can read it and file bugs. We restrict code contributions to our internal team because we lack the resources to review external pull requests right now.

We use this tool daily to maintain focus while working with CLI agents. It is free and requires no account. We would like to hear your thoughts and answer questions about the technical implementation.

Repo: https://github.com/itsoltech/canopy-desktop
Site: https://canopy.itsol.tech

Top comments (0)