Crates.io | xlaude |
lib.rs | xlaude |
version | 0.5.0 |
created_at | 2025-08-04 04:57:40.192759+00 |
updated_at | 2025-09-05 12:24:58.649353+00 |
description | A CLI tool for managing Claude instances with git worktree |
homepage | |
repository | |
max_upload_size | |
id | 1780301 |
size | 252,812 |
A CLI tool for managing Claude instances with git worktree for parallel development workflows.
This project is designed as a personal workflow tool, tailored to my specific development needs. While you're welcome to use it as-is, I won't be merging features that I don't personally use. Instead, I encourage you to fork this project and make it your own! Feel free to customize it to perfectly fit your workflow, that's the beauty of open source. Your fork might even become the perfect solution for others with similar needs.
cargo install xlaude
Or build from source:
git clone https://github.com/xuanwo/xlaude
cd xlaude
cargo build --release
xlaude supports tab completion for bash, zsh, and fish shells. After installation, generate and install the completion script:
# Bash
xlaude completions bash > ~/.bash_completion.d/xlaude
# Or add to .bashrc:
# eval "$(xlaude completions bash)"
# Zsh
xlaude completions zsh > ~/.zfunc/_xlaude
# Then add to .zshrc: fpath=(~/.zfunc $fpath)
# Fish
xlaude completions fish > ~/.config/fish/completions/xlaude.fish
The completions provide:
open
, dir
, delete
, and rename
commands# Create with custom name
xlaude create feature-auth
# Create with random name (e.g., "dolphin", "rabbit")
xlaude create
# Create from existing branch (local or remote)
xlaude create existing-branch
This creates a new git worktree at ../<repo>-<name>
. If the branch doesn't exist, it creates a new one. If the branch already exists (locally or on remote), it creates the worktree from that existing branch.
# Open specific workspace
xlaude open feature-auth
# Open current directory if it's a worktree
xlaude open
# Interactive selection (when not in a worktree)
xlaude open
This switches to the worktree directory and launches the configured agent command. By default it is claude --dangerously-skip-permissions
. When run without arguments in a worktree directory, it opens the current worktree directly.
You can configure a single, global agent command used by both open
and the Dashboard (tmux sessions).
Edit your xlaude state file and set agent
to a full command line string:
{
"worktrees": { /* ... */ },
"editor": "zed",
"agent": "codex"
}
Notes:
claude --dangerously-skip-permissions
.agent
to that script path.agent
is used everywhere (no per‑repo/worktree overrides, no environment variable overrides).# Add current worktree with branch name
cd ../myproject-bugfix
xlaude add
# Add with custom name
xlaude add hotfix
xlaude list
Shows all managed worktrees with:
# Delete current workspace
xlaude delete
# Delete specific workspace
xlaude delete feature-auth
Performs safety checks for:
xlaude clean
Removes worktrees from state management that have been manually deleted using git worktree remove
.
xlaude rename <old_name> <new_name>
Renames a worktree in xlaude management. This only updates the xlaude state and doesn't affect the actual git worktree or directory.
# Get path for specific worktree
xlaude dir feature-auth
# Interactive selection
xlaude dir
Returns the absolute path of a worktree. Useful for integration with other tools:
# Quick directory switching
cd $(xlaude dir feature-auth)
# Add shell function for convenience (in .bashrc/.zshrc)
xcd() { cd $(xlaude dir "$@"); }
xcd feature-auth
# Open in editor
code $(xlaude dir feature-auth)
vim $(xlaude dir feature-auth)/src/main.rs
xlaude dashboard
Launches an interactive TUI dashboard for managing multiple Claude sessions:
↑/↓
or j/k
: Navigate project listEnter
: Attach to selected projectCtrl+Q
: Detach from Claude back to dashboardn
: Create new worktreed
: Stop selected Claude sessionr
: Refresh list?
: Show helpq
: Quit dashboardNote: Dashboard requires tmux. Install with:
brew install tmux
apt-get install tmux
dnf install tmux
Start a new feature:
xlaude create auth-system
xlaude open auth-system
Work on the feature with Claude assistance
Switch contexts:
xlaude open # Select another workspace
# Or if you're already in a worktree directory:
cd ../project-feature
xlaude open # Opens current worktree directly
Clean up when done:
xlaude delete auth-system
# Or clean up all invalid worktrees:
xlaude clean
xlaude supports pipe input for automation and integration with other Unix tools:
# Provide branch name via pipe
echo "feature-x" | xlaude create
# Select worktree via pipe
echo "feature-x" | xlaude open
echo "feature-x" | xlaude dir
# Auto-confirm deletion with yes
yes | xlaude delete feature-x
# Use environment variable for force-yes
XLAUDE_YES=1 xlaude delete feature-x
# Use with fzf for fuzzy selection
xlaude list | fzf | xlaude open
# Batch operations
for branch in feature-1 feature-2; do
echo $branch | xlaude create
done
# Chain with other commands
echo "hotfix" | xlaude create && xlaude open hotfix
When multiple input sources are available:
# CLI argument takes precedence over pipe
echo "wrong-name" | xlaude open correct-name # Opens "correct-name"
State is persisted to platform-specific locations:
~/Library/Application Support/com.xuanwo.xlaude/state.json
~/.config/xlaude/state.json
%APPDATA%\xuanwo\xlaude\config\state.json
<repo-name>/<worktree-name>
(v0.3+)XLAUDE_YES
: Set to "1" to auto-confirm all promptsXLAUDE_NON_INTERACTIVE
: Set to "1" to disable interactive promptsXLAUDE_CLAUDE_CMD
: Override the Claude command (default: "claude")Licensed under the Apache License, Version 2.0. See LICENSE for details.