# GitHub Phantom Notifications (and How I Fixed It)

**TL;DR:** Three spammy “free money” issues mentioned my username. GitHub removed the issues, but a **phantom notification** stuck around: the badge count wouldn’t clear and the notifications list was empty. I contacted GitHub Support, learned why this can happen, and used their suggested workaround to mark everything as read via the API/CLI. The ghost is gone.

---

## What happened

One day I opened GitHub and saw a shiny badge on notifications. Cool—until I clicked it and… nothing. No unread items. The badge said I had a notification, the page said I didn’t. Schrödinger’s notification.

The backstory:

* There were **3 spam/fraud issues** (classic “free money” nonsense) that mentioned my username.
    
* I reported them and **GitHub deleted them**. ✅
    
* But the **notification badge** stayed stuck, with **no visible item** to click and mark as read. ❌
    

I tried all the usual tricks (open/close the tab, browser cache, check mobile vs. desktop, filters, etc.). No dice.

![](https://p20.zdusercontent.com/attachment/66681/ny1fkvcfEFTHO3Zur4lhlwljR?token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..LvhOm9lJulg6NECr1dqtAA.qcDT5BecVba9SLwUAHDCOFZak8qmqHgDlRmh1iHzFB_itwEtIFxPMKdAvm20QrB12EDxoFN0u0kKO7Gt7Ju1-j3L7uAt5vJKrZCyWeFaoVIj1Y48hgBRIzgFrffdmJOiG8b6JZfLJto1y0dJsHYQvAr-65Tj2cOBgEVeFtvvO-eSMBnMhxZ4LdDQ53Jui3lmg6cQuIeZye2prelghWEAkwGFrMrr-ZQ0kdota5PUkYTJelqnUXxveNUnbXk943LWM7WqAOW-j2ujHojBCkj2q0HOO3lXstgwsJHaBucFG8o.J8KHiLoMLCbB7b5c2Vl7pg align="left")

---

## What I told GitHub Support

I opened a ticket with this description:

> There were recently 3 spam fraud issues that said like "free money" and stuff that mentioned my username.  
> I reported them and GitHub deleted them.  
> But their notification remains in my notifications, but i can't mark them as read; because they don't show, just the number badge.  
> I want these notifications to be removed completely.
> 
> **Reproduction:** \[Don’t\] create a fraud issue that GitHub deletes and mention an account. The notification remains.

Short, honest, and to the point.

---

## What GitHub Support said

Support was responsive and helpful. The gist:

* **They’re investigating a bug** where a “phantom” notification can persist even after offending content is removed or hidden.
    
* One **likely cause**: the account that mentioned me was **flagged for ToS violations**, which hides their content (and apparently the notification item), creating a mismatch between the **badge count** and the **visible list**.
    
* **Workaround:** Mark all notifications as **read** via GitHub CLI or REST API. This doesn’t delete the underlying notification object, but it toggles its read state and often clears the stuck badge.  
    (They also noted a separate “1–0 of 1” UI oddity they’re investigating.)
    

They couldn’t promise a timeline for a full fix (fair enough), but they gave two practical commands.

---

## The workaround that cleared my badge

### Option A — GitHub CLI

```bash
gh api \
  --method PUT \
  -H "Accept: application/vnd.github+json" \
  /notifications \
  -F read=true
```

Requirements:

* The `gh` CLI installed and authenticated (`gh auth login`).
    

### Option B — cURL with a PAT

```bash
curl -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  -H "Authorization: token $TOKEN" \
  https://api.github.com/notifications
```

Requirements:

* A **Personal Access Token** with the `notifications` scope. Replace `$TOKEN` with your PAT.
    

I used the CLI route. Ran it once, refreshed GitHub… **phantom badge gone.** 🎉

---

## Why this happens (my understanding)

* When GitHub **hides or deletes** content from an account flagged for violations, parts of the system correctly hide the content to protect privacy and prevent further spread.
    
* But the **notification counter** can get **out of sync** if the underlying item is hidden/removed in a way that the UI can’t render.
    
* Marking everything as **read** via the API resets that state, so the badge and list agree again.
    

---

## If this happens to you

1. **Try the CLI command first.** It’s simple and safe (it just marks read).
    
2. If you prefer cURL, **create a PAT** with `notifications` scope and use the API call.
    
3. If the badge is still stuck, **contact GitHub Support** and reference that there’s a known phantom notification issue under investigation. Include any details (repo links, approximate timestamps, screenshots).
    

---

## Lessons learned

* Spam happens. The reporting tools work quickly.
    
* The **UI can lag** behind moderation actions. When in doubt, **use the API** to nudge state back into place.
    
* Keep a **PAT** around with minimal scopes you need (or use `gh`)—it’s surprisingly handy for situations like this.
    

---

## Credits

Huge thanks to GitHub Support for confirming the behavior, explaining the likely cause, and sharing a safe workaround while they investigate a broader fix.

---

If you’ve run into a similar phantom notification and this helped, ping me—I’m curious how widespread it is and which workaround worked for you.
