Skip to content

Conversation

@matthew-petty
Copy link

Adds the ability to create claude-squad instances from the main/master branch instead of the current HEAD. This is useful when you want to start fresh work from a stable base rather than your current working branch.

Problem

When working on a feature branch, users currently can only create new instances from their current HEAD. This means if you're midway through changes and want to start a separate task, the new instance inherits your work-in-progress state rather than starting from a clean main branch.

Solution

  • Add keyboard shortcuts m and M to create instances from the repository's main/master branch
  • Auto-detect the default branch (checks origin/HEAD, then main, then master)
  • Display visual indicators to show instance creation source: [main] prefix for main-based, * prefix for HEAD-based
  • Add optional DefaultBranch config field for repos with custom default branches

Changes

  • New keybindings: m (new from main), M (new with prompt from main)
  • Visual indicators: Clear prefixes showing instance creation source
  • Smart branch detection: Automatically finds the repository's default branch
  • Backwards compatible: Existing n and N shortcuts unchanged

Testing

  • Added unit tests for GetDefaultBranch() function
  • Added tests for BaseRef field serialization/deserialization
  • Verified all existing tests pass
  • Manual testing with various repository configurations

Example of the new UI indicators in the session list:

* my-feature-instance     (created from HEAD)
[main] stable-work        (created from main branch)

- Add keyboard shortcuts 'm' and 'M' to create instances from main/master
- Auto-detect default branch (origin/HEAD, main, or master)
- Display [main] prefix for main-based instances, * prefix for HEAD-based
- Add DefaultBranch config option for custom default branches
- Include comprehensive test coverage for new functionality
@github-actions
Copy link

github-actions bot commented Sep 16, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@matthew-petty
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@matthew-petty
Copy link
Author

This PR implements the TODO that was added in commit a287824:

File: session/git/worktree_ops.go
Line: 112 (on main branch)
TODO: // TODO: we might want to give an option to use main/master instead of the current branch.
Author: @mufeez-amjad
Date: March 23, 2025
Commit: a287824

@matthew-petty matthew-petty deleted the feature/create-instances-from-main branch September 16, 2025 15:16
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2025
@matthew-petty matthew-petty restored the feature/create-instances-from-main branch September 16, 2025 15:26
@matthew-petty matthew-petty reopened this Sep 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant