惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
Cloudbric
Cloudbric
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
博客园_首页
The Cloudflare Blog
C
Cisco Blogs
AWS News Blog
AWS News Blog
IT之家
IT之家
Cyberwarzone
Cyberwarzone
罗磊的独立博客
美团技术团队
V
V2EX
Project Zero
Project Zero
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
S
Schneier on Security
P
Privacy International News Feed
V
Visual Studio Blog
量子位
T
Tor Project blog
S
Securelist
腾讯CDC
A
About on SuperTechFans
T
Threat Research - Cisco Blogs
G
GRAHAM CLULEY
B
Blog RSS Feed
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
B
Blog
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
V
Vulnerabilities – Threatpost
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
L
LINUX DO - 热门话题
Recorded Future
Recorded Future

Butler's Log

Agentic Version Control Benchmarks Grit: rewriting Git in Rust with agents Git Merge 2026 Agent-safe Git with GitButler We’ve raised $17M to build what comes after Git Announcing the GitButler CLI for Linux The Great CSS Expansion A couple of git nits Simplifying Git by Using GitButler Introducing the GitButler CLI GitButler 0.19 - "Commander Keen" But Head: Crafting a Custom Font MCP vs RAG: Two Very Different Ways to Gain Context Getting Started With GitButler Agents Using the GitButler MCP Server to Build Better AI-Driven Git Workflows Using GitButler With Multiple GitHub Accounts Advent of Code! Upcoming GitButler Events Use GitButler for your Gerrit workflow Integrating GitButler and GitHub Enterprise Butler Flow: shipping code faster (but less like Alfred, more like CI on steroids) - Part 3 Butler Flow: shipping code faster (but less like Alfred, more like CI on steroids) - Part 2 Butler Flow: shipping code faster (but less like Alfred, more like CI on steroids) - Part 1 Grid Happens: Because Flexbox Wasn’t Enough Using Cursor Hooks for automatic version control Deep Dive into the new Cursor Hooks A Responsive Item Counter with CSS only GitButler 0.16 - "Sweet Sixteen" GitButler's Claude Code tab GitButler's Annual Open Source Pledge Report Git Mini Summit 2025 Videos Automate Your AI Workflows with Claude Code Hooks GitButler 0.15 - "Quirky Quinceañera" 20 years of Git. Still weird, still wonderful. GitButler's new patch based Code Review (Beta) Going down the rabbit hole of Git's new bundle-uri How to do patch-based review with git range-diff How Core Git Developers Configure Git Why is Git Autocorrect too fast for Formula One drivers? Stacked Branches with GitButler Git Merge 2024 Talks are Up GitButler 0.13 - "Lucky Baseball" Fearless Rebasing Git Merge 2024 Why GitHub Actually Won GitButler is joining the Open Source Pledge The New Era of Town Hall Chat The Future of Open Source GitButler is now Fair Source Git Merge 2024 GitButler 0.12 - "Stingy Baker" The Birth of THE MERGE GitButler for Windows Fixing up Git with Autosquash The Git Zeitgeist Git Worktrees and GitButler DevWorld Git Slides Git Tips and Tricks Git Tips 1: Oldies but Goodies Git Tips 2: New Stuff in Git Git Tips 3: Really Large Repositories FOSDEM Git Talk Opening Up GitButler Debugging Tauri in VS Code Advent of GitButler Code Signing Commits in Git, Explained Virtual Branches Alpha Our We Are Developers Adventure Building Virtual Branches DevDays in Vilnius The Future of Software and Open Source Introducing GitButler
Managing Multiple Claude Code Sessions Without Worktrees
Scott Chacon · 2025-07-23 · via Butler's Log

With Claude Code's new lifecycle hooks, GitButler auto-sorts simultaneous AI coding into separate branches. Write three features, get three clean branches — no conflicts, no worktrees, no hassle.

Managing Multiple Claude Code Sessions Without Worktrees

One of the very cool things about using Claude Code for code generation is that you can easily run multiple instances of it at the same time, even in the same working directory.

However, Anthropic doesn’t suggest this because then you would commit everything into a single branch, or worst case, all in one commit at the end of your sessions. Instead, they suggest either separate checkouts or the use of git worktree.

The problem here is that you need to bootstrap each of the worktrees (npm install, build artifacts, etc) and worse than that, now you have created the fun new ability to create merge conflicts with yourself.

There's gotta be a better way!

Claude Code hooks and GitButler

Recently, Claude Code released a new version which includes lifecycle hooks, meaning that you can tell Claude to run an external command before certain key actions that it takes.

This means that now GitButler can be informed when files are changed or chats are completed. This allows us to take work generated in simultaneous sessions operating on a single working directory and place work generated in each one into multiple simultaneous branches.

Here's a quick (under 3 min) demo of writing three features on a Twitter clone at the same time and ending up with three independent branches which can be merged in any order:

Three sessions, three branches - that's the Chicago way.

GitButler has long had the ability to take multiple changes in a working directory and assign and commit them to multiple branches.

multiple simultaneous branches in one directory using the GitButler client

With Claude Code hooks, you can make Claude tell GitButler when a file is about to be edited and when it's done being edited. This call gives us a session id, so we can automatically create a new branch for every session we see and assign any work done by that session to the associated branch. When the chat is done, another Claude hook lets us know and we can then commit the work done in that completed chat.

Actually, we do two things. We do a quick commit that stores the prompt used to generate that change, then we spawn another background process that optionally uses AI to rewrite the commit message based on that prompt and the files changed.

This leaves you with one commit per chat round, and one branch per Claude Code session. You can of course then squash, reorder, split or un-commit this work if you want.

The newest release of the GitButler client includes our new experimental CLI that has commands built for the Claude Code hooks. You can follow our help docs to easily set it up after installing our CLI.

Once the hooks are setup, everything should automatically work. If you have any problems or feedback, come shout at us in our Discord.

Scott Chacon

Written by Scott Chacon

Scott Chacon is a co-founder of GitHub and GitButler, where he builds innovative tools for modern version control. He has authored Pro Git and spoken globally on Git and software collaboration.