alt.hn

3/14/2026 at 2:58:37 AM

Direnv Is All You Need to Parallelize Agentic Programming with Git Worktrees

https://waldencui.com/post/direnv_is_all_you_need_to_parallelize_claude_code_with_git_worktrees/

by cui

3/16/2026 at 10:37:58 AM

Roocode has a nice feature called .worktreeinclude -- if you have a file in both .git ignore and that file, it will copy it into new worktrees.

by polski-g

3/14/2026 at 9:23:16 PM

I think direnv would actually play nicely with what we're working on https://coasts.dev. It's for isolating docker-compose runtimes so you can run multiple localhost runtimes and assign them to your various worktrees.

We specifically don't solve the env vars per directory problem, so this is really cool to see.

It's crazy the see the amount of hackery we're all having to figure out with worktrees, way cool to see all these solutions popping up.

by jsunderland323

3/14/2026 at 11:56:20 AM

Thanks - I use worktrees and direnv but never thought about this ennrc trick to auto-share .env across worktrees.

by d4rkp4ttern

3/14/2026 at 6:10:03 PM

But how did you use your main worktree's .env before? Symlink it?

by cui

3/15/2026 at 2:45:36 AM

I just use the WorktreeCreate hook in Claude to copy over the .env file.

by EduardoBautista

3/14/2026 at 4:41:41 PM

Oh, that's a really nice approach. Thank you for sharing.

by _mrinalwadhwa_

3/14/2026 at 7:03:41 PM

Thanks. How are you dealing with worktrees right now?

by cui

3/14/2026 at 2:59:34 AM

This is how I currently use Git worktrees. Curious about how you are using it.

by cui