Skip to content

Support configurable worktree location patterns #86

@bjcoombs

Description

@bjcoombs

Overview

Currently, claude-squad creates worktrees in a fixed location (~/.claude-squad/worktrees/). To support enterprise workflows where worktrees are organized alongside the main repository, we need configurable worktree paths.

Current Behavior

  • Worktrees are created in: ~/.claude-squad/worktrees/<sanitized-name>_<timestamp>/
  • This location is hardcoded in session/git/worktree.go

Desired Behavior

  • Allow configuration of worktree location pattern
  • Support patterns like: {repo_root}/worktree/{issue_number}-{title}
  • Variables available: {repo_root}, {repo_name}, {issue_number}, {title}, {timestamp}

Implementation Details

  1. Add worktree_pattern to config.json
  2. Update GitWorktree.Create() to use the pattern
  3. Parse pattern variables and substitute values
  4. Default to current behavior if not configured

Example Configuration

{
  "worktree_pattern": "{repo_root}/worktree/{issue_number}-{title}",
  "branch_prefix": "fix/issue-"
}

This would create worktrees at: /path/to/repo/worktree/123-fix-bug/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions