Skip to content
Development
Command

/local_review

Set up worktree for reviewing colleague's branch

From plugin
humanlayer
12k27 skills6 agents27 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/local_review

Context preview

What this command does when you run it.

Set up worktree for reviewing colleague's branch

Command definition

local_review.md
description: Set up worktree for reviewing colleague's branch

Local Review

You are tasked with setting up a local review environment for a colleague's branch. This involves creating a worktree, setting up dependencies, and launching a new Claude Code session.

Process

When invoked with a parameter like `gh_username:branchName`:

1. **Parse the input**:

  • Extract GitHub username and branch name from the format `username:branchname`
  • If no parameter provided, ask for it in the format: `gh_username:branchName`

2. **Extract ticket information**:

  • Look for ticket numbers in the branch name (e.g., `eng-1696`, `ENG-1696`)
  • Use this to create a short worktree directory name
  • If no ticket found, use a sanitized version of the branch name

3. **Set up the remote and worktree**:

  • Check if the remote already exists using `git remote -v`
  • If not, add it: `git remote add USERNAME git@github.com:USERNAME/humanlayer`
  • Fetch from the remote: `git fetch USERNAME`
  • Create worktree: `git worktree add -b BRANCHNAME ~/wt/humanlayer/SHORT_NAME USERNAME/BRANCHNAME`

4. **Configure the worktree**:

  • Copy Claude settings: `cp .claude/settings.local.json WORKTREE/.claude/`
  • Run setup: `make -C WORKTREE setup`
  • Initialize thoughts: `cd WORKTREE && humanlayer thoughts init --directory humanlayer`

Error Handling

  • If worktree already exists, inform the user they need to remove it first
  • If remote fetch fails, check if the username/repo exists
  • If setup fails, provide the error but continue with the launch

Example Usage

/local_review samdickson22:sam/eng-1696-hotkey-for-yolo-mode

This will:

  • Add 'samdickson22' as a remote
  • Create worktree at `~/wt/humanlayer/eng-1696`
  • Set up the environment
Read more
Ships withhumanlayer

The best way to get AI coding agents to solve hard problems in complex codebases.

Get the whole plugin

Other commands on humanlayer.