Working with multiple repositories, the easy way
This is not really a new problem. Agentic work added even more complexity into the equation. There are several tools to solve this issue already, but they don’t fit very well with this new reality. Let’s take a look at my work today.
I started around 20 different threads today in multiple rust-based projects. Most of them involved changing 2-3 different repositories together.
The problems you’ll hit with a workflow like this
1. Introducing changes to multiple systems / components at once
Let’s assume I’m working on the backend server (rust), web app (nodejs Astro project) and a frontend component exported as NPM package. Adding a single database field means changing all 3. While I can put them in a single repository,
2. Conflicts between different workstreams
Some of the changes were happening in parallel. While they were not really realted to the same components, the working tree and commits would get polluted with unrelated changes. I’ve commited unrelated files way too many times, slowing down two tracks at once: one due to the extra file and the second one due to it missing.
Git worktrees became a popular solution to this problem. Create a worktree for each unit of work so the parallel work streams don’t overlap. And that works great, as long as you work on a single repository - either due to small scope of work or working with a monorepo.
But that’s not always the case. Some of these repositories might be third party libraries. Or the company setup is differen’t and there’s not much you can do about it. Either way, a different solution is needed. Or at least something more.
The conflicts often don’t end at code level too. What if you are upgrading dependencies across multiple projects and your openssl version needs to change? How do you go back to a different workstream to fix a bug without switching your operating system? Docker container or a VM can solve this. But then how do you keep track of them and they have overhead too.
3. Ability to set up a new workstream quickly (seconds, not minutes/hours)
The setup and compliation time for every new worktree alone is killing the feedback loop extremely. Each npm install, cargo build and sequelize db:migrate adds up.
It can be solved, as others did. But that’s hacking around the problem instead of actually solving it.
4. Resource usage & context overload on large monorepositories
So we use monorepo and it’s solved, right? Let’s say my project has 20 different services, frontends, packages and websites. When working on a single feature spanning only 3 of them, a simple grep can produce results from the other 17. How do we filter them out?
Not to mention the compilation/startup time and memory usage (especially these days) added by one that we are not even working on right now!
5. A way to test things locally across multiple worktrees at once
I want to always test things end-to-end before even pushing the code to a branch or releasing a build. The ability to keep one context for multiple changes across repositories makes the end result much better overall. But that means creating a bunch of scripts that spawn each project locally on specific ports and wire them together with env variables. Those setups can be quite complex.
And what happens when we want to work on 2 features in parallel? Now we are wranging docker networking or running a local kubernetes cluster. Ugh.
6. Trash accumulating over time
Docker images, worktrees themselves, node_modules/ and target/ directories, all taking space. With so many threads per day, cleanup and disk space hunting are now a daily occurence.
I need a way to keep these in check automatically, without worrying about removing something that’s needed.
7. Source code for all systems available at the project root
Working on a large E2E change spanning multiple systems requires all of the context to be there at once. Otherwise, we burn tokens and time researching cross-repository depencies, cloning and building code. What has time and money for that?
So what’s the solution?
This is not the first time something like this has been attempted. Anyone remember CMake? The problem is that we can’t simply assume a single stack for all the projects. Some might be Rust, some TypeScript and others Zig. So we need something that will solve all of the above, while being tech stack agnosting.
Who doesn’t like a challenge!
Option #1: Hand-rolled scripts
Creating a simple repository with a Makefile / Just might be a way to go. This might work for a specific project. What happens once there are hundreds of repositories like this? We waste time and money on discovery and fixing these fragile setups.
Option #2: Monorepo
Keeping everything in a single repository might be a solution. But it has it’s own drawbacks. Huge checkout size, custom release and CI solutions. Essentially all of our tooling is built around a repository being it’s own thing. GitHub permissions, CI. Monorepositories trade one set of complexity for another.
Unless you work at BigTech, nobody really wants to deal with that. I for sure don’t.
Option #3: docker-compose and friends
It’s the closest to perfection out of all. It still requires custom setup, but with good isolation of networks it solves the parallel workstreams, setup time, E2E testing. But we are still left with trash containers polluting our disk, higher disk and RAM usage due to suboptimal docker images and build times when changing upper layers.
Oh, and your shell and tooling is not working within the container anymore.
Can we do it differently?
With that in mind, I wanted to achieve something that will solve all the problem I encountered.
I am a huge fan of Nix. To the point I decided to join this year’s NixCon 2026 in Kraków. You will also notice some of my talks actually promote devenv.sh as a way to set development environments locally. This meant practically all of my projects already have a devenv.sh set up.
I actually started with option #1. Each project had it’s own setup already. Now add some script that does a checkout of all dependencies and a shared devenv.yaml combining multiple devenv environments into a single one. I did that twice. Third time seemed like one too many. While it mostly worked, I wanted some quality of life improvements. Shared branch names for related changes, better cache handling out of the box etc.
Having all of this logic in the repository itself meant it needed to be re-implemented for each project separate and could drift between them.
So I decided to vibe-code my own solution to this problem, building on foundations that already existed. This is how pot was born.
Introducing: Pot
Pot is a simple CLI tool that combines worktrunk worktrees management and devenv.sh local environments into a single tool. You can still use those two tools capabilities for managing a single repository. Pot automates the cross-repository aspect of it - cloning, creating feature branches, setting up environments, sharing installation and build outputs.
See it run
Pot profiles
To allow working on different flows, pot exposes profiles. Each profile represents a flow that is being worked on. It can define:
- List of repositories that need to be set up
- Additional devenv.sh configuration applied on top of the one defined by the repositories
That way, I can work on database, API and documentation changes in one workstream while chaing frontend and backend together in another.
Thanks to Nix, all libraries and packages are cached locally and can coexist together on a single machine.
What pot is not
1. Not a sanbox
This project is not a attempting at isolating anything. Quite the opposite. Development ergonomics require your local CLI tools to be avilable across all projects and profiles without whitelisting or installing into each VM/container.
If you need a sandbox, it can be run inside of one. You can run it in a VM, you can run it in your agentic harness, you can run it locally. And that’s why it fits nicely into the existing ecosystem, allowing different workflows to converge into a single tool.
2. Not a build cache
While worktrunk supports some basic caching via copy-ignored, it’s not always good enough. For my use case, some additional setup was needed. But the devenv part actually comes in handy when setting it up - especially for 3rd party projects that I don’t have direct control over.