Settings

Theme

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

waldencui.com

30 points by cui 2 months ago · 8 comments

Reader

jsunderland323 2 months ago

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.

d4rkp4ttern 2 months ago

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

  • cuiOP 2 months ago

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

polski-g 2 months ago

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.

EduardoBautista 2 months ago

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

cuiOP 2 months ago

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

_mrinalwadhwa_ 2 months ago

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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection