Home / Companies / GitHub / Blog / Post Details
Content Deep Dive

Improving token efficiency in GitHub Agentic Workflows

Blog post from GitHub

Post Details
Company
Date Published
Author
Landon Cox, Mara Kiefer
Word Count
2,673
Language
English
Hacker News Points
-
Summary

GitHub Agentic Workflows are automated processes designed to maintain repository hygiene and improve code quality, but can incur hidden costs due to their automated nature. By optimizing token usage in these workflows, GitHub aims to reduce operational costs. They have implemented an API proxy to capture token usage across different agent frameworks, converting data into a unified format to identify inefficiencies. This initiative led to the development of two daily workflows: the Daily Token Usage Auditor, which monitors and reports on token consumption, and the Daily Token Optimizer, which identifies inefficiencies and suggests improvements. Initial optimization efforts have shown significant reductions in token consumption for several workflows, such as Auto-Triage Issues and Security Guard, by eliminating unused tools and replacing GitHub MCP calls with more efficient GitHub CLI commands. Although measuring efficiency gains is complex due to varying workloads and token costs, the introduction of an Effective Tokens (ET) metric helps normalize cost savings. The ongoing optimization strategy includes refactoring agents into smaller sub-agents and shifting from workflow-level to system-level optimization to reduce redundancy and improve efficiency across the entire automation portfolio.