Skip to content

[plan] Optimize prompt token usage in workflow runs #6859

@github-actions

Description

@github-actions

Objective

Reduce token consumption in workflow runs by trimming verbose prompts and enabling summarization where appropriate.

Context

Token usage spiked ~4x to 1.71M tokens across the last 10 runs, suggesting inefficient prompt construction or unnecessarily verbose outputs.

Approach

  1. Analyze the last 10 workflow runs to identify top token consumers:
    • Use gh aw logs or audit commands to extract token usage per step
    • Identify prompts/steps with highest token counts
  2. Review prompt construction in high-cost steps:
    • Look for redundant context or instructions
    • Check for unnecessary verbosity in system prompts
    • Identify opportunities for summarization
  3. Implement optimizations:
    • Trim verbose instructions where possible
    • Enable output summarization for intermediate steps
    • Remove redundant context from prompts
  4. Validate changes don't reduce quality

Files to Modify

  • .github/workflows/*.md - Workflow source files with prompts
  • Any agent configuration files affecting prompt construction

Acceptance Criteria

  • Token usage reduced by at least 50% (target: <850k for 10 runs)
  • Output quality maintained (no regression in agent effectiveness)
  • Top 3 token-consuming steps identified and optimized
  • Changes documented with before/after token counts

Estimated Effort

Medium (3-5 hours)
Related to #6857

AI generated by Plan Command for discussion #6855

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions