Repository navigation
[ambient-context] Daily Ambient Context Optimizer - 2026-07-19 #46667
Description
Executive Summary
- 4 runs sampled across 4 distinct workflows (Daily Cache Strategy Analyzer, PR Sous Chef, Agent Persona Explorer, Changeset Generator)
- Median first-request size: 22,047 chars | P95: 24,031 chars
- All 4 runs lacked API proxy event logs;
prompt.txtused as request source - Highest-leverage finding:
daily-cache-strategy-analyzer.mdhas 37 headings and 16.2% duplicate lines — high structural fragmentation inflating every run. It also lacksgh-proxyandcli-proxy.pr-sous-chef.mdis the largest workflow source (28,658 chars) with a 5,715-char inline nudge catalog that embeds full shell examples and is loaded on every run.
Highest-Leverage Changes
- [workflow-md] Consolidate fragmented phases in
daily-cache-strategy-analyzer.md— 37 headings / 16.2% dup-line ratio. Merge parallel sub-sections (2.1/2.2/2.3 into one detection block) and deduplicate repeated table templates. Est. ~2,500 char saving per run. (high) - [workflow-md] Enable
gh-proxy+cli-proxyindaily-cache-strategy-analyzer.md— both are absent, meaning everyghCLI call goes through the slower unauthenticated path. Addtools: { github: { mode: gh-proxy }, cli-proxy: true }. (high, safe immediately) - [workflow-md] Trim the
## Required nudgessection inpr-sous-chef.md— at 5,715 chars, this is the largest single section across all samples. Shell examples with multi-checkout notes (~800 chars) and step-by-step push instructions are repeated verbatim from the system preamble. Summarize to bullet references; keep themake fmt+add_commentessentials only. Est. ~2,000 char saving. (high) - [workflow-md] Reduce
## Token efficiency rulesinpr-sous-chef.md— 2,262 chars of 10-point instructions, several of which restate safeoutputs guidance already in the system preamble (rules 10–11 duplicate the safe-output terminal guarantee). Remove redundant rules; keep only workflow-specific ones (rules 1–9). Est. ~600 char saving. (medium) - [workflow-md] Collapse parallel detection sub-sections in
agent-persona-explorer.md— 25 headings with 9.2% dup-line ratio. Phase 2/3 sub-sections follow the same template. Merge into a single structured block. Est. ~1,000 char saving. (medium) - [workflow-md] Add
gh-proxytochangeset.md—cli-proxy: trueis set buttools.github.mode: gh-proxyis absent, leaving GitHub API calls unoptimized. (low, safe immediately)
CI-Validation Checklist for Implementing Agents
Any agent implementing workflow-file recommendations must complete every item below before opening a PR:
- Run
make recompilefor every modified.github/workflows/*.mdfile — zero compilation errors required - Confirm no target workflow file is reduced by more than 40% of its current character count
- Run
make agent-report-progressbefore the final commit and confirm it passes - Check the
blocked_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 - Include a smoke-test result or dry-run output in the PR description for every changed workflow spec
- Document all generated
.lock.ymlchanges in the PR body - Do not submit as a draft PR
Key Metrics
| Metric | Value |
|---|---|
| Sampled runs | 4 |
| Distinct workflows | 4 |
| Median chars | 22,047 |
| P95 chars | 24,031 |
| Largest sampled request | 24,031 (PR Sous Chef, run 29693331475) |
| Merged optimizer PRs (7d) | 0 |
| Closed optimizer PRs (7d) | 0 |
| Optimizer PR close-rate (7d) | N/A (<3 settled PRs) |
Per-Run First-Request Metrics
| Run | Workflow | Chars | Lines | Headings | Dup-line% | Input tokens |
|---|---|---|---|---|---|---|
| 29699070953 | Daily Cache Strategy Analyzer | 22,047 | 491 | 37 | 16.2% | 760,393 |
| 29693331475 | PR Sous Chef | 24,031 | 282 | 11 | 4.5% | 94,700 |
| 29693386293 | Agent Persona Explorer | 20,226 | 361 | 25 | 9.2% | 68,770 |
| 29701390965 | Changeset Generator | 18,781 | 320 | 18 | 9.3% | 43,495 |
Note: request_source = prompt.txt for all runs — no API proxy event logs were present in the downloaded artifacts.
Repeated Ambient Context Signals
Cross-run repeated fragments (all 4 runs):
- Immutable security policy block (~4 lines, ~400 chars) — system-injected, not reducible
- Temporary files instruction — system-injected
Per-run internal duplication:
daily-cache-strategy-analyzer.md: table row templates (| Workflow | Miss Streak | ... |) appear twice;for run_dir in /tmp/gh-aw/aw-mcp/logs/run-*/shell pattern repeated twice; parallel sub-sections 2.1/2.2/2.3 share identical structural templates (~300 chars each)agent-persona-explorer.md: Phase 2 and Phase 3 sub-sections follow the same 5-item action pattern duplicated verbatimpr-sous-chef.md: Safe-output push instructions (~800 chars) repeat content from the system<safe-output-tools>preamble already injected at runtime
Safe-outputs block size: ~3,466 chars injected per run (14–19% of total prompt). This is system-managed and not reducible from workflow markdown.
Deterministic Analysis Output
Script: /tmp/gh-aw/ambient-context/analyze_requests.py
Key findings:
- Average heading count: 22.75 (high; ideal ≤ 12 for focused workflows)
- Average dup-line ratio: 9.9% across the sample
- No inline agents (
## agent:) or imported skill refs (SKILL.md) found in any sampled prompt — skill loading is either absent or already compiled out daily-cache-strategy-analyzer.mdhas the highest fragmentation (37 headings) with the highest dup ratio (16.2%) despite having 760K input tokens — the token cost is dominated by tool-output accumulation across turns, not just the initial promptpr-sous-chef.mdhas the largest workflow source file (28,658 chars) but relatively clean dup ratio (4.5%)- Code fences: 4–13 per prompt;
daily-cache-strategy-analyzer.mdleads with 13 (each fence adds parse overhead)
Recommendations by Category
Workflow Markdown
daily-cache-strategy-analyzer.md— consolidate detection phases (high impact, needs review): Merge sections 2.1, 2.2, 2.3 into a single## Phase 2: Detect Cache Issuesblock. Remove duplicate table templates. Target: ≤20 headings. Est. saving ~2,500 chars.daily-cache-strategy-analyzer.md— addgh-proxyandcli-proxy(high impact, safe immediately): The workflow usesagenticworkflows logsbut lacks proxy settings. Add undertools::github: { mode: gh-proxy }andcli-proxy: true.pr-sous-chef.md— trim## Required nudgessection (high impact, needs review): Condense the 5,715-char section by removing inline shell examples that duplicate system preamble guidance. Keep step headings and essential constraints only.pr-sous-chef.md— remove redundant safe-output rules from## Token efficiency rules(medium impact, safe immediately): Rules 10–11 restate the system-level terminal guarantee already injected at runtime. Remove them and renumber the section.agent-persona-explorer.md— deduplicate phase templates (medium impact, needs review): Phase 2 and Phase 3 use the same 5-step action template. Consolidate into a shared pattern reference.changeset.md— addtools.github.mode: gh-proxy(low impact, safe immediately):cli-proxy: trueis set; addgithub: { mode: gh-proxy }to complete proxy coverage.
Skills
No skill imports were detected in any sampled prompt. Skill loading appears to be either absent or already well-scoped. No recommendations at this time.
Agents
No inline agents (## agent:) were found in any sampled prompt. No inline agent recommendations.
References
- §29699070953 — Daily Cache Strategy Analyzer (760,393 input tokens)
- §29693331475 — PR Sous Chef (94,700 input tokens)
- §29693386293 — Agent Persona Explorer (68,770 input tokens)
Generated by 🌫️ Daily Ambient Context Optimizer · 125.2 AIC · ⌖ 14.9 AIC · ⊞ 7.8K · ◷
- expires on Jul 26, 2026, 12:19 PM UTC-08:00
Activity