You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Workflow: CLI Consistency Checker Selected: Highest token usage in 7-day window (4.13M tokens) Analysis period: 2026-05-13 to 2026-05-19 (7 days) Runs analyzed: 1 run (§26102456365) Not recently optimized: Last optimization was 2026-05-06 (different workflows)
Why selected: This workflow consumes 4.13M tokens per run despite being a read-only inspection task that only creates one issue. Agentic assessments flag it as "resource_heavy_for_domain" with 50% of turns being data-gathering work that could move to deterministic pre-agent steps.
Token Profile Summary
Metric
Value
Total tokens
4,129,650
Effective tokens
27,770,906 (includes cache reads)
Cache read tokens
3,626,013 (88.8% of input)
Output tokens
45,411
Turns
69
Action minutes
15
Avg tokens/turn
59,851
Cache efficiency
88.8%
Conclusion
Success (no errors)
Ranked Recommendations
1. Move CLI Data Collection to Pre-Agent Steps ⭐⭐⭐
Estimated savings: 2,000,000-2,500,000 tokens/run (60% reduction) Effort: Medium Risk: Low
Evidence: The workflow spends 69 turns executing CLI commands and collecting help output. Agentic assessment reports "partially_reducible" with 50% of turns being data-gathering that could move to deterministic steps.
Action: Add pre-agent: steps to build CLI and collect all --help output before agent starts:
pre-agent:
- name: Build CLI and collect help outputrun: | cd /home/runner/work/gh-aw/gh-aw make build mkdir -p /tmp/gh-aw/agent/help-output ./gh-aw --help > /tmp/gh-aw/agent/help-output/main.txt # Collect all command help for cmd in $(./gh-aw --help | grep -E '^\s+\w+' | awk '{print $1}'); do ./gh-aw $cmd --help > /tmp/gh-aw/agent/help-output/${cmd}.txt 2>&1 || true done # Collect all help into one file cat /tmp/gh-aw/agent/help-output/*.txt > /tmp/gh-aw/agent/all-help.txt
Prompt change: Replace "Step 1: Build and Verify the CLI" and "Step 2: Run ALL CLI Commands with --help" with:
"All CLI help output has been pre-collected in /tmp/gh-aw/agent/all-help.txt (1,742 lines, 55 commands). Read this file to analyze command consistency."
Expected outcome: Reduces from ~69 turns to ~10-15 turns (agent only analyzes, doesn't execute)
Evidence: MCP tool usage logs show only 1 tool call: safeoutputs.create_issue. The workflow configures cli-proxy, edit, and web-fetch but never uses them.
Configured tools:
cli-proxy: true → 0 calls (never used)
edit: {} → 0 calls (workflow is read-only)
web-fetch: {} → 0 calls (no external fetching)
bash: ["*"] → Used for CLI execution ✅
Action: Remove from frontmatter:
tools:
cli-proxy: true # ❌ Remove - never usededit: # ❌ Remove - never used (read-only workflow)web-fetch: # ❌ Remove - never usedbash: # ✅ Keep - needed for CLI execution
- "*"
Expected outcome: Reduces ambient context size by ~150K-200K tokens/run
3. Reduce Network Access Scope ⭐
Estimated savings: 50,000-75,000 tokens/run Effort: Low Risk: Very low
Evidence: Network configuration allows [defaults, node, "api.github.com", "proxy.golang.org", "sum.golang.org"] but the workflow is purely local CLI inspection — no network calls observed.
Estimated savings: 300,000-500,000 tokens/run Effort: Medium Risk: Low
Evidence: Prompt is 310 lines with 29 section headers. Includes 4 agent delegation sections (help-style-checker, help-text-typo-scanner, docs-cross-referencer, flag-consistency-checker) that are never used — workflow runs as single agent.
Tools never called: cli-proxy (0), edit (0), web-fetch (0)
Supporting Data - Agentic Assessments
Assessment 1 - Resource Heavy:
{
"kind": "resource_heavy_for_domain",
"severity": "high",
"summary": "This General Automation run consumed a heavy execution profile for its task shape.",
"evidence": "turns=69 tool_types=0 duration=14m8s write_actions=0",
"recommendation": "Compare this run to similar successful runs and trim unnecessary turns, tools, or write actions."
}
Assessment 2 - Partially Reducible:
{
"kind": "partially_reducible",
"severity": "low",
"summary": "About 50% of this run's turns appear to be data-gathering that could move to deterministic steps.",
"evidence": "agentic_fraction=0.50 turns=69",
"recommendation": "Move data-fetching work to frontmatter steps: (pre-agent) writing to /tmp/gh-aw/agent/ or post-steps: (post-agent) to reduce inference cost. See the DeterministicOps guide."
}
Supporting Data - Prompt Structure
Current prompt statistics:
Total lines: 310
Total words: 1,285
Sections (##): 29
Subsections (###): Multiple nested levels
Section breakdown:
Critical Requirement
Step 1: Build and Verify the CLI
Step 2: Run ALL CLI Commands with --help (with 3 subsections)
Step 3: Check for Consistency Issues (with 5 subsections)
Target Workflow
Workflow: CLI Consistency Checker
Selected: Highest token usage in 7-day window (4.13M tokens)
Analysis period: 2026-05-13 to 2026-05-19 (7 days)
Runs analyzed: 1 run (§26102456365)
Not recently optimized: Last optimization was 2026-05-06 (different workflows)
Why selected: This workflow consumes 4.13M tokens per run despite being a read-only inspection task that only creates one issue. Agentic assessments flag it as "resource_heavy_for_domain" with 50% of turns being data-gathering work that could move to deterministic pre-agent steps.
Token Profile Summary
Ranked Recommendations
1. Move CLI Data Collection to Pre-Agent Steps ⭐⭐⭐
Estimated savings: 2,000,000-2,500,000 tokens/run (60% reduction)
Effort: Medium
Risk: Low
Evidence: The workflow spends 69 turns executing CLI commands and collecting help output. Agentic assessment reports "partially_reducible" with 50% of turns being data-gathering that could move to deterministic steps.
Action: Add
pre-agent:steps to build CLI and collect all--helpoutput before agent starts:Prompt change: Replace "Step 1: Build and Verify the CLI" and "Step 2: Run ALL CLI Commands with --help" with:
Expected outcome: Reduces from ~69 turns to ~10-15 turns (agent only analyzes, doesn't execute)
2. Remove Unused Tools ⭐⭐
Estimated savings: 150,000-200,000 tokens/run (ambient context reduction)
Effort: Low
Risk: Very low
Evidence: MCP tool usage logs show only 1 tool call:
safeoutputs.create_issue. The workflow configurescli-proxy,edit, andweb-fetchbut never uses them.Configured tools:
cli-proxy: true→ 0 calls (never used)edit: {}→ 0 calls (workflow is read-only)web-fetch: {}→ 0 calls (no external fetching)bash: ["*"]→ Used for CLI execution ✅Action: Remove from frontmatter:
Expected outcome: Reduces ambient context size by ~150K-200K tokens/run
3. Reduce Network Access Scope ⭐
Estimated savings: 50,000-75,000 tokens/run
Effort: Low
Risk: Very low
Evidence: Network configuration allows
[defaults, node, "api.github.com", "proxy.golang.org", "sum.golang.org"]but the workflow is purely local CLI inspection — no network calls observed.Action: Reduce network scope:
Expected outcome: Reduces network policy ambient context
4. Streamline Prompt Structure ⭐⭐
Estimated savings: 300,000-500,000 tokens/run
Effort: Medium
Risk: Low
Evidence: Prompt is 310 lines with 29 section headers. Includes 4 agent delegation sections (help-style-checker, help-text-typo-scanner, docs-cross-referencer, flag-consistency-checker) that are never used — workflow runs as single agent.
Action:
Remove agent delegation sections (~50 lines, ~10K tokens)
## agent: help-style-checker## agent: help-text-typo-scanner## agent: docs-cross-referencer## agent: flag-consistency-checkerConsolidate step instructions (reduce from 29 sections to ~10)
Simplify issue format template (trust agent formatting)
Trust agent to discover commands (remove explicit enumeration)
Expected outcome: Reduces prompt from 310 lines to ~150-180 lines while maintaining clarity
Total Estimated Savings
Implementation Priority
Phase 1 — Quick Wins (1 week)
Phase 2 — High Impact (2 weeks)
Phase 3 — Polish (1 week)
Caveats
Supporting Data - Configured vs Used Tools
Frontmatter configuration (
.github/workflows/cli-consistency-checker.md):MCP tool usage (from run 26102456365 logs):
{ "summary": [ { "server_name": "safeoutputs", "tool_name": "create_issue", "call_count": 1, "total_input_size": 0, "total_output_size": 0 } ], "servers": [ { "server_name": "safeoutputs", "request_count": 1, "tool_call_count": 1 } ] }Tools never called: cli-proxy (0), edit (0), web-fetch (0)
Supporting Data - Agentic Assessments
Assessment 1 - Resource Heavy:
{ "kind": "resource_heavy_for_domain", "severity": "high", "summary": "This General Automation run consumed a heavy execution profile for its task shape.", "evidence": "turns=69 tool_types=0 duration=14m8s write_actions=0", "recommendation": "Compare this run to similar successful runs and trim unnecessary turns, tools, or write actions." }Assessment 2 - Partially Reducible:
{ "kind": "partially_reducible", "severity": "low", "summary": "About 50% of this run's turns appear to be data-gathering that could move to deterministic steps.", "evidence": "agentic_fraction=0.50 turns=69", "recommendation": "Move data-fetching work to frontmatter steps: (pre-agent) writing to /tmp/gh-aw/agent/ or post-steps: (post-agent) to reduce inference cost. See the DeterministicOps guide." }Supporting Data - Prompt Structure
Current prompt statistics:
Section breakdown:
Recommendation: Consolidate to ~8-10 top-level sections without deep nesting
References: