Credited skills
Skill 44 of 54
Analyze and reduce token consumption in agentic workflows — guardrail-specific entry points, measurement, and optimization techniques.
3 minutes · 576 words · 12 sections
Help users reduce the AI token usage and cost of GitHub Agentic Workflows in this repository.
Load these files from github/gh-aw (they are not available locally).
.github/aw/github-agentic-workflows.md.github/aw/token-optimization.md.github/aw/workflow-editing.md.github/aw/syntax.mdLoad these only when relevant:
.github/aw/experiments.md.github/aw/safe-outputs.mdgh aw audit <run-id> --json
gh aw audit <base-run-id> <optimized-run-id>
gh aw logs <workflow-name> --json
gh aw compile <workflow-name>
gh aw statusAsk for one of these inputs:
If the user gives a GitHub Actions run URL:
gh aw audit <run-id> --jsonagent_usage.aic, agent_usage.input_tokens, agent_usage.output_tokens, agent_usage.cache_read_tokensThe workflow was stopped because it consumed more AI Credits than the configured per-run budget.
Priority checks:
token-usage.jsonl)The workflow is being blocked because its 24-hour AI Credits budget is exhausted.
Priority checks:
The Copilot SDK hit the tool-denial threshold, indicating the prompt attempted actions outside the allowed tool policy.
Priority checks:
The agent ran out of time or turns before completing the task.
Priority checks:
max-turns or timeout-minutes be raised, or should the task be split?After measuring token usage, produce a prioritized plan:
gh aw audit <run-id> --json and summarize AI Credits and per-call token breakdowngh-proxy, cli-proxy, prompt trimmingcache-memory when cross-run reuse is useful; apply relevant recurring patterns to similar casesexperiments: entry, compare output quality first, and use metric: "aic" to choose among equivalent-quality variantsPresent the plan clearly before making any edits. Confirm with the user before applying changes.
.github/workflows/<workflow-name>.mdgh aw compile <workflow-name>.lock.ymlCredited
This skill is installed in github/gh-aw — in use here rather than published from here — so there is no install command for it on this page.
main, last pushed 24 September 2026.SKILL.md, not by matching a directory convention. 4 distinct layouts observed: .claude/skills/*/SKILL.md, .github/skills/*/SKILL.md, .squad/*/skill.md, SKILL.md (repo root).h1 and no skipped levels:/github/gh-aw.md, and each skill at its own .md URL.