claude-memory/graph/workflows/pattern-parallel-simplify-agents-with-isolated-worktrees-for-d75e2a.md
2026-03-01 20:20:43 -06:00

2.5 KiB

id type title tags importance confidence created updated relations
d75e2afd-8348-4fe6-9ea1-731604505aa6 workflow Pattern: Parallel /simplify agents with isolated worktrees for large refactors
sba-scouting
rust
claude-code
workflow
refactoring
parallel
worktree
0.6 0.8 2026-03-02T02:08:58.862746+00:00 2026-03-02T02:20:43.812285+00:00
target type direction strength edge_id
9e502d2b-bf95-4161-8190-ba153b9961d0 RELATED_TO outgoing 0.71 f53abf0b-9d21-46ca-a19d-7c2de1f839b7
target type direction strength edge_id
f1c846d2-ddab-4968-b789-d0aa1b703c1b RELATED_TO outgoing 0.74 a5981a58-8f2e-493a-ad5c-2218ebbc391a
target type direction strength edge_id
73646e80-a640-4316-b7c6-54a4330f1b28 RELATED_TO outgoing 0.73 a266c8b2-cf4f-404d-b93a-db4faa3bde73
target type direction strength edge_id
1b71b163-b56f-4226-9731-a76ef245e532 FOLLOWS outgoing 0.8 7d49db13-70e0-46d9-8707-fc0ddfe2df85
target type direction strength edge_id
346c5a34-3fed-44ff-832a-b0c9eb42ca88 FOLLOWS outgoing 0.8 ec429a7a-f8ec-452e-a8ab-0defc5d5ca9f
target type direction strength edge_id
1b71b163-b56f-4226-9731-a76ef245e532 CAUSES outgoing 0.9 090ec7e1-c8fc-40f5-8d60-4b2aef56bcbd

Parallel /simplify with Isolated Worktree Agents

Overview

Successfully ran 17 parallel agents with isolation: "worktree" to simultaneously review and simplify every substantive file in the Rust codebase.

How It Works

  • Each agent gets its own git worktree copy of the repo
  • Agents applied changes directly to the main working tree (not isolated to their worktrees)
  • Run all agents in parallel — no coordination needed for read-heavy simplification tasks

Results on sba-scouting Rust rewrite

  • 17 agents, 24 files modified
  • Net: -261 lines removed
  • All 105 tests passed after integration

Common Simplifications Found

  • Duplicated helpers consolidated: format_rating, format_swar, tier_style, format_relative_time
  • Heap allocations replaced with stack arrays/HashSets
  • OnceLock for invariant hashes (computed once, reused)
  • Transaction wrapping for atomic DB operations
  • tokio::try_join! for parallel async DB queries

When to Use

  • Large refactor/cleanup passes across many files
  • When changes are independent per-file (no cross-file coordination needed)
  • After a feature phase is complete and code needs polish

Usage

Use /simplify slash command (or equivalent Agent tool call) with isolation: "worktree" per file.