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.
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
gh api \
--method PUT \
-H "Accept: application/vnd.github+json" \
/notifications \
-F read=true
Requirements:
- The
ghCLI installed and authenticated (gh auth login).
Option B — cURL with a PAT
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
notificationsscope. Replace$TOKENwith 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
Try the CLI command first. It’s simple and safe (it just marks read).
If you prefer cURL, create a PAT with
notificationsscope and use the API call.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.