DEV Community

Cover image for 🤖🤖How to run AI in parallel easily and for free (Git Worktree Runner)🧠🧠
Web Developer Hyper
Web Developer Hyper

Posted on

🤖🤖How to run AI in parallel easily and for free (Git Worktree Runner)🧠🧠

Intro

I am using AI such as Claude Code (You're absolutely right!), Codex, Cursor, and Cline for both work and for fun.
・My app DEV post (🚀How I released Chrome Extensions (💪🧠Muscle Brain v4))
・My website DEV post (🧐I created a website animation that you might stare at for a while (GSAP)🎨)
I am always thinking about how to use AI better.
🤖How to make AI follow your instructions more for free (OpenSpec)📝
🧠How to use AI more efficiently for free (Serena MCP)🧐

Running AI in parallel seems to be one good way to use AI efficiently. When running AI in parallel, I first came up with Git Worktree. However, it looked complicated and difficult, so I was waiting and seeing for a while. But recently, I heard that Git Worktree Runner can easily run AI in parallel. So, I finally got off my butt and gave it a try.🚀

One AI Coding. (Without Git Worktree Runner🙅) ↓

Parallel AI Coding. (With Git Worktree Runner🙆) ↓

Super Parallel AI Coding. (Maybe in the future?😆) ↓

What is Git Worktree Runner?

Usually, we can use only one Git branch at a time, and we have to switch to another branch to use others. However, Git Worktree allows us to use many Git branches at once. For this reason, Git Worktree is often used when running AI in parallel.

To explain in short, Git Worktree Runner is a wrapper for Git Worktree for easy use. You can use Git Worktree with short and simple commands with less stress. Git Worktree Runner is made by the famous AI PR request review service company CodeRabbit🐰, so it is quite reliable. Moreover, it is an OSS, so you can use it for free.🤑

You can use Git Worktree Runner with the tools below. ↓

Environment Support
Editor Cursor, VS Code, Zed, and more
AI tool Claude Code, Codex, or other
Platform Windows (Git Bash), Linux, macOS

GitHub URL of Git Worktree Runner ↓
https://github.com/coderabbitai/git-worktree-runner

How to use Git Worktree Runner

There are only 4 main commands to use Git Worktree Runner: new, edit, ai, and rm.

Command Description
new Create worktree
editor Open editor
ai Use AI
rm Remove worktree

Let's take a look at how to use Git Worktree Runner step by step.😄

Requirements
・ Git 2.5+ (for git worktree support)
・ Bash 3.2+ (macOS ships 3.2; 4.0+ recommended for advanced features)

Installation: ↓
I will explain for Windows Git Bash, so please check the official documentation for other installation methods.

git clone https://github.com/coderabbitai/git-worktree-runner.git
cd git-worktree-runner

complete -p git
# Check whether "complete" is installed.
# Usually "complete" is installed with Git, but if not install it.

echo 'export PATH="$PATH:'$(pwd)'/bin"' >> ~/.bashrc
source ~/.bashrc
# This creates a symbolic link and makes "git-gtr" executable.
# This is often said as "Add to PATH".
Enter fullscreen mode Exit fullscreen mode

Setup: ↓

cd ~/your-repo                                  # Navigate to Git repo
git gtr config set gtr.editor.default vscode    # One-time setup
git gtr config set gtr.ai.default claude        # One-time setup
Enter fullscreen mode Exit fullscreen mode

Use: ↓

git gtr new my-feature       # Create worktree
git gtr editor my-feature    # Open editor
git gtr ai my-feature        # Start AI
git gtr rm my-feature        # Remove when done
Enter fullscreen mode Exit fullscreen mode

Hooks: (Optional) ↓
You can use Hooks to run custom commands after worktree operations. Here are examples.

# Post-create hooks (multi-valued, run in order)
git gtr config add gtr.hook.postCreate "npm install"
git gtr config add gtr.hook.postCreate "npm run build"

# Post-remove hooks
git gtr config add gtr.hook.postRemove "echo 'Cleaned up!'"
Enter fullscreen mode Exit fullscreen mode

There are many other commands and their options, so please run git gtr help or check the official documentation for full information. ↓
https://github.com/coderabbitai/git-worktree-runner

There are several patterns for using AI in parallel:
・Frontend, Backend, Test, etc.,
・A part, B part, C part, etc.,
・Code same thing with different AI,
And any other pattern you can think of, so let's find our own best way.

Outro

I’m using both Claude Code and Codex, but Codex seems to keep me waiting for a while. So running AI in parallel with Git Worktree Runner might be a good way to use time more effectively.

I hope you learned something from this post.
Thank you for reading.
Happy AI coding!🧠
You're absolutely right!🤖

If you have any good ideas or know anything about running AI in parallel, please leave a comment below.⬇️⬇️

Top comments (10)

Collapse
 
itsugo profile image
Aryan Choudhary

This is really cool, I’ve only ever used one AI tool at a time inside a single workspace, so the idea of running multiple branches in parallel is new to me.
It actually makes a lot of sense: different AIs often have different strengths (one is great at boilerplate, another at debugging), so having them work side-by-side instead of waiting for one to finish sounds like a big productivity boost.

Thanks for breaking it down in such a beginner-friendly way, bookmarking this to try on my next project!

Collapse
 
webdeveloperhyper profile image
Web Developer Hyper

Thank you for your comment! I'm happy to hear my article was helpful. There are lots of possibilities to parallel AI, so I will write a new article when I learn more.😄

Collapse
 
cyber8080 profile image
Cyber Safety Zone

Nice article — thanks for sharing! Using Git Worktree Runner to enable parallel AI workflows is such a clever idea. For anyone juggling multiple tasks or AI-powered coding helpers, this feels like a game-changer. I especially like how simple the commands (new, ai, editor, rm) make branching + workspace isolation without manual hassle.

Collapse
 
webdeveloperhyper profile image
Web Developer Hyper

Thank you for your compliment. I will do my best to catch up with the rapid developing AI!😀

Collapse
 
notadevbuthere profile image
Urvisha Maniar

Nice write-up 👍 — this “git worktree + AI” combo is one of those quiet shifts that really changes how you work. Love how you break down the parallel-workflow benefits step by step.

Working around non-tech people (fintech, finance, biz folks) reminds me how powerful this can be beyond just code: it means fewer pauses, fewer “wait—lemme stash” moments, and more fluid work.

Thanks for sharing — tools like this make you wonder why nobody told us earlier 🤯

Collapse
 
webdeveloperhyper profile image
Web Developer Hyper

Thank you for checking my post. There is much more that AI can do when it runs in parallel, so I will keep studying!😄

Collapse
 
stakiran profile image
sta

I adopt the simple concept of "calling AI in parallel." Although it involves a bit of programming, you can quickly create such processes by asking generative AI.

dev.to/stakiran/asking-n-people-n-...

Collapse
 
webdeveloperhyper profile image
Web Developer Hyper

Wow! You made a such a helpful code. Thank you for sharing.😃

Collapse
 
karlsson profile image
Karlsson

I'm absolutely new to Dev.to, but isn't there anyone here that writes articles themselves instead of spamming these AI made articles?

Collapse
 
webdeveloperhyper profile image
Web Developer Hyper

I don't know which post is generated by AI, but there are many great posts on DEV Community. I hope you can find one that matches your need.

About my post, I use AI for research and grammar check. Texts are written by me, and I am trying to improve both IT skills and my English at the same time. 🤯