Read Full GitHub Context

lesson workflow active workflow/read-full-github-context.md View on GitHub

Read Full GitHub Context

Rule

NEVER truncate GitHub comment output. Read the ENTIRE thread chronologically before responding.

Context

Whenever reading GitHub issues or PRs via gh CLI, especially with --comments flag.

Detection

Observable signals of truncation:

Pattern

Read full output, no truncation:

# Issues: ALWAYS both views, no truncation
gh issue view <number>
gh issue view <number> --comments

# PRs: Full sequence including reviews, no truncation
gh pr view <pr-url>
gh pr view <pr-url> --comments
# ALSO check review comments (not included in --comments!)
gh api repos/<owner>/<repo>/pulls/<pr-number>/reviews --jq '.[] | {user: .user.login, state: .state}'
gh api repos/<owner>/<repo>/pulls/<pr-number>/comments --jq '.[] | {id, path, body: (.body | split("\n")[0])}'

After reading: Trace conversation chronologically. What is the LATEST request? Respond to current state, not old comments.

Anti-Pattern

# ❌ WRONG: Truncating loses newer context
gh issue view 123 --comments | head -50
gh pr view 456 --comments | tail -20

# ✅ CORRECT: Read everything
gh issue view 123 --comments

Truncation causes responding to OLD comments while missing NEWER replies that changed context.

Outcome

Related

Match Keywords

truncating github comment output respond to stale context when conversation evolved read entire issue thread before responding missing newer comments that supersede earlier gh pr view --comments | head not reading the whole issue