UI shows merged PRs as pending work items (false positives in suggested work view)

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened May 17, 2026 · closed May 18, 2026

Description

Claude Code's suggested work / inbox view displays merged pull requests as if they are open and require attention. This creates false positives that look like pending work.

Steps to reproduce

  1. Have one or more merged PRs in connected GitHub repositories
  2. Open Claude Code
  3. Observe that merged PRs appear in the work suggestions / inbox UI with no indication they are already merged

Expected behavior

Only open, unmerged PRs should appear as suggested work items. Merged PRs should be excluded.

Actual behavior

Merged PRs appear alongside open ones, indistinguishable from actual pending work. The UI shows repo name, PR number, and branch name but no merged/closed status indicator.

Context

  • Confirmed via gh pr view that all displayed PRs had state: MERGED
  • The branches had also already been deleted
  • Claude Code version: current (2026-05-17)
  • Platform: macOS

View original on GitHub ↗

4 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/48694
  2. https://github.com/anthropics/claude-code/issues/25369
  3. https://github.com/anthropics/claude-code/issues/48527

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

jshaofa-ui · 5 months ago

🔍 Root Cause Analysis & Fix

Problem

Claude Code's suggested work / inbox view displays merged PRs as pending work items. Users confirmed via gh pr view that displayed PRs had state: MERGED and branches already deleted.

Root Cause

The PR query used for suggested work items filters by repository/branch but does not include a state: open filter. The GitHub API's default PR listing behavior (without explicit state filter) returns all PRs regardless of state.

The likely code path:

  1. gh pr list --repo {repo} or GitHub API GET /repos/{owner}/{repo}/pulls without state=open
  2. Results include merged and closed PRs
  3. UI displays all returned PRs without checking state field

Fix Proposal

Quick Fix: Add state: open filter to the PR query

// Before:
const prs = await gh.pr.list({ repo })

// After:
const prs = await gh.pr.list({ repo, state: 'open' })

Robust Fix: Add state validation in the UI layer

// Filter merged/closed PRs before display
const suggestedWork = prs
  .filter(pr => pr.state === 'open' && pr.mergeable !== 'merged')
  .map(pr => ({ ...pr, status: 'pending' }))

Best Long-term: Use GitHub's is:pr is:open search query for suggested work

gh search prs "is:pr is:open author:@me" --json title,number,state,repo,url

Why This Works

  • GitHub API state parameter is the canonical way to filter PRs
  • Adding UI-layer validation ensures future API changes don't reintroduce the bug
  • Search query approach is more efficient for large repositories

Impact

  • Eliminates false positives in suggested work view
  • Reduces user confusion about which PRs actually need attention
  • Improves trust in the "suggested work" feature
MartijnVeldkamp · 5 months ago

Duplicate of #48694.

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.