Executive Summary
- Runs sampled: 4 (Daily Code Metrics, Failure Investigator (6h), Smoke Copilot, Smoke Claude)
- Distinct workflows: 4
- Median first-request size: 17,010 chars
- P95 first-request size: 20,794 chars
- Key finding: All 4 sampled runs carry an identical 3,481-char system-injected safe-outputs block (~17-28% of total prompt); the top two by AIC have additional bloat from inline agent definitions and redundant structured examples.
Highest-Leverage Changes
- [agents] Extract 3 inline agent definitions in
aw-failure-investigator.md to shared imports — saves ~2,050 chars per invocation
- [workflow-md] Compress verbose
Required Investigation Steps in aw-failure-investigator.md — saves ~900 chars
- [workflow-md] Remove inline bash pruning script and redundant JSON schema block in
daily-code-metrics.md — saves ~1,050 chars
- [workflow-md] Trim
experiments: frontmatter metadata fields in aw-failure-investigator.md — saves ~500 chars once runtime non-consumption confirmed
- [workflow-md] Compress verbose
Test Requirements lists in smoke-claude.md (16 items) and smoke-copilot.md (21 items) — saves ~600-900 chars each
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 |
17,010 |
| P95 chars |
20,794 |
| Largest sampled request |
20,794 (Smoke Claude) |
| Merged optimizer PRs (7d) |
1 |
| Closed optimizer PRs (7d) |
0 |
| Optimizer PR close-rate (7d) |
N/A (< 3 settled PRs) |
Per-Run First-Request Metrics
| Run ID |
Workflow |
Chars |
Lines |
Headings |
CodeFences |
DupLineRatio |
AIC |
| 29204294047 |
Daily Code Metrics |
19,540 |
336 |
19 |
12 |
0.007 |
330.2 |
| 29205172839 |
Failure Investigator (6h) |
12,335 |
268 |
23 |
8 |
0.015 |
228.9 |
| 29205557277 |
Smoke Copilot |
14,480 |
271 |
18 |
14 |
0.012 |
100.1 |
| 29205138142 |
Smoke Claude |
20,794 |
383 |
22 |
18 |
0.010 |
64.5 |
Source: prompt.txt (API proxy event logs absent from all sampled run log directories).
Repeated Ambient Context Signals
- 3,481-char safe-outputs block is identical across all 4 runs (system-injected)
- Formatting rules (
Use ### headers only, move long detail into details blocks, Structure reports as: overview → key metrics → collapsible detail) appear verbatim in ≥2 runs — shared import duplication
- No SKILL.md references found in any sampled prompt (no over-broad skill loading)
Deterministic Analysis Output
aw-failure-investigator.md: 20,106 chars — 3 inline agents (~2,050 chars), multi-field experiments: frontmatter (~500 chars), verbose investigation steps (~900 chars of prose rationale)
daily-code-metrics.md: 11,409 chars — 620-char bash pruning snippet replaceable by one instruction sentence; 570-char JSON schema already re-stated in prose
smoke-claude.md: 12,100 chars — 16-item Test Requirements section (~3,179 chars); smoke-copilot.md: 10,161 chars — 21-item section (~2,556 chars); both contain explanatory sub-bullets that can be compressed to single-line imperatives
- Audit: ambient_context.input_tokens 8,395 (Daily Code Metrics) and 5,186 (Failure Investigator); cached tokens 3.2M and 2.0M indicate stable prompts
Recommendations by Category
Workflow Markdown
R1 — Remove redundant Data Storage schema + bash pruning script (daily-code-metrics.md) — medium, safe immediately
- JSON schema block (~570 chars) duplicates prose below it; bash pruning snippet (~620 chars) can be one sentence.
- Savings: ~1,050 chars. File: 11,409 chars → ~10,350 chars (9% reduction, well within 40% guard).
R2 — Compress Required Investigation Steps (aw-failure-investigator.md) — medium, needs review
- ~900 chars of prose rationale (clustering definitions, cap explanations) can move into inline agent descriptions.
- File: 20,106 chars → ~19,200 chars.
R3 — Strip experiments: frontmatter metadata (aw-failure-investigator.md) — medium, needs review
- Fields
hypothesis, analysis_type, tags, secondary_metrics, guardrail_metrics are human metadata; verify runtime non-consumption then remove.
- Savings: ~500 chars.
R4 — Compress Test Requirements lists (smoke-claude.md, smoke-copilot.md) — medium, safe
- Reduce 16 and 21 numbered test items to compact single-line imperatives by removing explanatory sub-bullets.
- Savings: ~600-900 chars per file.
Skills
No SKILL.md references found in any sampled prompt. No over-broad skill loading detected.
Agents
R5 — Extract 3 inline agents in aw-failure-investigator.md to shared imports — high, needs review
failure-classifier, issue-matcher, cluster-evidence-extractor embed ~2,050 chars per run. Move to shared/ imports for reuse and independent updates. Requires verification that import syntax supports inline-agent extraction.
References
Generated by 🌫️ Daily Ambient Context Optimizer · 112.5 AIC · ⌖ 12.7 AIC · ⊞ 7.7K · ◷
Executive Summary
Highest-Leverage Changes
aw-failure-investigator.mdto shared imports — saves ~2,050 chars per invocationRequired Investigation Stepsinaw-failure-investigator.md— saves ~900 charsdaily-code-metrics.md— saves ~1,050 charsexperiments:frontmatter metadata fields inaw-failure-investigator.md— saves ~500 chars once runtime non-consumption confirmedTest Requirementslists insmoke-claude.md(16 items) andsmoke-copilot.md(21 items) — saves ~600-900 chars eachCI-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— do not re-attempt changes to any file in a closed ambient-context optimization PR from the last 14 days.lock.ymlchanges in the PR bodyKey Metrics
Per-Run First-Request Metrics
Source:
prompt.txt(API proxy event logs absent from all sampled run log directories).Repeated Ambient Context Signals
Use ### headers only,move long detail into details blocks,Structure reports as: overview → key metrics → collapsible detail) appear verbatim in ≥2 runs — shared import duplicationDeterministic Analysis Output
aw-failure-investigator.md: 20,106 chars — 3 inline agents (~2,050 chars), multi-fieldexperiments:frontmatter (~500 chars), verbose investigation steps (~900 chars of prose rationale)daily-code-metrics.md: 11,409 chars — 620-char bash pruning snippet replaceable by one instruction sentence; 570-char JSON schema already re-stated in prosesmoke-claude.md: 12,100 chars — 16-item Test Requirements section (~3,179 chars);smoke-copilot.md: 10,161 chars — 21-item section (~2,556 chars); both contain explanatory sub-bullets that can be compressed to single-line imperativesRecommendations by Category
Workflow Markdown
R1 — Remove redundant Data Storage schema + bash pruning script (
daily-code-metrics.md) — medium, safe immediatelyR2 — Compress
Required Investigation Steps(aw-failure-investigator.md) — medium, needs reviewR3 — Strip
experiments:frontmatter metadata (aw-failure-investigator.md) — medium, needs reviewhypothesis,analysis_type,tags,secondary_metrics,guardrail_metricsare human metadata; verify runtime non-consumption then remove.R4 — Compress Test Requirements lists (
smoke-claude.md,smoke-copilot.md) — medium, safeSkills
No SKILL.md references found in any sampled prompt. No over-broad skill loading detected.
Agents
R5 — Extract 3 inline agents in
aw-failure-investigator.mdto shared imports — high, needs reviewfailure-classifier,issue-matcher,cluster-evidence-extractorembed ~2,050 chars per run. Move toshared/imports for reuse and independent updates. Requires verification that import syntax supports inline-agent extraction.References