2 bugs closed as fixed fired again yesterday
Which of these should I act on?
7 issues marked Done last week have no merged PR. 4 merged PRs have no issue. 2 bugs closed as fixed fired again yesterday in Sentry.
Every Monday: issues closed without a merged PR, PRs merged without an issue, and closed bugs whose Sentry error fired again, with a question on what to fix.
What lands on your board
Which of these should I act on?
7 issues marked Done last week have no merged PR. 4 merged PRs have no issue. 2 bugs closed as fixed fired again yesterday in Sentry.
For PMs and engineering leads who report progress from the tracker and trust it to match what shipped. It drifts quietly: an issue gets dragged to Done in planning, a hotfix merges with no ticket, a bug is closed as fixed while its error keeps firing in Sentry. Each tool looks clean on its own.
Every Monday the agent reads the issue keys out of branch names, PR titles and bodies, checks them against the issues closed last week both ways, and looks up the Sentry errors linked to recently closed bugs. You get three short lists and a question on which to act.
From whichever tracker you use. Linear: query issues filtered on completedAt in the last 7 days and workflow state type completed, with identifier, title, branchName, labels, assignee, completedAt and attachments { url }. Jira: statusCategory = Done AND resolved >= -7d through GET /rest/api/3/search/jql. Drop issues labeled as non-code work (design, ops, no-code).
Run gh pr list --repo <owner/repo> --state merged --search "merged:>=<14 days ago>" --json number,title,body,headRefName,mergedAt,author,url and the same with --state open. The 14-day window catches PRs that merged before their issue was closed.
Parse keys from each PR's branch, title and body with \b[A-Za-z][A-Za-z0-9]+-\d+\b, uppercase them and keep only your team prefixes (Linear branch names like jane/eng-412-sso-toggle are lowercase). Add the Linear side: attachments whose URL is a GitHub pull request, and exact matches of branchName to headRefName. Done issues with no merged PR are drift (note when only an open PR exists); merged PRs with no key are drift too, except bot PRs (authors ending in [bot]).
For bugs closed in the last 30 days, take Sentry links from Linear attachments (or Jira remote links via GET /rest/api/3/issue/{key}/remotelink and the description). Fetch each with GET /api/0/organizations/{org}/issues/{issue_id}/. The bug came back when lastSeen is later than the tracker's close time and the issue had events in the last 24 hours.
Post the three lists as an ask. On the answer: reopen the regressed bugs with the Sentry counts in a comment, comment on unticketed PRs asking for the issue key, or comment on the Done issues asking the assignee for the PR. Change nothing without the answer.
With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.
Pick your agent, where the data comes from and how to schedule it; the commands below follow.
One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.
shellcurl -fsSL https://briefkin.dev/skills/linear-issue-code-error-drift/install | shAsk Claude Code:
promptRun the linear-issue-code-error-drift skillOr paste the prompt instead of installing:
promptCheck drift between Linear (or Jira), GitHub and Sentry. Get issues completed in the last 7 days, skipping non-code labels, with their identifier, branch name and attachments. Get PRs merged in <owner/repo> in the last 14 days plus open PRs, with branch, title and body. Parse issue keys from branch, title and body with the regex [A-Za-z][A-Za-z0-9]+-\d+, uppercase them, and also use Linear attachments that point to a GitHub PR. List Done issues with no merged PR (say if only an open PR exists) and merged PRs with no issue key (skip bot authors). Then, for bugs closed in the last 30 days, follow their Sentry links and list those whose Sentry issue was last seen after the close and had events in the last 24 hours. Show three short lists and ask me which to act on; change nothing until I answer.Mondays at 9:30, from cron on any machine where Claude Code is signed in:
crontab30 9 * * 1 claude -p "Run the linear-issue-code-error-drift skill"Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.
Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a question for you. How setup works
SKILL.md---
name: linear-issue-code-error-drift
description: "Every Monday: issues closed without a merged PR, PRs merged without an issue, and closed bugs whose Sentry error fired again, with a question on what to fix. Use when the user asks for this, or when it runs on a schedule."
---
# Issue, code and error drift: Linear, GitHub and Sentry
Every Monday: issues closed without a merged PR, PRs merged without an issue, and closed bugs whose Sentry error fired again, with a question on what to fix.
For PMs and engineering leads who report progress from the tracker and trust it to match what shipped. It drifts quietly: an issue gets dragged to Done in planning, a hotfix merges with no ticket, a bug is closed as fixed while its error keeps firing in Sentry. Each tool looks clean on its own.
Every Monday the agent reads the issue keys out of branch names, PR titles and bodies, checks them against the issues closed last week both ways, and looks up the Sentry errors linked to recently closed bugs. You get three short lists and a question on which to act.
## Two ways to get the data
Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.
## Route A: API or MCP server
### What you need
- The shared key: issue keys such as `ENG-412` in branch names or PR titles, or Linear's GitHub integration linking PRs to issues.
- Read access to Linear (MCP server or `LINEAR_API_KEY`) or Jira (`JIRA_API_TOKEN`), and write access only if it should reopen or comment; `gh` with read access to pull requests.
- A Sentry token with `event:read`, or the Sentry MCP server, and Sentry issues linked to the bugs (through the Linear or Jira integration, or a link in the issue).
If something is missing, say what and stop; do not invent numbers.
### Steps
1. **Pull issues closed last week** (Linear): From whichever tracker you use. Linear: query `issues` filtered on `completedAt` in the last 7 days and workflow state type `completed`, with `identifier`, `title`, `branchName`, `labels`, `assignee`, `completedAt` and `attachments { url }`. Jira: `statusCategory = Done AND resolved >= -7d` through `GET /rest/api/3/search/jql`. Drop issues labeled as non-code work (design, ops, `no-code`).
2. **Pull merged and open PRs** (GitHub): Run `gh pr list --repo <owner/repo> --state merged --search "merged:>=<14 days ago>" --json number,title,body,headRefName,mergedAt,author,url` and the same with `--state open`. The 14-day window catches PRs that merged before their issue was closed.
3. **Join on the issue key, both ways**: Parse keys from each PR's branch, title and body with `\b[A-Za-z][A-Za-z0-9]+-\d+\b`, uppercase them and keep only your team prefixes (Linear branch names like `jane/eng-412-sso-toggle` are lowercase). Add the Linear side: attachments whose URL is a GitHub pull request, and exact matches of `branchName` to `headRefName`. Done issues with no merged PR are drift (note when only an open PR exists); merged PRs with no key are drift too, except bot PRs (authors ending in `[bot]`).
4. **Check closed bugs for a comeback** (Sentry): For bugs closed in the last 30 days, take Sentry links from Linear attachments (or Jira remote links via `GET /rest/api/3/issue/{key}/remotelink` and the description). Fetch each with `GET /api/0/organizations/{org}/issues/{issue_id}/`. The bug came back when `lastSeen` is later than the tracker's close time and the issue had events in the last 24 hours.
5. **Ask, then act** (Linear): Post the three lists as an ask. On the answer: reopen the regressed bugs with the Sentry counts in a comment, comment on unticketed PRs asking for the issue key, or comment on the Done issues asking the assignee for the PR. Change nothing without the answer.
## Route B: the browser
### What you need
- Signed in to Linear or Jira, GitHub and Sentry with read access to the team, repository and organization; reopening issues needs a role that can edit them.
If something is missing, say what and stop; do not invent numbers.
### Steps
Start at https://linear.app/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.
1. **List issues closed last week**: In Linear, open the team's issues, filter Status to the Done states and add a filter on completed date for the last 7 days. For each issue, note the identifier and whether its sidebar shows a linked pull request and whether it is merged. On Jira, run `statusCategory = Done AND resolved >= -7d` in the issue search and read each issue's Development panel.
2. **List merged PRs**: Open `https://github.com/pulls` and search `is:pr is:merged merged:>=<14 days ago> repo:<owner/repo>`. Note each PR's number, title and branch name (shown at the top of the PR).
3. **Match the keys**: Read issue keys like `ENG-412` from each PR's branch, title and description, ignoring case. List Done issues with no merged PR, and merged PRs with no key, skipping PRs opened by bots.
4. **Check closed bugs in Sentry**: For bugs closed in the last 30 days that link to a Sentry issue, open the link and read **Last Seen** and the events chart for the last 24 hours. The bug is back if it was seen after the close date.
5. **Ask before changing anything**: Report the three lists and ask which to act on. Reopen bugs or leave comments only after the answer.
Note: Linear's sidebar only shows PRs its GitHub integration linked, so the key match on GitHub is still needed. Checking 30 to 50 items by hand takes a while; past that, the API route is the better one.
## The report
- **Done, no merged PR**: issues closed last week with no merged code, and any with only an open PR.
- **Merged, no issue**: PRs with no issue key in branch, title or body.
- **Back after fixed**: closed bugs whose Sentry issue had events after the close, with yesterday's count.
- The ask: which list to act on. Start with the bugs that came back, since users are hitting them now.
## Post it to Briefkin
When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.
```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
-H "authorization: Bearer $BRIEFKIN_TOKEN" \
-H "content-type: application/json" \
-d @- <<'JSON'
{
"v": 1,
"event_id": "linear-issue-code-error-drift/<date of this run, e.g. 2026-10-16>",
"item_key": "linear-issue-code-error-drift",
"project": "acme-web",
"source": "Issue, code and error drift: Linear, GitHub and Sentry skill",
"kind": "action",
"title": "2 bugs closed as fixed fired again yesterday",
"summary": "**7 issues** marked Done last week have no merged PR. **4 merged PRs** have no issue. **2 bugs** closed as fixed fired again yesterday in Sentry.",
"action": {
"request": "Which of these should I act on?",
"options": [
"Reopen the 2 bugs",
"Comment on the 4 PRs",
"Ask about the 7 Done issues",
"All three",
"Nothing this week"
]
},
"widget": [
{
"type": "Table",
"props": {
"columns": [
"Finding",
"Item",
"Detail"
],
"rows": [
[
"Back after fixed",
"ENG-397 Crash on empty cart",
"Closed Oct 14; WEB-3K2 had 38 events yesterday"
],
[
"Back after fixed",
"ENG-402 Duplicate webhook delivery",
"Closed Oct 19; API-1F9 had 12 events yesterday"
],
[
"Done, no PR",
"ENG-412 SSO toggle in settings",
"Only an open PR (233)"
],
[
"Done, no PR",
"ENG-418 CSV export time zone",
"No PR found"
],
[
"Done, no PR",
"ENG-421 Retry failed invoices",
"No PR found"
],
[
"Done, no PR",
"ENG-425 Empty state for reports",
"Only an open PR (236)"
],
[
"Done, no PR",
"ENG-430 Rate limit login",
"No PR found"
],
[
"Done, no PR",
"ENG-433 Audit log export",
"No PR found"
],
[
"Done, no PR",
"ENG-436 Billing email copy",
"No PR found"
],
[
"Merged, no issue",
"PR 228 Bump checkout timeout to 30s",
"Branch hotfix/timeout"
],
[
"Merged, no issue",
"PR 231 Refactor invoice mailer",
"Branch refactor-mailer"
],
[
"Merged, no issue",
"PR 235 Fix null plan on downgrade",
"Branch fix-downgrade"
],
[
"Merged, no issue",
"PR 238 Add rate limit to /api/export",
"Branch export-limit"
]
]
}
}
]
}
JSON
```
Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.
## Run it on a schedule
Suggested: Mondays at 9:30 (`30 9 * * 1`). From cron, with the agent signed in on that machine:
```bash
30 9 * * 1 claude -p "Run the linear-issue-code-error-drift skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```
Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/linear-issue-code-error-drift#schedule
Source: https://briefkin.dev/skills/linear-issue-code-error-drift
The shared key: issue keys such as ENG-412 in branch names or PR titles, or Linear's GitHub integration linking PRs to issues.
Read access to Linear (MCP server or LINEAR_API_KEY) or Jira (JIRA_API_TOKEN), and write access only if it should reopen or comment; gh with read access to pull requests.
A Sentry token with event:read, or the Sentry MCP server, and Sentry issues linked to the bugs (through the Linear or Jira integration, or a link in the issue).
https://mcp.linear.app/mcp. Add Linear from Claude's connector directory, or run claude mcp add --transport http linear https://mcp.linear.app/mcp in Claude Code, and sign in with OAuth.LINEAR_API_KEY, and send it as the Authorization header with no Bearer prefix. For a workspace bot, an OAuth app with the read scope does the same job.When you create the key, give it Read access and only the teams in the report; it then can't create or edit issues.
https://mcp.atlassian.com/v2/mcp. In Claude, add the Atlassian connector from the directory; in Claude Code, run claude mcp add --transport http atlassian https://mcp.atlassian.com/v2/mcp and authenticate with /mcp. It signs in with OAuth 2.1 or an API token and respects your Jira permissions (getting started).acli jira auth login, acli jira workitem search --jql "sprint in openSprints()" --json returns the same issues from a terminal.JIRA_EMAIL, JIRA_API_TOKEN and JIRA_BASE_URL (https://acme.atlassian.net) and uses basic auth. A scoped token limited to read:jira-work and read:jira-user is narrower; scoped tokens call https://api.atlassian.com/ex/jira/{cloudId} instead of your site URL.A classic token can do anything your account can, so prefer a scoped token with read scopes only, or an account that just has Browse permission on the projects in the report.
https://api.githubcopilot.com/mcp/. Sign in with OAuth or a personal access token; add /readonly to the URL, or use a toolset URL such as https://api.githubcopilot.com/mcp/x/pull_requests/readonly, to expose only read tools. It also runs locally (source).gh CLI. Run gh auth login once, or set GH_TOKEN for scheduled runs. gh pr list --search "review-requested:@me" --json number,title,url,createdAt and gh api repos/{owner}/{repo}/dependabot/alerts cover most reports.GITHUB_TOKEN, limit it to the repositories in the report, and grant Read on Metadata, Contents, Pull requests and Issues, plus Dependabot alerts if you report on them.With every permission on a fine-grained token set to Read, the agent can't push, merge, comment or close anything.
https://mcp.sentry.dev/mcp, signed in with OAuth. Add Sentry from Claude's connector directory, or run claude mcp add --transport http sentry https://mcp.sentry.dev/mcp. It searches issues and events and pulls stack traces.sentry-cli. Mostly a release and source map tool, but sentry-cli issues list --project <slug> lists issues when a quick terminal check is enough.SENTRY_AUTH_TOKEN with SENTRY_ORG, and grant org:read, project:read and event:read.Those three read scopes cover every report here; leave out event:write, which lets a token resolve and assign issues.
Then the agent leans on the second source: Linear's GitHub integration links a PR to an issue when the issue ID is in the branch name or PR title, or follows a magic word such as Fixes in the description, or when someone links them by hand. With neither, every PR shows up as unticketed. Copying Linear's suggested branch name (Cmd/Ctrl+Shift+.) fixes that going forward.
The check compares Sentry's last seen time with the date the bug was closed in the tracker, not Sentry's own status. An error can be resolved in Sentry, fire again in a new release and be marked regressed there, while the tracker still says Done. The card shows yesterday's event count so you can tell a stray event from a real return.
No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a asks you, so you can glance at it instead of asking again.
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.
Yes. Switch the data source to "Your browser" and the steps change to the Linear, Jira, GitHub and Sentry pages themselves: the agent opens linear.app in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.
Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.
Free during the open beta. No card.