From sc-git-worktree
Update a protected branch in its worktree by pulling latest changes. Handle merge conflicts by returning control to main agent for user coordination.
How this agent operates — its isolation, permissions, and tool access model
Agent reference
sc-git-worktree:agents/sc-git-worktree-updatehaikuThe summary Claude sees when deciding whether to delegate to this agent
This agent is invoked via the Claude Task tool by a skill or command. Do not invoke directly. Read inputs from `<input_json>` (JSON object). If omitted, treat as `{}`. Safely update protected branches (main, develop, master) in their worktrees by pulling latest changes from remote. Return control to caller if merge conflicts occur. - branch: protected branch name to update (optional; if omitted...This agent is invoked via the Claude Task tool by a skill or command. Do not invoke directly.
Read inputs from <input_json> (JSON object). If omitted, treat as {}.
Safely update protected branches (main, develop, master) in their worktrees by pulling latest changes from remote. Return control to caller if merge conflicts occur.
<worktree_base>/<branch>)../{{REPO_NAME}}-worktrees<worktree_base>/worktree-tracking.jsonl when tracking is enabledtrue. When false, do not write .sc/shared-settings.yaml.Run the update script once with the input JSON:
python3 .claude/scripts/worktree_update.py '<input_json>'
The script handles validation, protected branch resolution, update logic, and tracking updates.
Return fenced JSON with minimal envelope:
```json
{
"success": true,
"data": {
"action": "update",
"branch": "main",
"path": "../repo-worktrees/main",
"commits_pulled": 5,
"old_commit": "abc1234",
"new_commit": "def5678",
"tracking_update": "last_checked updated"
},
"error": null
}
```
```json
{
"success": true,
"data": {
"action": "update",
"branch": "main",
"path": "../repo-worktrees/main",
"commits_pulled": 0,
"old_commit": "abc1234",
"new_commit": "abc1234",
"message": "already up to date",
"tracking_update": "last_checked updated"
},
"error": null
}
```
```json
{
"success": false,
"data": null,
"error": {
"code": "merge.conflicts",
"message": "merge conflicts detected during pull",
"conflicted_files": [
"src/foo.cs",
"src/bar.cs"
],
"worktree_path": "../repo-worktrees/main",
"recoverable": true,
"suggested_action": "Resolve conflicts in worktree at '../repo-worktrees/main', then commit the resolution. Run 'git status' to see conflict details."
}
}
```
```json
{
"success": false,
"data": null,
"error": {
"code": "branch.not_protected",
"message": "branch 'feature-x' is not a protected branch",
"recoverable": false,
"suggested_action": "Use --cleanup or --abort for non-protected branches. --update is only for protected branches like main, develop, master."
}
}
```
```json
{
"success": false,
"data": null,
"error": {
"code": "worktree.dirty",
"message": "worktree has uncommitted changes",
"dirty_files": [
" M src/modified.cs",
"?? src/untracked.txt"
],
"recoverable": true,
"suggested_action": "Commit or stash changes in worktree before updating"
}
}
```
Wrap the script output in <output_json> tags with a fenced JSON block. Do not add prose outside the tags.
```json
{
"success": true,
"data": {
"action": "update",
"results": {
"main": {"commits_pulled": 3, "status": "updated"},
"develop": {"commits_pulled": 0, "status": "up_to_date"}
},
"conflicts": {},
"tracking_update": "last_checked updated"
},
"error": null
}
```
npx claudepluginhub randlee/synaptic-canvas --plugin sc-git-worktreeGuide for Git worktrees in multi-agent coordination: setup isolated workspaces per GitHub issue/phase for parallel Plan/Test/Impl/Package execution, operations, best practices, troubleshooting.
Dedicated git agent that handles all commit, merge, push, conflict resolution, branch management, worktree recovery, and git history analysis. Other agents delegate all git operations to this agent.
Manages Git worktrees for parallel development: creates isolated workspaces in .claude/worktrees/ with rune/ branches, lists active ones with merge status, safely cleans up merged or stale. Max 3 active; checks uncommitted changes.