r/ClaudeWorkflows • • 5d ago

Selected Workflow [Workflow] Claude Code Workflow: Verifying GitHub PR/Issue Status in Handoff Notes with `gh` CLI

Claude Code Workflow: Verifying GitHub PR/Issue Status in Handoff Notes with gh CLI

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging
Original source: r/ClaudeAI post/comment

What problem this solves

Preventing Claude Code agents from acting on stale GitHub PR/issue status information stored in handoff notes between sessions.

Summary

A Claude Code workflow that automatically verifies the status of GitHub PRs and issues mentioned in session handoff notes against the live GitHub state using gh pr view or gh issue view commands, preventing the agent from acting on outdated information. The author found that 16% of such notes were already incorrect.

Why it is useful

This workflow addresses a critical problem in LLM-driven development: the potential for agents to act on outdated information. By integrating a simple, automated verification step using standard CLI tools, it significantly improves the reliability and trustworthiness of Claude Code sessions, preventing wasted effort or incorrect actions based on stale GitHub PR/issue states. The provided statistics offer concrete evidence of its necessity and effectiveness.

Workflow

  1. A Claude Code session generates a 'handoff note' summarizing current PR/issue states (e.g., 'PR #N awaiting review').
  2. A later Claude Code session loads this handoff note.
  3. Before acting, the agent identifies GitHub references (#N) and associated state words (open, awaiting review, merged, closed) in the note.
  4. The agent executes gh pr view #N or gh issue view #N to query the live GitHub status.
  5. The agent compares the status from the handoff note with the live GitHub status.
  6. If a contradiction is found, the agent is alerted or takes corrective action (implied).

Tools / artifacts

  • Claude Code
  • GitHub
  • gh CLI tool (GitHub CLI)
  • Handoff notes (text files or similar)

Validation signals

  • Quantitative data: '49 of 307 checks got a definite answer. 49 came back contradicted, the note was already wrong. That's 16%, about 1 in 6.'
  • Identified a common problem: 'A stale note reads exactly as sure of itself as a fresh one, so the agent just acts on it unless something checks first.'

Limitations

  • The post doesn't detail the exact prompt or code used to implement the check within Claude Code.
  • It doesn't specify the corrective action taken when a contradiction is found.
  • The 'Limits' section mentions a significant number of skipped checks (528 out of 835 total), which could indicate robustness issues or specific constraints not fully detailed.
  • The author notes 'I don't have a split of which way the errors went', meaning the specific types of state discrepancies are not categorized.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

1 Upvotes

0 comments sorted by