pr-context-cache

A cache for the information collected about a GitHub pull request, such as its description, code changes, linked issues, and test status. A pull request is a proposed change that others review before it is merged.

In plain words
What is it for?
Use it during pull-request reviews to fetch context once, save it in the review record, and reuse it in later review rounds.
Why use it?
It avoids fetching the same pull-request information again during a later review when the source and code changes have not changed.

Skill for Claude CodeCodex

Part of the maigo plugin — 23 skills, 15 commands, 5 agents, 4 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lee-w/maigo/pr-context-cache
Any agent
npx skills add Lee-W/maigo --skill pr-context-cache
Clone the repo
git clone --depth 1 https://github.com/Lee-W/maigo

Made for: Claude Code, Codex.

Or install maigo, the plugin that ships this one along with the rest of its 23 skills, 15 commands, 5 agents, 4 hooks.

Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,099 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.01099
Opus 5 $0.00029 $0.00549
Sonnet 5 $0.00012 $0.00220
Haiku 4.5 $0.00006 $0.00110

Measured 3d ago against content hash 915e1dac5f58, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pr-context-cache scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/pr-context-cache/SKILL.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PR Context Cache

Owner Agent: Raana Consumers: /maigo:review step 1

Why this skill exists

/maigo:review 的第一步是 Raana 抓 PR context。「re-review」(同一個 PR 改完再跑一次) 時這些資料幾乎沒變——重抓只是浪費時間。第一次 fetch 後 cache 到本次的 review rubric 檔開頭的機讀區段,re-review 偵測同 source 且 diff sha 未變 → 直接還原,跳過全部 gh / git 重抓。rubric 檔路徑不再固定:省略 --rubric 時 script 會依 source 呼叫 scripts/artifact_path.py 算出 .maigo/review-rubric-<id>.md(歸屬規則見 artifact-ownership)。

怎麼跑

機械流程由 script 代勞(cache 偵測 / 驗證 / fetch / truncate / 寫檔一條龍):

python3 "${CLAUDE_PLUGIN_ROOT:-.}/scripts/pr_context_cache.py" <source> \
    [--rubric PATH] [--base main]
  • <source>:GitHub PR URL / PR 編號(需要 gh CLI)、本地 branch 名、或 commit range
  • 在 maigo repo 自身工作時,直接 python3 scripts/pr_context_cache.py 即可
  • 省略 --rubric 是預設用法——script 自動算路徑;只有需要覆寫既有檔案時才傳 --rubric

stdout 第一行是 cache_hit: true|false,第二行 rubric: <path>,其後是 cache 區段全文—— 含 Source / PR number / Title / Body(截 500 行)/ Linked issues / CI status / Diff stat / Review threads(inline review thread,含 resolve 狀態)/ Review summaries(gh pr view --json reviews)/ Conversation comments(gh pr view --json comments / Diff sha / Full diff(截 2000 行)。

Review threads / summaries / comments 只在 <source> 是 PR 時抓(branch / range diff 沒有對應的 GitHub review thread 可抓)。未解決([OPEN])的 thread 在輸出 裡會被特別標出——下結論前先檢查這些 thread 對照目前 diff 是否已經處理, 避免漏看 reviewer 留下但尚未收斂的架構意見(真實事故:只抓 diff + PR body + reviewDecision,漏看某 PR 上一位 reviewer 對 isinstance-based type-switch 設計 留下的 OPEN thread,直到使用者問「有沒有看 TP 說了什麼」才補回)。

行為摘要

  • cache hit(Source 相同且 diff sha256 未變)→ 印出快取區段,不碰網路(除了重算 sha 的那次 diff)
  • cache miss → 重抓全部欄位,寫回 rubric 開頭 <!-- pr-context-cache:start v1 --><!-- pr-context-cache:end --> 區段 (無檔案 → 建立;無區段 → prepend;有舊區段 → 整段取代)

Read the full file on GitHub · 69 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 69 lines · 58 tokens per session scan A 915e1dac5f58

Subscribe to this mod's changes

pr-context-cache is a skill published in the GitHub repository Lee-W/maigo (14 stars, last pushed 9d ago), licensed MIT. It adds 58 tokens to every session and 1,099 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens