Skip to main content
skill CX Codex

graphite — Claude Code skill: stacked PRs with gt

Teaches the agent to build and manage Graphite PR stacks: create branches, walk the stack, restack on main.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add withgraphite/agent-skills --skill graphite -a claude-code
Open on GitHub

What graphite does

The skill covers the Graphite CLI (gt) and whitelists the commands the agent may run: gt *, git add, git reset, git diff, git status, git stash, git checkout, git rebase, git branch and gh pr. Inside there is a quick-reference table, the basic stack workflow, navigation (gt up, gt down, gt top, gt bottom, gt ls), amending a branch with gt modify and submitting with gt submit --no-interactive.

A separate section handles branches Graphite does not track. When gt branch info returns the untracked-branch error, the skill gives two routes: track the branch temporarily with gt track -p main, build the stack, then re-parent the first branch onto main and run gt restack; or stash the work and start from main. There is also a recipe for resetting commits back to unstaged changes and advice to reorder branches with gt move rather than gt create --insert.

Before submitting, the skill tells the agent to confirm with gt ls that the first branch sits on main, then run lint, build and tests using the commands from the project's CLAUDE.md. PR descriptions should be written to /tmp/pr-body.md and applied with gh pr edit --body-file instead of a heredoc, because shell escaping breaks markdown. In deep stacks gt restack can touch branches outside your work and hit unrelated conflicts; the skill points to a targeted git rebase <target> for that case.

What it helps with

  • build a stack of dependent pull requests
  • jump to a specific branch in the stack
  • re-parent a stack from a feature branch onto main
  • split one large commit into separate PRs
  • fix a branch Graphite is not tracking

Example prompts for the agent

  • create a three-PR stack for this feature with gt
  • show me the stack and move me up one branch
  • re-parent the stack onto main and restack it

How to install graphite

1Skills CLI (Vercel)

npx skills add withgraphite/agent-skills --skill graphite -a claude-code

2Manually: put the files in place

~/.claude/skills/graphite/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/graphite/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about graphite

How do I install graphite in Claude?

Run npx skills add withgraphite/agent-skills --skill graphite -a claude-code. The skill file then lives at ~/.claude/skills/graphite/SKILL.md.

What does graphite do?

It tells the agent how to drive the Graphite CLI: creating branches and PRs, navigating the stack, rebasing onto trunk, submitting with gt submit and editing descriptions with gh pr edit.

Why can't the agent work with my branch?

The branch is probably untracked by Graphite. The skill says to run gt track -p main first, then build the stack with gt create.

Similar skills

All skills for Git and GitHub →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor