clankers

clankers is a terminal interface to control multiple claude code (well technically opencode) agents at the same time, each working on independent git worktrees, possibly on a different computer.

The goal for this is to churn out as much code as possible for an MVP at a time, while still being able to review the code. In codebases with heavy testing frameworks or build steps (read: Rust codebases), you often want to run the agents on a beefier computer. The architecture of this application means that you can port forward our middleman API to your thin and light notebook, and run as many agents as you want on a VM in the Cloud, or a beefy desktop computer.

I implemented the git worktree workflow described by anthropic here, mainly focusing on automating the annoying parts of creating and managing your git worktrees for you.

links

  • my fork of opencode (where the clankers ui lives) is here
  • the backend api (and where all the code will live eventually once i can package this up) is here
  • the website homepage for it is at https://clankers.sh (this doesnt exist yet but i own the domain name)

look out for a twitter demo in a bit!

implementation

The architecture of Opencode is very conducive to creating a multiplexer like this. It communicates with a server over HTTP, which means we can put a relatively light wrapper API in between these two APIs, and proxy the connections to the Opencode servers.

To build this application, I checked out the opentui branch (which is a work in progress rewrite of the TUI framework), and added a lot of my own ui to create the multiplexing. The opencode UI is in the bottom right corner of the screen, and the rest is implemented by me. The opentui UI framework is written in Zig, with bindings to typescript, and it can use any of React, SolidJS, and Vue as a component framework binding. I used solid to conform with opencode's implementation. I also created the middleman API, which manages multiple opencode servers, the git worktrees, and each git repo, using bun+hono as a simple Rest API.

architecture

check out the excalidraw I added to the project gallery!

future goals

I need to completely repackage this into a single executable. Right now its split across 2 git repos, with one as a fork of an already existing project.

Also, there are a lot of UI issues with syncing state between the Opencode server's state, and the clankers server's state, and the clankers TUI frontend. The auto committing and pushing to the origin was not my original idea for this, but I had to do it because of time limitations.

the name

i love star wars the clone wars so much, and clanker is the name for the separatist's battle droids. I think that LLM coding agents are very similar to the clankers in star wars because of how much guidance and code review they need, and I thought the name just fit

Built With

Share this project:

Updates