Executive Summary
- 4 runs sampled (all completed), covering 4 distinct workflows: PR Sous Chef, Matt Pocock Skills Reviewer, Impeccable Skills Reviewer, Issue Monster.
- Median first-request proxy size (prompt.txt, since sandbox firewall/session event logs were not readable under this run's restricted permissions): ~22.2K chars; P95: 24.8K chars (largest sampled: Issue Monster at 37.5K chars).
- Highest-leverage finding: PR Sous Chef shows a Working-Set Rebuild Factor (WSRF) of 12.17x — its ~45K peak-token context is being resent almost every turn across 15 invocations (550K cumulative vs 45K peak), the clearest sign of avoidable re-sent ambient context in the sample.
- Two PR-review workflows (Matt Pocock, Impeccable) each unconditionally bundle multiple full skill sets even though only 1–2 are used per run.
Highest-Leverage Changes
- Reduce PR Sous Chef's per-turn context rebuild (WSRF 12.17x) by trimming what the
pr-processor sub-agent resends each invocation and caching static PR context instead of re-declaring it every turn.
- Trim Matt Pocock Skills Reviewer's
skills: list (5 full skill packages imported unconditionally) to lazy/on-demand loading based on detected change type, matching the "Select Skills" step it already documents.
- Move Impeccable Skills Reviewer's inline mode table + fallback guidance into the imported
impeccable skill so it's loaded once rather than duplicated inline in every run's first request.
- Simplify Issue Monster's oversized
steps: block (rate-limit GraphQL probing logic) — it is deterministic bookkeeping that inflates the compiled prompt/workflow body without needing agent reasoning.
- Configure explicit GitHub MCP toolsets scoping (already partially done) and confirm
cli-proxy: true is set consistently across all 4 sampled workflows to avoid raw gh-CLI-oriented wording bleeding into prompts.
CI-Validation Checklist for Implementing Agents
Any agent implementing workflow-file recommendations must complete every item below before opening a PR:
Key Metrics
| Metric |
Value |
| Sampled runs |
4 |
| Distinct workflows |
4 |
| Median chars |
22,208 |
| P95 chars |
24,824 |
| Largest sampled request |
Issue Monster — 37,473 chars |
| Merged optimizer PRs (7d) |
0 |
| Closed optimizer PRs (7d) |
0 |
| Optimizer PR close-rate (7d) |
n/a (insufficient settled PRs, <3) |
| WSRF (audited runs) |
PR Sous Chef 12.17x; Matt Pocock 1.07x |
Per-Run First-Request Metrics
| Run |
Workflow |
Conclusion |
Request chars (proxy) |
Input tokens |
char/token |
WSRF |
AIC |
| §34518723997 |
Matt Pocock Skills Reviewer |
success |
19,593 |
7,308 |
2.68 |
1.07 |
100.4 |
| §34520309155 |
PR Sous Chef |
success |
24,824 |
8,882 |
2.79 |
12.17 |
27.4 |
| 34518724065 |
Impeccable Skills Reviewer |
success |
14,021 |
5,332 |
2.63 |
1.01 |
70.0 |
| §34521691967 |
Issue Monster |
failure |
37,473 |
n/a |
n/a |
n/a |
n/a |
Note: request_chars uses prompt.txt size as a fallback proxy — the canonical sandbox/firewall/logs/api-proxy-logs and sandbox/agent/logs/copilot-session-state paths for other runs were not readable from this sandboxed session (read-only/permission-denied on /tmp/gh-aw/aw-mcp/logs/run-*), so this report is best-effort from audit MCP metrics only.
Repeated Ambient Context Signals
- Matt Pocock Skills Reviewer imports 5 full skill packages (
diagnosing-bugs, tdd, improve-codebase-architecture, grill-with-docs, codebase-design) unconditionally in front-matter, but its own "Step 3: Identify Change Type and Select Skills" logic implies only 1–2 are typically relevant per PR.
- Impeccable Skills Reviewer inlines a 6-row review-mode selection table plus fallback instructions directly in the workflow body rather than in the imported
impeccable skill, duplicating content that's also available via the installed SKILL.md.
- Issue Monster's
steps: block contains ~90 lines of deterministic GraphQL rate-limit-probing JS that doesn't need to be in the agent-facing prompt path — it's pure pre-processing.
- PR Sous Chef's
pr-processor sub-agent has a WSRF of 12.17 (550K cumulative vs 45K peak input tokens across only 15 invocations) — strongly suggests full context (PR diff/candidate list) is being redeclared each turn instead of referenced incrementally.
Deterministic Analysis Output
analyze_requests.py (stdlib only) computed per-run and aggregate metrics from the 4 sampled run-*.json metadata files (derived from audit MCP prompt_analysis, metrics.ambient_context, and metrics.working_set, since raw request text was inaccessible this run):
- Median request size 22,208 chars; P95 24,824 chars.
- Char-to-token ratio consistent (~2.6–2.8) across the 3 successful runs with token data — no anomalous inflation there.
- Only 1 of 4 sampled runs (PR Sous Chef) shows WSRF > 2x; it is the standout signal in this sample and the primary driver of aggregate cost (552K total tokens vs the other runs' 10–47K).
Recommendations by Category
Workflow Markdown
- PR Sous Chef (
.github/workflows/pr-sous-chef.md, 32,526 chars): reduce per-turn context resend in the pr-processor sub-agent — pass only the compact per-PR JSON already written to /tmp/gh-aw/agent/pr-sous-chef-candidates-compact.json instead of re-including full candidate/eligibility context on each of the (up to 4) sub-agent invocations. Evidence: WSRF 12.17x, 550K cumulative vs 45K peak input tokens, 15 invocations. Expected impact: high. Needs manual review (behavior-sensitive sub-agent loop).
- Issue Monster (
.github/workflows/issue-monster.md, 41,569 chars): the steps: rate-limit-detection GraphQL/JS block (~90 lines) is fully deterministic and could be trimmed/simplified without touching agent-facing prompt content — it doesn't reduce the first request directly but keeps the compiled workflow lean for future changes. Expected impact: low. Safe immediately (no agent-facing wording changes).
Skills
- Matt Pocock Skills Reviewer (
.github/workflows/mattpocock-skills-reviewer.md): 5 full skill packages are imported unconditionally via skills: even though "Step 3" already selects 1–2 based on PR change type. Recommend keeping the skill directory available on disk (as today) but confirming no per-skill inline content is duplicated into the prompt beyond the already-present short bullet summaries. Evidence: ambient_context.input_tokens 7,308 vs 5,332 for the single-skill Impeccable Reviewer. Expected impact: medium. Needs manual review (skill-selection logic must stay correct).
- Impeccable Skills Reviewer (
.github/workflows/impeccable-skills-reviewer.md): move the 6-row mode-selection table and fallback guidance (lines ~113–131) into the impeccable skill's SKILL.md so it's loaded on demand from the installed skill rather than duplicated inline in every compiled prompt. Evidence: workflow inlines the same table structurally available in the installed skill. Expected impact: medium. Safe immediately if the skill file is updated in the same PR.
Agents
- No inline-agent removal recommended this cycle — the sampled workflows' sub-agents (
pr-processor, pr-triage) appear justified by their scoped, single-purpose roles. Focus instead on reducing what's passed into pr-processor per invocation (see PR Sous Chef recommendation above).
References
Generated by 🌫️ Daily Ambient Context Optimizer · copilot · auto · 145.4 AIC · ⌖ 7.67 AIC · ⊞ 12.4K · ◷
Executive Summary
Highest-Leverage Changes
pr-processorsub-agent resends each invocation and caching static PR context instead of re-declaring it every turn.skills:list (5 full skill packages imported unconditionally) to lazy/on-demand loading based on detected change type, matching the "Select Skills" step it already documents.impeccableskill so it's loaded once rather than duplicated inline in every run's first request.steps:block (rate-limit GraphQL probing logic) — it is deterministic bookkeeping that inflates the compiled prompt/workflow body without needing agent reasoning.cli-proxy: trueis set consistently across all 4 sampled workflows to avoid rawgh-CLI-oriented wording bleeding into prompts.CI-Validation Checklist for Implementing Agents
Any agent implementing workflow-file recommendations must complete every item below before opening a PR:
make recompilefor every modified.github/workflows/*.mdfile — zero compilation errors requiredmake agent-report-progressbefore the final commit and confirm it passesblocked_fileslist in/tmp/gh-aw/ambient-context/closed-pr-targets.json(written by Step 4) — do not re-attempt changes to any file that appears in a closed ambient-context optimization PR from the last 14 days.lock.ymlchanges in the PR bodyKey Metrics
Per-Run First-Request Metrics
Note:
request_charsusesprompt.txtsize as a fallback proxy — the canonicalsandbox/firewall/logs/api-proxy-logsandsandbox/agent/logs/copilot-session-statepaths for other runs were not readable from this sandboxed session (read-only/permission-denied on/tmp/gh-aw/aw-mcp/logs/run-*), so this report is best-effort fromauditMCP metrics only.Repeated Ambient Context Signals
diagnosing-bugs,tdd,improve-codebase-architecture,grill-with-docs,codebase-design) unconditionally in front-matter, but its own "Step 3: Identify Change Type and Select Skills" logic implies only 1–2 are typically relevant per PR.impeccableskill, duplicating content that's also available via the installedSKILL.md.steps:block contains ~90 lines of deterministic GraphQL rate-limit-probing JS that doesn't need to be in the agent-facing prompt path — it's pure pre-processing.pr-processorsub-agent has a WSRF of 12.17 (550K cumulative vs 45K peak input tokens across only 15 invocations) — strongly suggests full context (PR diff/candidate list) is being redeclared each turn instead of referenced incrementally.Deterministic Analysis Output
analyze_requests.py(stdlib only) computed per-run and aggregate metrics from the 4 sampledrun-*.jsonmetadata files (derived fromauditMCPprompt_analysis,metrics.ambient_context, andmetrics.working_set, since raw request text was inaccessible this run):Recommendations by Category
Workflow Markdown
.github/workflows/pr-sous-chef.md, 32,526 chars): reduce per-turn context resend in thepr-processorsub-agent — pass only the compact per-PR JSON already written to/tmp/gh-aw/agent/pr-sous-chef-candidates-compact.jsoninstead of re-including full candidate/eligibility context on each of the (up to 4) sub-agent invocations. Evidence: WSRF 12.17x, 550K cumulative vs 45K peak input tokens, 15 invocations. Expected impact: high. Needs manual review (behavior-sensitive sub-agent loop)..github/workflows/issue-monster.md, 41,569 chars): thesteps:rate-limit-detection GraphQL/JS block (~90 lines) is fully deterministic and could be trimmed/simplified without touching agent-facing prompt content — it doesn't reduce the first request directly but keeps the compiled workflow lean for future changes. Expected impact: low. Safe immediately (no agent-facing wording changes).Skills
.github/workflows/mattpocock-skills-reviewer.md): 5 full skill packages are imported unconditionally viaskills:even though "Step 3" already selects 1–2 based on PR change type. Recommend keeping the skill directory available on disk (as today) but confirming no per-skill inline content is duplicated into the prompt beyond the already-present short bullet summaries. Evidence:ambient_context.input_tokens7,308 vs 5,332 for the single-skill Impeccable Reviewer. Expected impact: medium. Needs manual review (skill-selection logic must stay correct)..github/workflows/impeccable-skills-reviewer.md): move the 6-row mode-selection table and fallback guidance (lines ~113–131) into theimpeccableskill'sSKILL.mdso it's loaded on demand from the installed skill rather than duplicated inline in every compiled prompt. Evidence: workflow inlines the same table structurally available in the installed skill. Expected impact: medium. Safe immediately if the skill file is updated in the same PR.Agents
pr-processor,pr-triage) appear justified by their scoped, single-purpose roles. Focus instead on reducing what's passed intopr-processorper invocation (see PR Sous Chef recommendation above).References