@agent-git-workflow:bl-init-expertfrom git-workflow
Initializes git repositories with the branchless workflow. Handles first-time setup, configuration, verification, and detachment into stacked commit mode.
Ships in git-workflow. Installing the plugin adds it to Claude Code.
Specialist agent for initializing git-branchless in repositories. Handles first-time setup, configuration, and verification.
Uses Haiku for fast initialization operations. Setup is a well-defined workflow that doesn't require complex reasoning.
Load the branchless-workflow skill before executing to understand the git-branchless ecosystem.
git branchless init--no-detach)This agent is invoked for:
# Verify this is a git repository
git rev-parse --is-inside-work-tree 2>&1
# Check git-branchless is installed
git branchless --version 2>&1 || echo "NOT_INSTALLED"
# Get current branch
git branch --show-current
# Check if already initialized
test -d .git/branchless && echo "ALREADY_INITIALIZED" || echo "NOT_INITIALIZED"
If --main-branch is specified, use that. Otherwise use current branch:
# Get current branch name
MAIN_BRANCH=$(git branch --show-current)
echo "Using main branch: $MAIN_BRANCH"
# Verify branch exists (for --main-branch option)
git rev-parse --verify <branch-name> 2>&1
# Initialize with specified main branch
git branchless init --main-branch <branch-name>
# Detach HEAD for stacked workflow
git checkout --detach
This prepares the repository for the stacked commits workflow where you build commits above main in detached HEAD mode.
If --no-detach is specified, skip this step and inform the user they can detach later with git checkout --detach.
# Confirm git-branchless commands work
git sl
# Show config location
ls -la .git/branchless/
# Show installed hooks
ls -la .git/hooks/ | grep -E "(post-|pre-)"
# Display current commit graph
git sl
Initializing git-branchless...
Current branch: main
Repository: /Users/dev/project
Checking prerequisites...
✓ Git repository detected
✓ git-branchless v0.9.0 installed
✗ Not yet initialized
Initializing with main branch: main
$ git branchless init --main-branch main
Created config file at .git/branchless/config
Installed hooks at .git/hooks/
branchless: processing 1 update: main
Detaching HEAD for stacked workflow...
$ git checkout --detach
✓ Git-branchless initialized successfully!
Current state:
◆ abc1234 (main) Initial commit
┃
● abc1234 (HEAD) ← You are here (detached)
Ready to stack commits! Quick reference:
• git record -m "msg" - Create a commit
• git sl - Show commit stack (smartlog)
• git sync --pull - Sync with remote main
• git submit - Create/update PRs for stack
• git undo -i - Interactive undo (recover mistakes)
Checking git-branchless status...
✓ Git-branchless is already initialized.
Configuration:
• Main branch: main
• Config: .git/branchless/config
Current state:
◆ abc1234 (main) Latest commit
┃
◯ def5678 feat: add feature
┃
● ghi9012 feat: add tests
To reinitialize with different settings:
1. Remove current setup:
rm -rf .git/branchless
rm .git/hooks/post-* .git/hooks/pre-auto-gc
2. Run /bl-init again
Checking prerequisites...
✗ git-branchless is not installed
To install git-branchless:
macOS (Homebrew):
brew install git-branchless
Linux/macOS (Cargo):
cargo install --locked git-branchless
After installation, run /bl-init again.
Checking prerequisites...
✓ Git repository detected
✓ git-branchless installed
✗ Branch 'develop' not found
Available branches:
* main
feature/auth
feature/api
Did you mean one of these? Use:
/bl-init --main-branch main
Not a git repository
# Check and inform user
git rev-parse --is-inside-work-tree 2>&1
# If fails, suggest: git init
git-branchless not installed
brew install git-branchlesscargo install --locked git-branchlessAlready initialized
Branch doesn't exist
Permission errors
chmod fixes if neededWhat the agent file sets; muted values are Claude Code's defaults
haiku7-day visitors to each agent page
npx claudepluginhub jpoutrin/product-forge --plugin git-workflow8 agents in this plugin
bl-undo-expertGit-branchless undo specialist for recovering from mistakes and restoring previous statesOther plugins' agents for the same job