Back to Browse

Every developer uses this Git trick. You don't.

43 views
Mar 1, 2026
8:53

Learn how to use git worktrees the right way — run multiple Claude Code sessions in parallel, work on multiple features simultaneously, and never lose context switching branches again. This is the complete git worktree tutorial for 2026. If you've seen people talking about git worktrees but couldn't find a video that actually explained it clearly — this is that video. I watched every video on this topic, didn't get it, went and figured it out myself, and now I'm breaking it down from scratch. By the end of this video you'll understand: → What git worktrees actually are and how they work under the hood → Why they matter so much now that AI coding agents exist → How Claude Code uses git worktrees natively with the --worktree flag → How OpenAI Codex uses git worktrees in their desktop app → How to run 3 Claude Code sessions at the same time on the same repo → The full practical workflow you can use today —————————————————————————— ⏱ CHAPTERS 00:00 — Why everyone's talking about git worktrees 01:00 — What is a git worktree (explained simply) 03:39 — git worktree commands 06:11 — How Claude Code and codex uses git worktrees natively 08:04 — Recap + next steps —————————————————————————— 🔗 LINKS MENTIONED Claude Code docs (worktrees section) → https://code.claude.com/docs OpenAI Codex app → https://developers.openai.com/codex/app Git official worktree docs → https://git-scm.com/docs/git-worktree userbubble github → https://github.com/swarajbachu/userbubble —————————————————————————— 🔍 WHAT IS A GIT WORKTREE? A git worktree lets you check out multiple branches of the same repository simultaneously — each in its own folder. Unlike cloning, all worktrees share the same .git history, commits, and remotes. They just have separate working files. This means you can have feature/auth open in one folder and bugfix/login open in another at the exact same time — no stashing, no switching, no lost context. This has existed in git since version 2.5 (2015) — but nobody really used it until AI coding agents came along and made parallel development actually possible. —————————————————————————— 🤖 GIT WORKTREES + CLAUDE CODE Claude Code now has native worktree support built in. The --worktree flag creates an isolated worktree and starts a Claude session inside it automatically: claude --worktree feature-auth claude --worktree bugfix-payment Each session runs in its own directory, on its own branch. They cannot touch each other's files. Claude keeps full context in each session independently. No more re-explaining your codebase every time you switch tasks. —————————————————————————— 🤖 GIT WORKTREES + OPENAI CODEX The Codex desktop app builds worktrees directly into the UI. When you start a new thread, you choose Local or Worktree. Codex automations also run in dedicated background worktrees automatically — so multiple background tasks never interfere with your main working directory. —————————————————————————— 📌 COMMANDS USED IN THIS VIDEO Create a worktree manually git worktree add ../my-app-feature-auth feature/auth List all active worktrees git worktree list Remove a worktree when done git worktree remove my-app-feature-auth Claude Code native worktree (auto setup) claude --worktree feature-auth claude --worktree bugfix-login claude --worktree refactor-api Add to .gitignore .claude/worktrees/ —————————————————————————— If this helped you, subscribe — I'm making more videos like this on actually using AI dev tools in real workflows, not just the hype.

Download

0 formats

No download links available.

Every developer uses this Git trick. You don't. | NatokHD