claude-code - 💡(How to fix) Fix [FEATURE] Create PR button should support GitLab and other Git platforms [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48019Fetched 2026-04-15 06:35:40
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
1
Timeline (top)
commented ×2labeled ×2closed ×1

The built-in "Create PR" button in Claude Code is hardcoded to use GitHub (gh CLI). Projects hosted on GitLab (or other platforms like Bitbucket) cannot use this feature, even when CLAUDE.md explicitly instructs to use GitLab MCP tools for merge requests.

Root Cause

The built-in "Create PR" button in Claude Code is hardcoded to use GitHub (gh CLI). Projects hosted on GitLab (or other platforms like Bitbucket) cannot use this feature, even when CLAUDE.md explicitly instructs to use GitLab MCP tools for merge requests.

Fix Action

Fix / Workaround

  • The "Create PR" button always attempts to create a GitHub Pull Request
  • Projects using GitLab must rely on MCP tools (mcp__GitLab__create_merge_request) as a workaround
  • The CLAUDE.md instruction to use GitLab is ignored by the built-in UI action
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

Problem Statement

Summary

The built-in "Create PR" button in Claude Code is hardcoded to use GitHub (gh CLI). Projects hosted on GitLab (or other platforms like Bitbucket) cannot use this feature, even when CLAUDE.md explicitly instructs to use GitLab MCP tools for merge requests.

Current Behavior

  • The "Create PR" button always attempts to create a GitHub Pull Request
  • Projects using GitLab must rely on MCP tools (mcp__GitLab__create_merge_request) as a workaround
  • The CLAUDE.md instruction to use GitLab is ignored by the built-in UI action

Proposed Solution

Expected Behavior

The "Create PR" feature should be platform-agnostic:

  1. Auto-detect the Git remote platform from the repository's origin URL
  2. Route to the appropriate toolgh for GitHub, GitLab MCP/API for GitLab, etc.
  3. Respect project-level configuration — if CLAUDE.md specifies a preferred platform/tool for MRs, honor that

Suggested Approaches

  • Parse git remote get-url origin to detect the platform
  • Allow a configuration option in CLAUDE.md or .claude/settings.json to specify the MR/PR creation method
  • Fall back to the current GitHub behavior when no other platform is detected

Alternative Solutions

Alternatively use the configured MCP servers with the respective tools?

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

Context

This came up in a project hosted on a self-managed GitLab instance, where the "Create PR" button was unusable and all merge requests had to be created through GitLab MCP tools manually.

Co-Created with Claude, thx for the help

extent analysis

TL;DR

Modify the "Create PR" button to auto-detect the Git remote platform and route to the appropriate tool, respecting project-level configuration.

Guidance

  • Parse git remote get-url origin to detect the platform (e.g., GitHub, GitLab) and determine the correct tool to use for creating a PR or MR.
  • Introduce a configuration option in CLAUDE.md or .claude/settings.json to allow projects to specify their preferred platform/tool for MR/PR creation, providing flexibility and honoring project-specific settings.
  • Consider falling back to the current GitHub behavior when no other platform is detected to maintain existing functionality.
  • Evaluate using configured MCP servers with respective tools as an alternative solution to enhance compatibility with various Git platforms.

Example

# Example of parsing git remote URL to detect the platform
git_remote_url=$(git remote get-url origin)
if [[ $git_remote_url =~ "github" ]]; then
  # Use gh CLI for GitHub
elif [[ $git_remote_url =~ "gitlab" ]]; then
  # Use GitLab MCP/API for GitLab
fi

Notes

The implementation should consider handling different Git platforms and their respective APIs or tools for creating PRs/MRs, ensuring a seamless experience across various project hosts.

Recommendation

Apply a workaround by introducing platform detection and respecting project-level configuration to make the "Create PR" feature more versatile and useful across different Git hosting platforms.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Create PR button should support GitLab and other Git platforms [2 comments, 2 participants]