Back to Commands

rebase

Rebase a PR branch with the latest main branch. Features smart conflict resolution powered by AI when merge conflicts are detected.

Syntax

@Smart Workflow rebase <PR_link>

Examples

Basic rebase
@Smart Workflow rebase https://github.com/org/repo/pull/123

How it works

1

Fetches PR branch

Gets the current state of your PR branch.

2

Attempts merge

Tries to merge/rebase onto latest main.

3

Resolves conflicts

Uses AI to resolve any conflicts semantically.

4

Force-pushes

Pushes the rebased branch back to the PR.

Smart Conflict Resolution

When merge conflicts are detected, Claude doesn't just pick sides—it understands the semantic intent of each change and merges them intelligently.

Analyzes both versions

Understands what each conflicting change is trying to achieve.

Semantic understanding

Goes beyond line-by-line comparison to understand code intent.

Intelligent merging

Combines changes in a way that preserves both intentions.

Safe fallback

Falls back to manual resolution if automatic resolution isn't confident.

Example Scenario

Conflict detected in src/auth/login.ts
Main branch:
- validateEmail(user.email)
+ validateAndNormalizeEmail(user.email)
PR branch:
- validateEmail(user.email)
+ validateEmail(user.email, { strict: true })
AI Resolution:
+ validateAndNormalizeEmail(user.email, { strict: true })

Claude understood that main renamed the function while PR added an option, and merged both changes correctly.

💡 When to use

  • Your PR is behind the main branch and needs to be updated
  • GitHub shows "This branch has conflicts that must be resolved"
  • You want a clean commit history before merging