| name | charcoal |
| description | Stacked PRs with Charcoal CLI (charcoal) |
Charcoal Stacked PRs
Manage development work as stacked pull requests using the Charcoal CLI
(charcoal). Charcoal is an open-source (MIT), local-only fork of Graphite for
managing stacked PRs without external services.
Overview
- Repository:
github.com/danerwilliams/charcoal
- Install:
brew install danerwilliams/tap/charcoal
- Language: TypeScript + Node
- Works with: GitHub, GitHub Enterprise, GitLab (experimental)
- No external services — uses Git + GitHub CLI credentials locally
Core Philosophy
- One task = one branch = one PR — keep changes small and focused
- Stack PRs rather than creating independent branches
- Submit early, submit often — push and create PRs as you work
- Sync frequently — keep your stack rebased on trunk
Key Terminology
| Term | Meaning |
|---|
| Trunk | Main branch (main/master) — base of all stacks |
| Stack | Chain of dependent branches, each building on the one below |
| Upstack | Branches above the current one (depend on current) |
| Downstack | Branches below the current one (current depends on) |
| Restack | Rebase all branches to maintain proper parent chain |
Workflow
Starting a New Stack
charcoal sync
charcoal checkout main
charcoal create --all --message "feat(scope): description of first task"
charcoal submit
Stacking the Next Task
charcoal create --all --message "feat(scope): description of next task"
charcoal submit --stack
Viewing Your Stack
charcoal log short
charcoal ls
charcoal pr
Navigating the Stack
charcoal up
charcoal down
charcoal top
charcoal bottom
charcoal checkout
charcoal checkout NAME
Modifying Work In-Stack
Amending the Current Branch
charcoal modify --all
charcoal modify --all --commit --message "address review feedback"
charcoal submit --stack
Inserting a Branch Mid-Stack
charcoal checkout parent-branch
charcoal create --all --message "fix(scope): inserted fix"
charcoal restack
charcoal submit --stack
Splitting a Branch
charcoal split
Folding a Branch Into Its Parent
charcoal fold
Syncing and Rebasing
Sync with Trunk
charcoal sync
Handles: pulling trunk, rebasing stacks, cleaning up merged branches.
Restack After Manual Changes
charcoal restack
Handling Conflicts
git add .
charcoal continue
charcoal abort
Undo
charcoal undo
Submitting and Merging
charcoal submit
charcoal submit --stack
charcoal merge
charcoal sync
Command Quick Reference
Core Workflow
| Command | Purpose |
|---|
charcoal create -am "msg" | Create branch with all changes committed |
charcoal modify -a | Amend current commit, auto-restack upstack |
charcoal submit | Push and create/update PR |
charcoal submit --stack | Push and create/update all PRs in stack |
charcoal sync | Pull trunk, rebase stacks, clean merged |
Navigation
| Command | Purpose |
|---|
charcoal up [steps] | Move to child branch |
charcoal down [steps] | Move to parent branch |
charcoal top | Jump to top of stack |
charcoal bottom | Jump to bottom of stack |
charcoal checkout [branch] | Interactive branch picker |
charcoal log short | View stack tree |
Stack Management
| Command | Purpose |
|---|
charcoal restack | Fix parent chain integrity |
charcoal split | Split branch by commit/hunk/file |
charcoal fold | Merge branch into parent |
charcoal rebase -i | Interactive rebase preserving children |
Branch Management
| Command | Purpose |
|---|
charcoal delete [name] | Delete branch, restack children |
charcoal rename [name] | Rename current branch |
charcoal track [branch] | Start tracking branch with Charcoal |
charcoal untrack [branch] | Stop tracking branch |
PRs and Merging
| Command | Purpose |
|---|
charcoal pr | Open PR in browser |
charcoal merge | Merge PR via Charcoal |
Recovery
| Command | Purpose |
|---|
charcoal continue | Resume after conflict resolution |
charcoal abort | Cancel in-progress rebase |
charcoal undo | Undo last Charcoal operation |
Agent Workflow: Executing Tasks as Stacked PRs
charcoal sync — start from a clean, up-to-date trunk
- For each task: a. Make the code changes b.
charcoal create --all --message "type(scope): description" c.
charcoal submit --stack
- Between tasks:
charcoal sync if trunk has advanced
- After review feedback:
charcoal checkout branch, fix,
charcoal modify -a, charcoal submit --stack
- After merge:
charcoal sync to clean up
Commit Message Convention
Follow conventional commits:
feat(scope): add new feature
fix(scope): fix the bug
refactor(scope): restructure without behavior change
test(scope): add or update tests
docs(scope): documentation only
chore(scope): maintenance tasks
PR Size Guidelines
- Aim for < 800 lines changed per PR
- Each PR should be independently reviewable
- Each PR should compile and pass tests on its own
- If a task is too large, split it into multiple stacked PRs