Boris Cherny Profile picture
Feb 21 7 tweets 3 min read Read on X
Introducing: built-in git worktree support for Claude Code

Now, agents can run in parallel without interfering with one other. Each agent gets its own worktree and can work independently.

The Claude Code Desktop app has had built-in support for worktrees for a while, and now we're bringing it to CLI too.

Learn more about worktrees: git-scm.com/docs/git-workt…Image
1/ Use claude --worktree for isolation

To run Claude Code in its own git worktree, just start it with the --worktree option. You can also name your worktree, or have Claude name it for you.

Use this to run multiple parallel Claude Code sessions in the same git repo, without the code edits clobbering each other.

You can also pass the --tmux flag to launch Claude in its own Tmux session.Image
2/ Use worktree mode in the Desktop app

If you prefer not to use terminal, head to the Code tab in the Claude Desktop app and ☑️ worktree mode

code.claude.com/docs/en/deskto…Image
3/ Subagents now support worktrees

Subagents can also use worktree isolation to do more work in parallel. This is especially powerful for large batched changes and code migrations.

To use it, ask Claude to use worktrees for its agents.

Available in CLI, Desktop app, IDE extensions, web, and Claude Code mobile app.Image
4/ Custom agents support git worktrees

You can also make subagents always run in their own worktree. To do that, just add "isolation: worktree" to your agent frontmatter Image
5/ Also available for non-git source control

If you're a Mercurial, Perforce, or SVN user, define worktree hooks to benefit from isolation without having to use Git Image
Update to 2.1.50 and let us know what you think!

claude.com/product/claude…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Boris Cherny

Boris Cherny Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @bcherny

Feb 11
Reflecting on what engineers love about Claude Code, one thing that jumps out is its customizability: hooks, plugins, LSPs, MCPs, skills, effort, custom agents, status lines, output styles, etc.

Every engineer uses their tools differently. We built Claude Code from the ground up to not just have great defaults, but to also be incredibly customizable. This is a reason why developers fall in love with the product, and why Claude Code's growth continues to accelerate.

I wanted to share a few ways we're seeing people and teams customize their Claudes.
1/ Configure your terminal

- Theme: Run /config to set light/dark mode
- Notifs: Enable notifications for iTerm2, or use a custom notifs hook
- Newlines: If you use Claude Code in an IDE terminal, Apple Terminal, Warp, or Alacritty, run /terminal-setup to enable shift+enter for newlines (so you don't need to type \)
- Vim mode: run /vim

code.claude.com/docs/en/termin…Image
2/ Adjust effort level

Run /model to pick your preferred effort level. Set it to:
- Low, for less tokens & faster responses
- Medium, for balanced behavior
- High, for more tokens & more intelligence

Personally, I use High for everything. Image
Read 13 tweets
Jan 31
I'm Boris and I created Claude Code. I wanted to quickly share a few tips for using Claude Code, sourced directly from the Claude Code team. The way the team uses Claude is different than how I use it. Remember: there is no one right way to use Claude Code -- everyones' setup is different. You should experiment to see what works for you!
1. Do more in parallel

Spin up 3–5 git worktrees at once, each running its own Claude session in parallel. It's the single biggest productivity unlock, and the top tip from the team. Personally, I use multiple git checkouts, but most of the Claude Code team prefers worktrees -- it's the reason @amorriscode built native support for them into the Claude Desktop app!

Some people also name their worktrees and set up shell aliases (za, zb, zc) so they can hop between them in one keystroke. Others have a dedicated "analysis" worktree that's only for reading logs and running BigQuery

See code.claude.com/docs/en/common…Image
2. Start every complex task in plan mode. Pour your energy into the plan so Claude can 1-shot the implementation.

One person has one Claude write the plan, then they spin up a second Claude to review it as a staff engineer.

Another says the moment something goes sideways, they switch back to plan mode and re-plan. Don't keep pushing. They also explicitly tell Claude to enter plan mode for verification steps, not just for the buildImage
Read 12 tweets
Jan 13
It's late 2024, a few days after I launched the first version of Claude Code (then called Claude CLI) to team dogfooding. I walked into the office and saw my coworker Robert with a terminal up on his computer, Claude CLI running and a red/green diff view on screen.

I was surprised. This was back in the Sonnet 3.5 days, before the model was good at agentic coding. I had just given it a FileEdit tool the day before. Claude CLI was a prototype that I thought it wasn't useful for anything yet. But Robert was already starting to use it to write code & use git for him. I was still using the CLI as a note taker mostly, but I also started making it my go-to tool for using git as a result.
A couple months later, many engineers & researchers at Anthropic were using Claude daily. There was one day I remember walking into the office and saw a Claude Code terminal up on our data scientist's computer monitor! I asked if he was trying out Claude Code, and was shocked to learn that he was using it to do his work, to write and run SQL queries for an analysis, and to make little ascii plots in the terminal and using matplotlib.

We built Claude Code for engineers, and here was a data scientist using it to do his work too. The next week, the entire row of data scientists had Claude Code up on their screens.
Over the next few months, this happened over and over. First our designer started using Claude Code for prototypes and content fixes, then our finance person used it to build models and do financial forecasting, Sales used it to analyze data from Salesforce and bigquery, our user researcher used it to crunch survey results.

Fast forward to today, and people are using Claude Code to control their oven, recover wedding photos from a busted hard drive, analyze their DNA and medical records, haggle with customer support.
Read 4 tweets
Jan 2
I'm Boris and I created Claude Code. Lots of people have asked how I use Claude Code, so I wanted to show off my setup a bit.

My setup might be surprisingly vanilla! Claude Code works great out of the box, so I personally don't customize it much. There is no one correct way to use Claude Code: we intentionally build it in a way that you can use it, customize it, and hack it however you like. Each person on the Claude Code team uses it very differently.

So, here goes.
1/ I run 5 Claudes in parallel in my terminal. I number my tabs 1-5, and use system notifications to know when a Claude needs input code.claude.com/docs/en/termin…Image
2/ I also run 5-10 Claudes on claude.ai/code, in parallel with my local Claudes. As I code in my terminal, I will often hand off local sessions to web (using &), or manually kick off sessions in Chrome, and sometimes I will --teleport back and forth. I also start a few sessions from my phone (from the Claude iOS app) every morning and throughout the day, and check in on them later.Image
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(