claude-code - ✅(Solved) Fix PR status card disappears after `git branch -m` on session auto-branch [1 pull requests, 1 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#53359Fetched 2026-04-26 05:17:49
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×1cross-referenced ×1

Claude Code's PR/CI status card (the chip rendered in the input-area UI alongside the model/permissions row) disappears whenever the session's auto-created branch is renamed via git branch -m, and never recovers — even after a PR is opened from the renamed branch.

Root Cause

The rename flow is explicitly recommended in the default global instructions Anthropic ships:

Propose a task-relevant branch rename before doing any work … On confirmation, run git branch -m claude/<slug>. … The on-disk worktree directory keeps its random name; that's cosmetic. Everything that matters (git log, GitHub, PRs, gh pr list) reflects the new branch name.

So users who follow the recommended workflow lose the status card on every meaningful task — exactly the workflow the card is most useful for. Users who don't rename get the card but pollute their PR list with claude/charming-morse-7ed375-style branch names.

Fix Action

Workaround

For a given session, leaving the auto-branch name alone (and pushing the PR from claude/<adjective>-<word>-<hex>) keeps the card. There's no in-session recovery once the rename has happened.

PR fix notes

PR #11129: fix(react-ui-form): generic inline-create flow wires new ref into slot

Description (problem / solution / changelog)

Re-pushes the work from #11128 onto the session's auto-branch so the Claude Desktop status card tracks (the card is keyed off the auto-branch name — see anthropics/claude-code#53359).

Summary

The picker's "Create new" path persisted the new object to the database but never assigned it to the form slot, so any non-Tag.Tag ref-array (e.g. Magazine.feeds, Article.authors) silently dropped the user's input. Tag.Tag worked only because ObjectProperties.handleCreate had a type-specific branch that wrote the new tag's DXN to meta.tags directly.

This PR replaces that special-case with a single generic flow:

  • RefField lifts the picker's open state, awaits onCreate, writes a Ref to the new object into its slot via onValueChange, and dismisses the popover.
  • ObjectPicker.handleFormSave is now async and awaits onCreate, so consumers can complete persistence + slot wiring before the picker UI collapses.
  • ObjectProperties.handleCreate returns the newly-created object and no longer special-cases Tag.Tag. Tags follow the same path as any other ref-array now.
  • @dxos/schema/FactoryAnnotation (new): types whose required structure can't be produced by Obj.make(schema, values) alone (e.g. Subscription.Feed needs a backing EchoFeed.Feed ref) declare a custom factory; ObjectProperties.handleCreate consults it.
  • omitHiddenFormFields: the create-form schema now strips fields with FormInputAnnotation.set(false) so the form's validator doesn't reject required-but-hidden fields supplied by the factory.

Tests

ObjectProperties.test.tsx covers three cases via composeStories + RTL + OBJECT_PROPERTIES_DEBUG_SYMBOL:

  • Tag.Tag — regression for the path that worked before, now exercised through the generic flow.
  • non-Tag ref-array (Article.authors) — generic slot wiring.
  • hidden required ref + FactoryAnnotation (Note.backing) — mirrors Subscription.Feed's shape.

Test plan

  • moon run react-ui-form:test — 9 tests pass
  • moon run react-ui-form:build — clean
  • Downstream builds: plugin-feed, plugin-assistant, plugin-inbox, plugin-youtube — all clean

🤖 Generated with Claude Code

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

  • Bug Fixes

    • Post cards now render full-width.
    • Inline create form reliably dismisses after save.
  • New Features

    • Manual "Refresh" action to re-fetch article content (with pending state).
    • Create flows support async creation and return created objects; created items are persisted and reference wiring updated.
    • Inline create forms omit hidden fields.
    • Improved article extraction to trim trailing chrome content.
  • Tests / Documentation

    • Expanded stories and new integration tests cover create flows and hidden-field factory behavior.
    • Story renamed to remove repro framing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Changed files

  • packages/plugins/plugin-feed/package.json (modified, +1/-0)
  • packages/plugins/plugin-feed/src/capabilities/react-surface.tsx (modified, +6/-19)
  • packages/plugins/plugin-feed/src/components/PostContent/PostContent.test.ts (added, +81/-0)
  • packages/plugins/plugin-feed/src/components/PostContent/PostContent.tsx (modified, +50/-2)
  • packages/plugins/plugin-feed/src/components/PostStack/PostStack.tsx (modified, +10/-12)
  • packages/plugins/plugin-feed/src/containers/MagazineArticle/MagazineArticle.stories.tsx (modified, +143/-0)
  • packages/plugins/plugin-feed/src/containers/MagazineArticle/MagazineArticle.tsx (modified, +177/-18)
  • packages/plugins/plugin-feed/src/containers/MagazineArticle/MagazineTile.tsx (modified, +130/-25)
  • packages/plugins/plugin-feed/src/containers/PostArticle/PostArticle.tsx (modified, +41/-2)
  • packages/plugins/plugin-feed/src/operations/curate-magazine.test.ts (added, +324/-0)
  • packages/plugins/plugin-feed/src/operations/curate-magazine.ts (modified, +130/-66)
  • packages/plugins/plugin-feed/src/operations/sync-feed.ts (modified, +14/-1)
  • packages/plugins/plugin-feed/src/operations/util.test.ts (added, +81/-0)
  • packages/plugins/plugin-feed/src/operations/util.ts (modified, +37/-1)
  • packages/plugins/plugin-feed/src/stories/ArticleExtractor.stories.tsx (modified, +72/-60)
  • packages/plugins/plugin-feed/src/stories/MagazineProperties.stories.tsx (modified, +56/-31)
  • packages/plugins/plugin-feed/src/translations.ts (modified, +3/-0)
  • packages/plugins/plugin-feed/src/types/Magazine.ts (modified, +12/-0)
  • packages/plugins/plugin-feed/src/types/Subscription.ts (modified, +26/-1)
  • packages/plugins/plugin-feed/src/util/extract-article.test.ts (added, +154/-0)
  • packages/plugins/plugin-feed/src/util/extract-article.ts (modified, +179/-0)
  • packages/plugins/plugin-feed/src/util/star-tag.ts (modified, +7/-2)
  • packages/plugins/plugin-feed/tsconfig.json (modified, +3/-0)
  • packages/plugins/plugin-feed/vitest.config.ts (modified, +3/-1)
  • packages/sdk/schema/src/annotations/factory.ts (added, +27/-0)
  • packages/sdk/schema/src/annotations/index.ts (modified, +1/-0)
  • packages/ui/react-ui-form/src/components/Form/Form.tsx (modified, +16/-0)
  • packages/ui/react-ui-form/src/components/Form/fields/RefField.tsx (modified, +40/-10)
  • packages/ui/react-ui-form/src/components/ObjectPicker/ObjectPicker.tsx (modified, +10/-3)
  • packages/ui/react-ui-form/src/components/ObjectProperties/ObjectProperties.stories.tsx (modified, +319/-21)
  • packages/ui/react-ui-form/src/components/ObjectProperties/ObjectProperties.test.tsx (added, +101/-0)
  • packages/ui/react-ui-form/src/components/ObjectProperties/ObjectProperties.tsx (modified, +21/-10)
  • packages/ui/react-ui-form/src/components/testing.tsx (modified, +1/-0)
  • packages/ui/react-ui-markdown/src/MarkdownViewer/MarkdownViewer.tsx (modified, +1/-1)
  • packages/ui/react-ui-syntax-highlighter/src/SyntaxHighlighter/SyntaxHighlighter.stories.tsx (modified, +2/-2)
  • packages/ui/react-ui-syntax-highlighter/src/SyntaxHighlighter/SyntaxHighlighter.tsx (modified, +42/-20)
  • packages/ui/react-ui/src/testing/decorators/withLayout.tsx (modified, +1/-1)
  • packages/ui/ui-theme/src/util/mx.ts (modified, +3/-3)
  • pnpm-lock.yaml (modified, +11/-16)

Code Example

git branch -m claude/<task-slug>
RAW_BUFFERClick to expand / collapse

Summary

Claude Code's PR/CI status card (the chip rendered in the input-area UI alongside the model/permissions row) disappears whenever the session's auto-created branch is renamed via git branch -m, and never recovers — even after a PR is opened from the renamed branch.

Repro

  1. Start a fresh session in a project that has the auto-worktree convention enabled. The harness creates a worktree at .claude/worktrees/<adjective>-<word>-<hex>/ on branch claude/<adjective>-<word>-<hex>.
  2. Per the standard "rename to a task slug" guidance (which the global Claude CLAUDE.md actively recommends), run from inside that worktree:
    git branch -m claude/<task-slug>
  3. Continue working, push the branch, open a PR with gh pr create.

Expected: the PR status card appears in the UI, tracking the new branch's PR (URL, CI state).

Actual: the card never appears. Subsequent calls to gh pr create and <pr-created>...</pr-created> tags emitted by the assistant do not surface a card. Closing/reopening the session doesn't recover it. The PR itself is fine on GitHub; only the UI card is broken.

Probable cause

The UI seems to look up the session's PR by the original auto-branch name (claude/<adjective>-<word>-<hex>), not by the worktree path or the current branch. Once git branch -m runs, that key no longer matches anything on the remote, so the lookup permanently fails.

Why this matters

The rename flow is explicitly recommended in the default global instructions Anthropic ships:

Propose a task-relevant branch rename before doing any work … On confirmation, run git branch -m claude/<slug>. … The on-disk worktree directory keeps its random name; that's cosmetic. Everything that matters (git log, GitHub, PRs, gh pr list) reflects the new branch name.

So users who follow the recommended workflow lose the status card on every meaningful task — exactly the workflow the card is most useful for. Users who don't rename get the card but pollute their PR list with claude/charming-morse-7ed375-style branch names.

Suggested fixes (any of)

  1. Key the status card off the worktree path (which is stable) instead of the branch name.
  2. Update the lookup to follow git branch -m events (e.g. by listening to local branch changes and updating the cached identity).
  3. If neither is feasible, update the recommended-flow guidance in the default global instructions to either (a) discourage git branch -m for the auto-branch, or (b) clearly state that renaming costs the status card.

Workaround

For a given session, leaving the auto-branch name alone (and pushing the PR from claude/<adjective>-<word>-<hex>) keeps the card. There's no in-session recovery once the rename has happened.

Environment

  • Claude Code Desktop, Opus 4.7 (1M context).
  • macOS, observed across multiple sessions and projects.

extent analysis

TL;DR

The status card disappearance can be fixed by keying it off the stable worktree path instead of the branch name.

Guidance

  • Update the lookup to use the worktree path, which remains unchanged after a branch rename, to ensure the status card continues to track the correct branch.
  • Consider listening to local branch change events to update the cached identity and maintain the status card's functionality.
  • As a temporary workaround, avoid renaming the auto-created branch to preserve the status card, or update the recommended workflow guidance to reflect the potential loss of the status card after renaming.

Example

No code snippet is provided as the issue is more related to the logic and workflow rather than a specific code implementation.

Notes

The suggested fixes require changes to how the status card is implemented and tracked, which may involve updates to the Claude Code Desktop application. The workaround provides a temporary solution but may not be ideal for users who prefer to follow the recommended renaming workflow.

Recommendation

Apply workaround: Avoid renaming the auto-created branch to preserve the status card, as this is the most straightforward solution that does not require any changes to the application. This approach ensures that the status card continues to function as expected, although it may not be the most desirable solution in terms of branch naming conventions.

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