Executive Summary
- 4 runs sampled from 4 distinct workflows over the last 24 hours
- Workflows covered: Design Decision Gate, Test Quality Sentinel, Documentation Unbloat, Linter Miner
- Median first-request size: 23,656 chars · P95: 28,404 chars
- Highest-cost run: Documentation Unbloat at AIC 527 / 68 turns — prompt size is modest (18.9K chars) but runaway turn count drives cost
- Largest prompt: Design Decision Gate at 34,771 chars, where the imported
adr-writer agent definition accounts for 43% of workflow content
- All 4 workflows already have
gh-proxy and cli-proxy enabled ✓
Highest-Leverage Changes
- [agents] Slim
adr-writer.agent.md in Design Decision Gate — 11,713 chars (43%) is ADR template boilerplate loaded on every PR gate check; extract the normative spec/template to a lazy-loaded skill or strip to decision-only instructions
- [workflow-md] Fix Documentation Unbloat Step 2 — agent re-runs
search()+find when candidate-files.txt is already pre-computed; eliminating this saves an estimated 10–20 turns per run (primary driver of AIC 527)
- [workflow-md] Scope
serena-go.md import in Linter Miner to the code-pattern-scanner sub-agent — saves 3,432 chars (21% of first request) since the main agent never calls Serena tools directly
- [agents] Write Linter Miner sub-agent outputs to
/tmp/gh-aw/agent/candidates.json instead of returning inline — likely driver of 669K effective tokens in a single-turn run
- [workflow-md] Remove duplicated exclusion guards from Documentation Unbloat Steps 2+3 — pre-flight bash already enforces all exclusions; ~900 chars of redundant prose
- [skills] Drop
shared/otlp.md from Documentation Unbloat — 635 chars with no functional use in a doc-editing workflow
- [skills] Extract inline
linter-writer agent body in Linter Miner to a reusable skill — ~60 lines of file layout and compilation commands duplicated from the existing go-linters skill
Key Metrics
| Metric |
Value |
| Sampled runs |
4 |
| Distinct workflows |
4 |
| Median chars |
23,656 |
| P95 chars |
28,404 |
| Largest sampled request |
Design Decision Gate (34,771 chars) |
| Highest AIC run |
Documentation Unbloat (526.96 AIC, 68 turns) |
| Avg duplicate line ratio |
7.7% |
Per-Run First-Request Metrics
| Run ID |
Workflow |
Chars |
AIC |
Effective Tokens |
Turns |
Dup Line % |
Code Fences |
Headings |
| §27098774407 |
Documentation Unbloat |
18,909 |
526.96 |
1,756,540 |
68 |
6.8% |
20 |
34 |
| §27100128932 |
Linter Miner |
16,161 |
132.66 |
669,577 |
1 |
4.9% |
4 |
18 |
| §27100525416 |
Design Decision Gate |
34,771 |
100.04 |
333,459 |
— |
8.9% |
28 |
90 |
| §27100525434 |
Test Quality Sentinel |
28,404 |
115.80 |
386,007 |
— |
10.1% |
26 |
51 |
Repeated Ambient Context Signals
shared/reporting.md (2,231 chars) appears identically in 3 of 4 sampled prompts; loaded by 53 workflows total — expected baseline but confirms universal overhead
- ADR template boilerplate (
# ADR-{NNNN}: ..., **Date**: {YYYY-MM-DD}, ## Examples of ADR-Worthy Decisions) appears twice within the Design Decision Gate prompt — narrative template duplicated in the normative spec section
cat /tmp/gh-aw/agent/diff-numstat.txt appears twice in Test Quality Sentinel (Steps 1 and a later verification step)
"event": "REQUEST_CHANGES" JSON fragment appears twice in Test Quality Sentinel — duplicated across two verdict-path examples
- Exclusion rules (
blog/, frontmatter-full.md, disable-agentic-editing) appear 13 times in Documentation Unbloat Steps 2+3 despite pre-flight bash already enforcing them
- The
(preamble) section (system block + imports) is the largest single section in all 4 runs, ranging from 69–89 lines
Deterministic Analysis Output
Script: analyze_requests.py (stdlib only), reading 4 × run-*.txt / run-*.json samples.
Key computed metrics:
- System block (runtime-injected): 5,667–7,702 chars depending on safe-output configuration
- Workflow-specific content after
</system>: 8,459–27,134 chars
adr-writer.agent.md inlined: 11,713 chars = 43.2% of Design Decision Gate workflow content
serena-go.md + transitive serena.md = 3,432 chars in Linter Miner preamble; main agent never calls Serena tools
shared/reporting.md = 2,231 chars; shared/otlp.md = 635 chars (loaded by Documentation Unbloat but functionally unused)
- Code fence density highest in Design Decision Gate (28) and Test Quality Sentinel (26) — dense inline bash examples per step
- Duplicate line ratios: Test Quality Sentinel 10.1%, Design Decision Gate 8.9%, Documentation Unbloat 6.8%, Linter Miner 4.9%
Recommendations by Category
Workflow Markdown
R1 — Documentation Unbloat: replace Step 2 file-discovery with cat candidate-files.txt · Impact: high · Safe to automate
- Step 2 instructs the agent to call
search() + find even though pre-agent-steps already writes /tmp/gh-aw/agent/candidate-files.txt with all exclusions applied
- Step 0 acknowledges the file exists but Step 2 ignores it — forces ≥2 extra turns before file selection
- With 68 turns × ~25K avg tokens/turn, each eliminated turn pair saves ~50K tokens
- Fix: collapse Step 2 to a single
cat /tmp/gh-aw/agent/candidate-files.txt instruction
R2 — Documentation Unbloat: deduplicate exclusion guards · Impact: medium · Safe to automate
- Exclusion rules for
blog/, frontmatter-full.md, disable-agentic-editing appear 13 times across Steps 2–3; pre-flight already enforces them
- Removing inline NEVER/IMPORTANT warnings saves ~900 chars with no behavioral change
R3 — Linter Miner: scope serena-go.md import to code-pattern-scanner sub-agent · Impact: high · Safe to automate
serena-go.md + transitive serena.md = 3,432 chars injected in the main-agent preamble
- Main agent never calls
activate_project, find_symbol, search_for_pattern, or find_referencing_code_snippets — only code-pattern-scanner does
- Move the import from top-level
imports: to the code-pattern-scanner agent block
- Saves 3,432 chars (21% of 16,161 first-request chars)
Skills
R4 — Documentation Unbloat: remove shared/otlp.md import · Impact: medium · Safe to automate
shared/otlp.md (635 chars, 26 lines) covers OTLP tracing configuration; a doc-editing workflow never emits traces
- Removal cuts ~3.4% from the 18,909-char first request at zero functional cost
R5 — Linter Miner: extract linter-writer agent body to a reusable skill · Impact: medium · Needs manual review
- Inline
## agent: linter-writer block duplicates file layout, package structure, and compilation commands partly covered by .github/skills/go-linters/SKILL.md
- Extracting to
.github/skills/linter-writer/SKILL.md makes the definition shareable across linter-creating workflows
Agents
R6 — Design Decision Gate: trim adr-writer agent to gate-check scope · Impact: high · Needs manual review
adr-writer.agent.md (270 lines, 9,787 bytes) fully inlined: 11,713 chars = 43% of workflow content on every PR gate check
- Most runs only need the
## Procedure: Writing a New ADR section; the full RFC 2119 normative spec, dual-part template, and writing-quality standards are only needed when actually drafting
- Options: (a) split into slim gate-check agent + separate ADR-drafting skill loaded lazily, or (b) move normative spec and template body to a skill referenced only when drafting
R7 — Linter Miner: write sub-agent candidate outputs to temp file · Impact: high · Needs manual review
discussion-miner and code-pattern-scanner return candidate lists inline into the main agent context, likely driving 669K effective tokens for a single-turn run
- Pattern: instruct sub-agents to write output to
/tmp/gh-aw/agent/candidates.json (consistent with existing prior-linters.json pattern); main agent reads the file in Step 3
- Keeps sub-agent verbosity outside the main-agent context window
References
Generated by 🌫️ Daily Ambient Context Optimizer · 937.1 AIC · ⌖ 35.6 AIC · ⊞ 21K · ◷
Executive Summary
adr-writeragent definition accounts for 43% of workflow contentgh-proxyandcli-proxyenabled ✓Highest-Leverage Changes
adr-writer.agent.mdin Design Decision Gate — 11,713 chars (43%) is ADR template boilerplate loaded on every PR gate check; extract the normative spec/template to a lazy-loaded skill or strip to decision-only instructionssearch()+findwhencandidate-files.txtis already pre-computed; eliminating this saves an estimated 10–20 turns per run (primary driver of AIC 527)serena-go.mdimport in Linter Miner to thecode-pattern-scannersub-agent — saves 3,432 chars (21% of first request) since the main agent never calls Serena tools directly/tmp/gh-aw/agent/candidates.jsoninstead of returning inline — likely driver of 669K effective tokens in a single-turn runshared/otlp.mdfrom Documentation Unbloat — 635 chars with no functional use in a doc-editing workflowlinter-writeragent body in Linter Miner to a reusable skill — ~60 lines of file layout and compilation commands duplicated from the existinggo-lintersskillKey Metrics
Per-Run First-Request Metrics
Repeated Ambient Context Signals
shared/reporting.md(2,231 chars) appears identically in 3 of 4 sampled prompts; loaded by 53 workflows total — expected baseline but confirms universal overhead# ADR-{NNNN}: ...,**Date**: {YYYY-MM-DD},## Examples of ADR-Worthy Decisions) appears twice within the Design Decision Gate prompt — narrative template duplicated in the normative spec sectioncat /tmp/gh-aw/agent/diff-numstat.txtappears twice in Test Quality Sentinel (Steps 1 and a later verification step)"event": "REQUEST_CHANGES"JSON fragment appears twice in Test Quality Sentinel — duplicated across two verdict-path examplesblog/,frontmatter-full.md,disable-agentic-editing) appear 13 times in Documentation Unbloat Steps 2+3 despite pre-flight bash already enforcing them(preamble)section (system block + imports) is the largest single section in all 4 runs, ranging from 69–89 linesDeterministic Analysis Output
Script:
analyze_requests.py(stdlib only), reading 4 ×run-*.txt/run-*.jsonsamples.Key computed metrics:
</system>: 8,459–27,134 charsadr-writer.agent.mdinlined: 11,713 chars = 43.2% of Design Decision Gate workflow contentserena-go.md+ transitiveserena.md= 3,432 chars in Linter Miner preamble; main agent never calls Serena toolsshared/reporting.md= 2,231 chars;shared/otlp.md= 635 chars (loaded by Documentation Unbloat but functionally unused)Recommendations by Category
Workflow Markdown
R1 — Documentation Unbloat: replace Step 2 file-discovery with
cat candidate-files.txt· Impact: high · Safe to automatesearch()+findeven thoughpre-agent-stepsalready writes/tmp/gh-aw/agent/candidate-files.txtwith all exclusions appliedcat /tmp/gh-aw/agent/candidate-files.txtinstructionR2 — Documentation Unbloat: deduplicate exclusion guards · Impact: medium · Safe to automate
blog/,frontmatter-full.md,disable-agentic-editingappear 13 times across Steps 2–3; pre-flight already enforces themR3 — Linter Miner: scope
serena-go.mdimport tocode-pattern-scannersub-agent · Impact: high · Safe to automateserena-go.md+ transitiveserena.md= 3,432 chars injected in the main-agent preambleactivate_project,find_symbol,search_for_pattern, orfind_referencing_code_snippets— onlycode-pattern-scannerdoesimports:to thecode-pattern-scanneragent blockSkills
R4 — Documentation Unbloat: remove
shared/otlp.mdimport · Impact: medium · Safe to automateshared/otlp.md(635 chars, 26 lines) covers OTLP tracing configuration; a doc-editing workflow never emits tracesR5 — Linter Miner: extract
linter-writeragent body to a reusable skill · Impact: medium · Needs manual review## agent: linter-writerblock duplicates file layout, package structure, and compilation commands partly covered by.github/skills/go-linters/SKILL.md.github/skills/linter-writer/SKILL.mdmakes the definition shareable across linter-creating workflowsAgents
R6 — Design Decision Gate: trim
adr-writeragent to gate-check scope · Impact: high · Needs manual reviewadr-writer.agent.md(270 lines, 9,787 bytes) fully inlined: 11,713 chars = 43% of workflow content on every PR gate check## Procedure: Writing a New ADRsection; the full RFC 2119 normative spec, dual-part template, and writing-quality standards are only needed when actually draftingR7 — Linter Miner: write sub-agent candidate outputs to temp file · Impact: high · Needs manual review
discussion-minerandcode-pattern-scannerreturn candidate lists inline into the main agent context, likely driving 669K effective tokens for a single-turn run/tmp/gh-aw/agent/candidates.json(consistent with existingprior-linters.jsonpattern); main agent reads the file in Step 3References