Claude Launcher
Comprehensive launcher for Claude Code with directory security, multi-account support, and session management.
Features
- Directory Security: Only allows Claude Code to run in pre-configured directories
- Multi-Account Support: Switch between multiple Claude accounts with arrow-key selection
- Session Management: Prompts to continue previous session or start fresh
- Flexible Configuration: Supports environment variables and JSON configuration file
- Cross-platform: Works on Linux, macOS, and other POSIX-compatible systems
Installation
From GitHub Releases (Recommended)
Download the latest release for your platform from the releases page
Automated Installation (Linux/macOS)
Install latest version.
curl -fsSL https://raw.githubusercontent.com/23prime/claude-launcher/main/install.sh | bash
Or with wget:
wget -qO- https://raw.githubusercontent.com/23prime/claude-launcher/main/install.sh | bash
Manual Installation
Linux/macOS:
# Download the appropriate binary for your platform
# Linux amd64
curl -LO https://github.com/23prime/claude-launcher/releases/latest/download/claude-launcher-linux-amd64.tar.gz
tar -xzf claude-launcher-linux-amd64.tar.gz
# macOS amd64 (Intel)
curl -LO https://github.com/23prime/claude-launcher/releases/latest/download/claude-launcher-darwin-amd64.tar.gz
tar -xzf claude-launcher-darwin-amd64.tar.gz
# macOS arm64 (Apple Silicon)
curl -LO https://github.com/23prime/claude-launcher/releases/latest/download/claude-launcher-darwin-arm64.tar.gz
tar -xzf claude-launcher-darwin-arm64.tar.gz
# Make executable and move to PATH
chmod +x claude-launcher-*
mv claude-launcher-* ~/.local/bin/claude-launcher
Windows:
Download the .zip file for your architecture from the releases page, extract it, and add the directory to your PATH.
Using go install
go install github.com/23prime/claude-launcher/cmd/claude-launcher@latest
From source
git clone https://github.com/23prime/claude-launcher
cd claude-launcher
mise run go-build
mv bin/claude-launcher ~/.local/bin/
Configuration
Configure allowed directories using one of these methods:
Method 1: Environment Variable (Priority 1)
export CLAUDE_SAFE_DIRS="$HOME/develop:$HOME/projects"
Method 2: Config File (Priority 2)
Create ~/.config/claude-launcher/config.json:
{
"allowedDirs": [
"/home/user/develop",
"/home/user/projects"
]
}
Multi-Account Configuration (Optional)
Configure multiple Claude accounts to switch between different configurations (e.g., personal vs work accounts).
Method 1: Environment Variable
export CLAUDE_ACCOUNTS="Personal:~/.claude-personal,Work:~/.claude-work"
Format: Name1:ConfigDir1,Name2:ConfigDir2,...
Method 2: Config File
Add to ~/.config/claude-launcher/config.json:
{
"allowedDirs": ["/home/user/develop"],
"accounts": [
{"name": "Personal", "configDir": "~/.claude-personal"},
{"name": "Work", "configDir": "~/.claude-work"}
]
}
Note: When an account is selected, CLAUDE_CONFIG_DIR is set to the account's config directory before launching Claude Code.
Usage
Basic usage
# Check directory and launch Claude
claude-launcher
# Show help
claude-launcher --help
# Show configured directories
claude-launcher --show-dirs
# Show config file path and contents
claude-launcher --show-config
# Specify account by name (skips interactive selection)
claude-launcher --account Personal
# Pass arguments to Claude
claude-launcher --model opus
Command-line Options
| Option |
Short |
Description |
--help |
-h |
Show help message |
--show-dirs |
-l |
Show configured allowed directories |
--show-config |
-c |
Show configuration file path and contents |
--version |
-v |
Show version information |
--account |
-a |
Account name to use (skips interactive selection) |
Example session
Without accounts configured:
$ cd ~/develop/myproject
$ claude-launcher
β Directory allowed
Continue previous Claude session?
[Y/n] (default: y): y
β Continuing previous session...
With multiple accounts configured (interactive selection):
$ cd ~/develop/myproject
$ claude-launcher
β Directory allowed
Select Claude account:
π Personal (~/.claude-personal)
Work (~/.claude-work)
β Personal (~/.claude-personal)
β Account: Personal (~/.claude-personal)
Continue previous Claude session?
[Y/n] (default: y): y
β Continuing previous session...
With --account option (skips interactive selection):
$ claude-launcher --account Personal
β Directory allowed
β Account: Personal (~/.claude-personal)
Continue previous Claude session?
[Y/n] (default: y): y
β Continuing previous session...
When specified account is not found:
$ claude-launcher --account Unknown
β Directory allowed
β Account 'Unknown' not found in configuration
Select Claude account:
π Personal (~/.claude-personal)
Work (~/.claude-work)
Development
This project uses mise for development.
Setup
# Install dependencies
mise install
# Run tests
mise run go-test
# Build
mise run go-build
# Run all checks
mise run check
Available Tasks
# List all available tasks
mise tasks
# Go-specific tasks
mise run go-build # Build the application
mise run go-test # Run tests
mise run go-test-cover # Run tests with coverage
mise run go-lint # Run golangci-lint
mise run go-vuln # Check for vulnerabilities
Project Structure
claude-launcher/
βββ cmd/
β βββ claude-launcher/ # Main application entry point
βββ internal/
β βββ account/ # Multi-account configuration and selection
β βββ config/ # Configuration loading
β βββ security/ # Directory access checking
β βββ session/ # Session continuation prompts
β βββ launcher/ # Claude Code execution
β βββ ui/ # User interface (colors, messages)
βββ docs/
β βββ specification.md # Detailed specification
β βββ implementation-plan.md # Implementation plan
βββ mise.toml # mise tool/task definitions
Documentation
License
This project is licensed under the MIT License - see the LICENSE file for details.