claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] Support diff comparison against branches other than main

Open okurashoichi opened this issue 9 months ago β€’ 24 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When using the Claude Code desktop app, the diff view only shows changes compared to the main branch. There is no option to compare against other branches (e.g., a parent feature branch).

In many development workflows, developers create sub-branches from feature branches, not from main. In this case, the diff against main includes all changes from the parent feature branch as well, making it difficult to review only the incremental changes made on the current branch.

Proposed Solution

Allow users to select the base branch for diff comparison, rather than always defaulting to main. For example, a dropdown or configuration option to choose which branch to diff against would be very helpful.

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

Other

Use Case Example

No response

Additional Context

No response

okurashoichi avatar Feb 06 '26 09:02 okurashoichi

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/19527

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and πŸ‘ the existing issue instead
  • To prevent auto-closure, add a comment or πŸ‘Ž this comment

πŸ€– Generated with Claude Code

github-actions[bot] avatar Feb 06 '26 09:02 github-actions[bot]

I would almost classify this as a bug rather than an enhancement @okurashoichi . When clicking the main branch (base branch), it drops down a menu as if you are supposed to be able to select other branches, I just get an "unable to load branches" error every single time (nothing is wrong with my network connection either).

Image

p134c0d3 avatar Feb 27 '26 15:02 p134c0d3

I too am trying to compare against a different branch besides the main branch, and can't. This is pretty frustrating, since the UI is showing 541,973 lines changed instead of zero.

Image

shawwn avatar Mar 03 '26 07:03 shawwn

I thought I was the only one with this issue or that I was using the feature incorrectly. Exactly what @shawwn captured.

sergioironhack avatar Mar 06 '26 22:03 sergioironhack

Needed! +1

servatti avatar Mar 17 '26 19:03 servatti

More than that, I'd prefer the diff to simply be against HEAD. I want to review just the uncommitted changes I'm working on with the AI. Not everything possible that's been going on in the branch.

bradley-carestia-jbh avatar Mar 25 '26 15:03 bradley-carestia-jbh

More than that, I'd prefer the diff to simply be against HEAD. I want to review just the uncommitted changes I'm working on with the AI. Not everything possible that's been going on in the branch.

This would be amazing. +1 here Also my Claude Desktop app is totally unusable with the current behavior. The diff to the main branch in big enough codebases is often huge and for me opening the diff panel simply crashes the Claude Desktop app.

pereiraa15 avatar Apr 15 '26 13:04 pereiraa15

This is needed feature. This is why I still use Codex instead of Claude code.

pkranjcecx avatar May 08 '26 07:05 pkranjcecx

We're paying quite big subscriptions for a product which problems are being ignored by a company that, in theory, has access to god level models. This is a serious issue that makes this useless for any serious work

danielo515 avatar May 11 '26 05:05 danielo515

I'm genuinely confused about the current state of diff in Claude Code Desktop.

You've been heavily promoting parallel agent workflows with git worktrees β€” it's practically a flagship use case. But the diff view still only works against the main/master branch, which means it assumes your working branch IS your production branch. That's not how any real-world dev team operates.

The overwhelming majority of developers work on feature branches cut from a non-production base (develop, staging, trunk, whatever you call it). Worktree-based parallel agent workflows make this even more pronounced β€” each worktree is on its own branch by definition.

So I genuinely don't understand: if the diff can't resolve the correct base branch contextually, what's it actually showing? Diffs against main when you're three branches deep in a worktree are close to meaningless.

In the agentic coding era, being able to review what the agent actually changed β€” cleanly and accurately β€” is arguably THE most critical human-in-the-loop touchpoint. A diff view that doesn't work in the workflows you're actively encouraging feels like a pretty fundamental gap.

Not trying to be harsh, just actually confused about what I'm missing here. Is there a workaround, or is this a known limitation on the roadmap?

ChaeHyunIM avatar May 12 '26 08:05 ChaeHyunIM

The feature in its current state isn't usable for my workflow or for the rest of my company. Everyone has their own fork, and the diff appears to compare against origin rather than upstream/main.

jspdown avatar May 18 '26 18:05 jspdown

Our team uses release branches as the integration target, and the base shifts with the release cadence:

  • Feature work -> current release branch (e.g. release/v4.24.0, so called maintenance releases)
  • Hotfixes -> previous release branch (e.g. release/v4.23.x)
  • Bigger epics -> develop branch

Whenever the version rolls forward, the base for new feature branches moves with it. main/master is essentially never the right comparison target for us.

Strong +1 on a UI control. Even a simple "click the branch name in the diff header to pick a different one" per session would be enough.

alfeg avatar May 21 '26 04:05 alfeg

Not being able to customize the diff comparison branch is pretty frustrating. We work with branches as enviroments and main is VERY different from develop (which we work on)

Image

fm1randa avatar May 22 '26 00:05 fm1randa

+1 for this feature. Would love to be able to choose the base branch for diff comparison instead of always defaulting to main.

Yedev avatar May 27 '26 10:05 Yedev

Use case: Teams with a feature β†’ dev β†’ staging β†’ main flow. I start a web/mobile session from dev and my PR targets dev, but the session Diff view compares against main, so it shows ~15k lines (all of devβ€˜s already-merged history) instead of my ~600-line change. This makes the in-app diff unusable for review on any repo where the default branch isn’t the integration branch. Request: Either (a) a control to pick the diff base branch, or (b) β€” better as a default β€” diff against the branch the session was started from / the PR’s base branch, rather than the repo’s default branch.

marybrians-ixd avatar May 29 '26 15:05 marybrians-ixd

This is also related to the following bug reports that were ignored during automated processing. There are many other related issues as well. I hope you can address this soon. Thank you for your attention.

#51496 #48200 #45784 #27134 #61025 #48200 #61025 #48200

TasukuMatsuura avatar Jun 02 '26 03:06 TasukuMatsuura

In Codex, I was used to being able to see a diff against main, (my local main, of course, because it's insane to compare against origin/main), but also to be able to see a diff of just what was changed in the last turn, which as you're doing a review on a fairly big change, is really useful. Boggles the mind that the default in Claude Code is both illogical and that this issue is wanted by so many people, but ignored. It's also frustrating to see all the other auto-closed issues. The ones that are closed as duplicates is understandable. The ones that are closed as "not planned" just gives the wrong (extremely frustrating) impression.

davidgilbertson avatar Jun 11 '26 04:06 davidgilbertson

+1 for this feature. Choosing another base branch will significantly clean up the diff UI

ryanwebg avatar Jun 12 '26 17:06 ryanwebg

Waiting for this features because I'm working in multiple feature branches

mynavitechtus-thongtv avatar Jun 18 '26 09:06 mynavitechtus-thongtv

I really need this feature. Not being able to customize the branches for comparison is too strange and has caused confusion. If the selection feature isn't going to be developed, it would be better not to show the diff at all.

Starkxim avatar Jun 25 '26 07:06 Starkxim