Automatically create git branches from Jira tasks with AI-powered naming
Stop manually typing branch names. Let AI do the work.
🔒 No third-party APIs required — Uses Claude Code directly, no API keys or external services needed.
| Feature | Description |
|---|---|
| 🔗 URL Parsing | Extracts task info directly from any Jira URL |
| 🤖 AI-Powered | Uses Claude to generate clean, consistent branch names |
| 📦 Auto-Stash | Automatically stashes uncommitted changes |
| 🔄 Smart Switch | Switches to existing branch if it already exists |
| 🎯 Consistent Naming | Enforces branch naming conventions automatically |
| Requirement | Description |
|---|---|
| Claude Code CLI | Anthropic's CLI tool |
| Claude in Chrome | Browser extension for page interaction |
| Chrome | Must be running with extension active |
| jq | JSON parsing utility |
| Git | Version control |
# Clone the repository
git clone https://github.com/yourusername/jira-auto-branch.git
# Make the script executable
chmod +x Jira-auto-branch.sh
# Run with a Jira URL
./Jira-auto-branch.sh https://your-domain.atlassian.net/browse/PROJ-123./Jira-auto-branch.sh <jira-task-url>./Jira-auto-branch.sh https://your-domain.atlassian.net/browse/PROJ-123
# Output:
# ✓ Task info retrieved successfully
# ✓ Generated branch name: PROJ-123-add-user-authentication
# ✓ Successfully created/switched to branch: PROJ-123-add-user-authentication┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Jira URL │────▶│ Chrome + Claude│────▶│ Extract Info │
│ │ │ Extension │ │ │
└─────────────────┘ └─────────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Switch Branch │◀────│ Generate Name │◀────│ Task ID + │
│ (stash/unstash)│ │ (AI-powered) │ │ Title │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Open - Opens Jira task URL in Chrome via Claude extension
- Extract - Pulls task ID, title, and description from the page
- Generate - AI creates a clean branch name following conventions
- Stash - Saves any uncommitted changes (if present)
- Branch - Creates and switches to the new branch
- Restore - Brings back your stashed changes
| Rule | Example |
|---|---|
| Format | TASK-ID-short-description |
| Case | Lowercase description |
| Separator | Hyphens only |
| Max Length | 60 characters |
Examples:
PROJ-123-add-user-authenticationFEAT-456-fix-login-redirectBUG-789-resolve-null-pointer
You can customize the output by modifying the JSON schemas in the script:
Controls what information is extracted from the Jira page:
{
"task_id": "The Jira task ID",
"title": "Short summary of the task",
"description": "Brief description"
}Controls the branch name format:
{
"branch_name": {
"pattern": "^[A-Z]+-[0-9]+-[a-z0-9-]+$",
"maxLength": 60
}
}Modify these schemas to fit your team's conventions!
Contributions are welcome! Feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.