Skip to content
Skill

Rebase

Rebases your jj changeset stack onto the latest trunk and reports conflicts

Rebase is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
12
Last commit
License
Apache-2.0
Listing updated

Similar skills

About Rebase

This skill walks an agent through syncing a Jujutsu (jj) changeset stack with trunk. It finds the earliest changeset in the current stack that is not yet on trunk, rebases the whole stack onto trunk, and then shows the resulting log so the outcome is visible.

The workflow is short and deliberate. If the stack is already on trunk, the agent reports that and stops. When the rebase hits conflicts, the agent lists the conflicted files and hands them back to the user instead of resolving them. If trunk() is not configured, it falls back to main@origin or master@origin.

It expects a jj repository with a git remote. When invoked directly it runs jj git fetch first; when run through the jj:rebase command, it assumes the fetch has already happened. No scripts are bundled, and the skill only issues jj commands.

When your agent uses it

Rebase the current jj (Jujutsu) changeset stack onto the latest trunk. This skill should be used when the user wants to "rebase my stack", "update onto main/trunk", or sync a jj stack with upstream. Stops and reports on conflicts rather than auto-resolving. For committing or opening PRs use jj:commit / jj:commit-push-pr instead.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (2 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the jj plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add jeffh/claude-plugins
/plugin install jj@jeffh-claude-plugins

Or copy only this skill to ~/.claude/skills/rebase:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/rebase &&
cp -R "$tmp/jj/skills/rebase" ~/.claude/skills/rebase &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/rebase inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/rebase to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/rebase &&
cp -R "$tmp/jj/skills/rebase" ~/.agents/skills/rebase &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/rebase inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/rebase to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/rebase &&
cp -R "$tmp/jj/skills/rebase" ~/.cursor/skills/rebase &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/rebase inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/jeffh/claude-plugins.git --path jj/skills/rebase

Or copy the folder to ~/.gemini/skills/rebase yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/rebase:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/rebase &&
cp -R "$tmp/jj/skills/rebase" ~/.copilot/skills/rebase &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/rebase inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/jeffh/claude-plugins.git

Then copy claude-plugins/jj/skills/rebase into your agent's skills folder as rebase. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Stack root detection
Locates the earliest changeset in the current stack that is not yet part of trunk.
Whole-stack rebase
Moves the source changeset and all its descendants onto the latest trunk in one step.
Conflict reporting
Stops on conflicts, lists the affected files, and leaves resolution to the user.
Trunk fallback
Falls back to main@origin or master@origin when trunk() is not configured.
Up-to-date check
Recognizes when the stack is already on trunk and reports that without changes.

Good for

  • Rebase my stack onto main
  • Update my jj changes onto the latest trunk
  • Sync my jj stack with upstream after a fetch
  • Check whether my changesets have conflicts with trunk

Rebase FAQ

Does the skill resolve merge conflicts automatically?

No. If the rebase reports conflicts, the skill lists the conflicted files with jj status and reports them to the user, leaving the decision to them.

Does Rebase fetch from the remote first?

When invoked directly, it runs jj git fetch before rebasing. When run from the jj:rebase command, the fetch is expected to have already happened.

What happens if the stack is already on trunk?

The skill finds no changesets to rebase, tells the user they are up to date, and stops.

Which tool does Rebase need?

It uses the Jujutsu (jj) command line, operating on a jj repository. Committing and opening pull requests are handled by other jj skills.

How do I install Rebase in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/rebase to use it in all your projects, or to .claude/skills/rebase in one project. Or install the jj plugin, which includes it: /plugin marketplace add jeffh/claude-plugins, then /plugin install jj@jeffh-claude-plugins.

Does Rebase run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Rebase?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Rebase?

The closest alternatives to Rebase are Rebase current branch, Commit push PR, Commit, Fix merge conflicts and Take over resume.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from jeffh/claude-plugins

  1. Lets Claude hand desktop and browser UI tasks to a Codex agent that drives apps

    • Open source
    • 12 GitHub stars
    • Browser automation
  2. Hands a coding task to a Codex subagent that edits files in the working directory

    • Open source
    • 12 GitHub stars
    • Developer tools
  3. Gets a read-only second code review from a Codex subagent via codex exec

    • Open source
    • 12 GitHub stars
    • Developer tools
  4. Sets up an isolated git or jj worktree with dependencies ready for a feature or fix

    • Open source
    • 12 GitHub stars
    • Developer tools
  5. Collects timestamp and git or jj repo metadata for research and handoff documents

    • Open source
    • 12 GitHub stars
    • Developer tools
  6. Writes conventional commit messages for jj changes, without Claude attribution

    • Open source
    • 12 GitHub stars
    • Developer tools