# Rebase

> Rebase is an open-source agent skill for developer tools. Rebases your jj changeset stack onto the latest trunk and reports conflicts. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/jeffh/claude-plugins/tree/main/jj/skills/rebase
- **Repository:** https://github.com/jeffh/claude-plugins
- **GitHub stars:** 12
- **License:** Apache-2.0
- **Skill name:** rebase
- **Collection:** https://github.com/jeffh/claude-plugins
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/jeffh/claude-plugins/tree/HEAD/jj/skills/rebase)
- [License: Apache-2.0](https://github.com/jeffh/claude-plugins/tree/HEAD/jj/skills/rebase)

## Features

- **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

## Install

### Claude Code

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

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

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

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

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

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [Rebase current branch](https://ai-powered.com/skills/rebase-current-branch): Rebase current branch is an open-source agent skill for developer tools.
- [Commit push PR](https://ai-powered.com/skills/commit-push-pr): Commit push PR is an open-source agent skill for developer tools.
- [Commit](https://ai-powered.com/skills/commit-jeffh): Commit is an open-source agent skill for developer tools.
- [Fix merge conflicts](https://ai-powered.com/skills/fix-merge-conflicts): Fix merge conflicts is an open-source agent skill for developer tools.
- [Take over resume](https://ai-powered.com/skills/take-over-resume): Take over resume is an open-source agent skill for developer tools.
- [Create worktree](https://ai-powered.com/skills/create-worktree): Create worktree is an open-source agent skill for developer tools.
- [Gh stack](https://ai-powered.com/skills/gh-stack): Gh stack is an open-source agent skill for developer tools.
- [Vibe cherry pick integration](https://ai-powered.com/skills/vibe-cherry-pick-integration): Vibe cherry pick integration is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/rebase-jeffh
