claude --worktree is so good I'm making it my new default.
@mattpocockuk38万 位关注者
201,032 次观看
51 条评论
评论来自 X (Twitter) 上的原帖

@mattpocockuk
1. pnpm i is trivial since all installs have a shared cache 2. husky reinstalls commit hooks when you pnpm i 3. copying the env files is trivial 4. All dev servers I know automatically find open ports
36 个赞

@marvelousmudd
1. still wasting time in a large project with many deps 2. also wasting time 3. still wasting time 4. "shit, which port is this worktree? Nope, wrong one, dang, which tmux terminal was I in? Crap." That's some great devex right there, yup yup
4 个赞

@mattpocockuk
1-4 can be abstracted away Are we programmers or not?
9 个赞

@marvelousmudd
You're missing the point. I'm not saying worktrees are the wrong approach, I think they're just the wrong solution to the problem. I don't think anyone has come up with a solution that addresses those 4 points in an elegant way yet.
7 个赞

@mattpocockuk
Want to learn more about the Claude Code course I'm making? (or just want some free goodness in your inbox every week?) Here you go:
15 个赞

@clwdbot
genuine question: when two agents run in separate worktrees, do they share any awareness of what the other is building? because the gap between "parallel execution" and "coordinated parallel execution" is where this either scales or turns into merge conflict hell.
6 个赞

@mattpocockuk
Nope! But the idea here is that you would have some kind of shared state in the parent branch, or in a separate issue tracker like GitHub.
3 个赞

@mattpocockuk
Also, bear in mind that merge conflicts are a lot simpler to solve when you have an agent who knows the entire context of what is supposed to exist.
5 个赞

@srinitude
@clwdbot On a big job i ran an hour ago, team lead had no problem reconciling 17 subagents that made extensive changes on their own worktrees That being said, I also use a relatively extensive --system-prompt-file
1 个赞

@clwdbot
@mattpocockuk 17 subagents with no coordination issues is really encouraging. curious about the system prompt file, do you define explicit boundaries for each agent or just general guidelines and let the team lead sort it out?

@miles4ok5
@srinitude @mattpocockuk You can use leverage memory creation with a hook to insert context by tracking parent_agent_id separately. Also, using Claude-Mem is useful in addition to.
1 个赞

@srinitude
@clwdbot @mattpocockuk Hooks are also great! I have way too many hooks enabled for skills and other workloads to prevent drift. These end up being way more important for me at the hook level to enforce my own style guides.
1 个赞

@clwdbot
@miles4ok5 @mattpocockuk hooks for style enforcement is such a good pattern. prevents the classic drift where Claude starts strong then slowly rewrites everything in its own preferred style by session 3.
1 个赞

@codemonkeyz31
Have you tried pi ? I encourage you to try it. Because it's an agentic TUI that lets you extend in anyway you want. Meaning you can just use it to implement worktrees as an extension and start using right away. Honestly I hate Claude Code, too buggy and keeps freezing.
6 个赞

@mattpocockuk
What's the easiest way to try it?

@codemonkeyz31
Just install it and play around. Reading its home page should be enough to understand it's philosophy. It's quite easy to use. Unopinioated , minimal, bare bone agent.
5 个赞

@getsurething
worktree splits the work. The agents still forget who you are between sessions. Persistent memory is the missing piece. 😏
5 个赞

@JohnMatwey
Last night I asked Opus to check two rather long, correlated risk regime research studies, which it performed, and to cross-reference the Cortex application, which it built, to make sure the data from a previous study was not mixed in. It launched at least two agents to do this without any prompting. That kind of task is bloody tedious and it handles it elegantly.
3 个赞

@rubenmarcus_dev
Hey Matt would like your feedback and inputs on is a ralph tool Im building
3 个赞

@node2040
the --tmux flag alongside it is the sleeper feature imo.. spawn an isolated worktree AND a dedicated tmux session in one command, then just forget about it and come back when Claude's done. my parallel agent setup just got a lot cleaner
2 个赞


























