# Stack

> Manage stacked branches with the stack CLI. Covers branch creation, navigation, syncing, and PR management. Use when this capability is needed.

- Skill: `tomevault-io/stack` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/stack`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/stack/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/stack

---


The `stack` CLI manages stacked branches and syncs them to GitHub PRs. Use this for working with dependent branches.

## Choosing Between `stack worktree` vs `stack new`

- **`stack worktree <branch>`** - Creates a separate git worktree directory at `~/.stack/worktrees/<repo>/<branch>`. Use when:
  - Starting a new feature from master
  - Want to work on multiple things in parallel without stashing
  - The current worktree has uncommitted changes you want to keep

- **`stack new <branch>`** - Creates a branch in the current worktree. Use when:
  - Building on top of the current feature branch (stacked PRs)
  - Already in a worktree and want to add dependent branches

## Common Commands

- `stack new <branch>` - Create new branch in the stack (use instead of `git checkout -b`)
- `stack status` - Show stack structure with PR status (fetches from GitHub)
- `stack show` - Show local stack structure (fast, no network)
- `stack sync` - Sync branches and update PRs on GitHub
- `stack up` / `stack down` - Navigate up/down the stack
- `stack prune` - Clean up merged branches
- `stack reparent <parent>` - Change the parent branch
- `stack rename <name>` - Rename the current branch
- `stack worktree` - Create a git worktree for parallel work

## Workflow

1. Start a new feature from master: `stack worktree feature-name`
   - Or use `stack new feature-name` if building stacked PRs on a feature branch
2. Make changes and commit
3. Sync to GitHub: `stack sync` (creates/updates PR)
4. Check status: `stack status`
5. After merge: `stack prune` to clean up

Run `stack --help` for full documentation.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/javoire) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

