Executive Summary
- 4 runs sampled across 4 distinct workflows from the last 24 hours
- Workflows covered: Go Logger Enhancement, Sergo - Serena Go Expert, PR Sous Chef, Smoke Copilot
- Median first-request size: 17,140 chars | P95: 20,216 chars
- Key finding: The highest-cost run (Go Logger, 26.9M effective tokens / 93 turns) has a compact 6,583-char prompt — the problem is exploratory turn proliferation, not prompt bloat. Sergo (20,216 chars, 90 headings, 13 code fences) is the largest prompt and has structural over-engineering. Smoke Copilot (3.02% duplicate line ratio, 4,805-char Test Requirements section) has addressable prompt redundancy.
Highest-Leverage Changes
- [Go Logger] Promote cache-check to a pre-flight gate step — currently buried mid-workflow; moving it to a dedicated no-LLM step eliminates all 93 exploration turns on unchanged days (HIGH)
- [Go Logger] Replace iterative file-scan turns with a deterministic bash step — emit a structured manifest before any LLM invocation; ~50% of 93 turns are pure data-gathering (HIGH)
- [Sergo] Collapse 90-heading structure to ≤15 headings — 1 heading per 7 lines inflates effective token weight; merge template/decorative headings into flat prose (HIGH)
- [Sergo] Extract 13 embedded code fences into a conditional skill — static Go snippets and format examples add ~3–5k chars on every daily run; move to a
sergo-examples skill loaded only when formatting guidance is needed (HIGH)
- [Smoke Copilot] Trim
## Test Requirements section (4,805 chars) — largest single section; split into a shared import or collapse verbose sub-requirements (MEDIUM)
- [Sergo] Cap lazy-loaded strategy memory to 3 most recent entries —
### 2.1 Load Previous Strategies loads full repo-memory history unconditionally; cap to recent entries (MEDIUM)
- [Go Logger] Add structured safe-output schema for logger diffs — reduces per-turn token volume by replacing prose reasoning with compact patch objects (MEDIUM)
Key Metrics
| Metric |
Value |
| Sampled runs |
4 |
| Distinct workflows |
4 |
| Median chars |
17,140 |
| P95 chars |
20,216 |
| Largest sampled request |
Sergo – 20,216 chars (646 lines, 90 headings, 13 code fences) |
| Highest effective tokens |
Go Logger – 26,941,267 (93 turns, 6,583-char prompt) |
Per-Run First-Request Metrics
| Run |
Workflow |
Chars |
Lines |
Headings |
Code Fences |
Dup Line Ratio |
Eff Tokens |
| 26930135373 |
PR Sous Chef |
14,315 |
198 |
8 |
0 |
0.00% |
7,762,110 |
| 26931276933 |
Go Logger Enhancement |
6,583 |
201 |
17 |
2 |
0.00% |
26,941,267 |
| 26931476596 |
Smoke Copilot |
19,965 |
304 |
22 |
4 |
3.02% |
7,693,470 |
| 26932367410 |
Sergo - Serena Go Expert |
20,216 |
646 |
90 |
13 |
0.20% |
10,173,346 |
- All 4 runs use
gh-proxy and cli-proxy — no MCP-to-CLI rewrite needed
- Request source: workflow
.md source (claude runs) and agent process log (copilot runs)
Repeated Ambient Context Signals
- Smoke Copilot: 3.02% duplicate line ratio — safe-output boilerplate and tool-access rules repeated across sections
- Sergo: 90 headings create fragmented micro-sections; template placeholders like
### Task [N]: [Short Title] appear multiple times as copy-paste scaffolding
- PR Sous Chef:
## Token efficiency rules (mandatory) (963 chars) and ## Required skip rules per PR (749 chars) are verbose inline guardrails that could be condensed to a short shared import
- Go Logger:
## Efficiency First: Check Cache (922 chars) is effective guidance but placed too late — it runs after LLM context is already loaded
Deterministic Analysis Output
- Script:
/tmp/gh-aw/ambient-context/analyze_requests.py (stdlib only)
- Output:
request-analysis.json, request-analysis.md
- Key findings:
- Sergo has the highest heading density: 90 / 646 lines = 0.14 headings/line
- Smoke Copilot
## Test Requirements is the single largest section at 4,805 chars (24% of total prompt)
- PR Sous Chef
## Required nudges for eligible PRs is 1,908 chars (13% of prompt) with dense bullet lists
- Go Logger ambient_context effective_tokens=5,239 — prompt is efficient; token cost comes entirely from 93 LLM turns
- Sergo ambient_context effective_tokens=12,560 — moderate; driven by 90-heading structure and 13 code fences
Recommendations by Category
Workflow Markdown
- [Go Logger] Pre-flight cache gate (
go-logger.md) — Move the cache check to a steps: entry before any LLM turn. On days with no new Go files, the workflow exits immediately with zero LLM calls. Expected impact: HIGH. Safe immediately: yes.
- [Go Logger] Deterministic manifest step (
go-logger.md) — Add a bash step that scans Go files and writes a JSON manifest (files needing logger, missing imports, call sites) to /tmp. The LLM prompt then reads this file instead of exploring iteratively. Eliminates ~46 data-gathering turns. Expected impact: HIGH. Safe immediately: yes.
- [Sergo] Flatten heading structure (
sergo.md) — Target ≤15 headings by merging the ~75 decorative/template sub-headings into numbered prose. Reduces effective token multiplier from heading-anchored context. Expected impact: HIGH. Safe immediately: yes (structural only).
- [Sergo] Cap repo-memory load (
sergo.md) — Replace unconditional Load Previous Strategies with a conditional load capped to the 3 most recent entries. Prevents unbounded memory growth inflating every future run. Expected impact: MEDIUM. Needs review.
- [Smoke Copilot] Split
## Test Requirements (smoke-copilot.md) — At 4,805 chars (24% of prompt), this section is the largest. Move stable sub-requirements to a shared import and keep only the dynamic per-run discriminators inline. Expected impact: MEDIUM. Safe immediately: yes.
Skills
- [Sergo] Create
sergo-examples skill — Extract the 13 embedded code fences (Go snippets, output format templates) into .github/skills/sergo-examples/SKILL.md. Load conditionally in the workflow only when the agent needs output formatting guidance. Reduces base prompt by ~3–5k chars on every daily run. Expected impact: HIGH. Needs review.
- [Go Logger] Structured safe-output patch schema — Define a compact safe-output type for logger diffs (file path, import line, call-site list) to replace multi-turn prose reasoning with a single structured emission. Expected impact: MEDIUM. Needs design review.
Agents
- No inline agent (
## agent:) or skill (## skill:) definitions found in any sampled run. All 4 workflows use gh-proxy and cli-proxy correctly. No agent restructuring recommended at this time.
References
- §26931276933 — Go Logger Enhancement (26.9M eff tokens, 93 turns)
- §26932367410 — Sergo - Serena Go Expert (10.2M eff tokens, 90 headings)
- §26931476596 — Smoke Copilot (7.7M eff tokens, 3.02% dup lines)
Generated by 🌫️ Daily Ambient Context Optimizer · sonnet46 5M · ◷
Executive Summary
Highest-Leverage Changes
sergo-examplesskill loaded only when formatting guidance is needed (HIGH)## Test Requirementssection (4,805 chars) — largest single section; split into a shared import or collapse verbose sub-requirements (MEDIUM)### 2.1 Load Previous Strategiesloads full repo-memory history unconditionally; cap to recent entries (MEDIUM)Key Metrics
Per-Run First-Request Metrics
gh-proxyandcli-proxy— no MCP-to-CLI rewrite needed.mdsource (claude runs) and agent process log (copilot runs)Repeated Ambient Context Signals
### Task [N]: [Short Title]appear multiple times as copy-paste scaffolding## Token efficiency rules (mandatory)(963 chars) and## Required skip rules per PR(749 chars) are verbose inline guardrails that could be condensed to a short shared import## Efficiency First: Check Cache(922 chars) is effective guidance but placed too late — it runs after LLM context is already loadedDeterministic Analysis Output
/tmp/gh-aw/ambient-context/analyze_requests.py(stdlib only)request-analysis.json,request-analysis.md## Test Requirementsis the single largest section at 4,805 chars (24% of total prompt)## Required nudges for eligible PRsis 1,908 chars (13% of prompt) with dense bullet listsRecommendations by Category
Workflow Markdown
go-logger.md) — Move the cache check to asteps:entry before any LLM turn. On days with no new Go files, the workflow exits immediately with zero LLM calls. Expected impact: HIGH. Safe immediately: yes.go-logger.md) — Add a bash step that scans Go files and writes a JSON manifest (files needing logger, missing imports, call sites) to/tmp. The LLM prompt then reads this file instead of exploring iteratively. Eliminates ~46 data-gathering turns. Expected impact: HIGH. Safe immediately: yes.sergo.md) — Target ≤15 headings by merging the ~75 decorative/template sub-headings into numbered prose. Reduces effective token multiplier from heading-anchored context. Expected impact: HIGH. Safe immediately: yes (structural only).sergo.md) — Replace unconditionalLoad Previous Strategieswith a conditional load capped to the 3 most recent entries. Prevents unbounded memory growth inflating every future run. Expected impact: MEDIUM. Needs review.## Test Requirements(smoke-copilot.md) — At 4,805 chars (24% of prompt), this section is the largest. Move stable sub-requirements to a shared import and keep only the dynamic per-run discriminators inline. Expected impact: MEDIUM. Safe immediately: yes.Skills
sergo-examplesskill — Extract the 13 embedded code fences (Go snippets, output format templates) into.github/skills/sergo-examples/SKILL.md. Load conditionally in the workflow only when the agent needs output formatting guidance. Reduces base prompt by ~3–5k chars on every daily run. Expected impact: HIGH. Needs review.Agents
## agent:) or skill (## skill:) definitions found in any sampled run. All 4 workflows usegh-proxyandcli-proxycorrectly. No agent restructuring recommended at this time.References