Home›GitHub Copilot›GitHub Agentic Workflowsのトークン効率改善手法

GitHub Agentic Workflowsのトークン効率改善手法Improving token efficiency in GitHub Agentic Workflows

元記事を読むRead original articlegithub.blog(新しいタブで開きます)(opens in a new tab)
AI2 点サマリSummary highlight
  • GitHubは、PR毎に実行されるAgentic Workflowsが膨大なAPIコストを生む問題に対し、本番ワークフローを計測してMCPツール選定・コンテキスト圧縮・プロンプト改善で非効率を特定し、自動修正するエージェントを構築した。
  • LLM呼び出しコストを抑えより多くのワークフローを安定実行できる。

GitHub instrumented its production agentic workflows to uncover token inefficiencies, then built agents that fix them through MCP tool selection, context compression, and prompt tuning, cutting LLM costs and enabling more workflows to run reliably.

本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (github.blog) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (github.blog).

要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.

コストの課題

GitHubは、PRごとに実行されるGitHub Agentic Workflowsのトークン効率を改善する手法を示した。リポジトリ内の小さな問題を継続的に片付け、衛生状態や品質を大きく改善できる一方、LLMの利用に伴うAPIコストの増加が開発者にとって課題となる。

CIジョブとして自動的にスケジュールされ、条件に応じて起動するため、利用者から見えにくいところでコストが積み重なる可能性がある。とりわけPRごとに動く構成では、実行回数の多さが膨大なコストにつながる。

YAMLの反復性

対話型のデスクトップセッションでは、開発者がセッション中に行う作業を事前に予測しにくい。これに対してAgentic Workflowsの処理内容はYAMLに完全に記述され、実行のたびに同じ形で繰り返される。この性質により、自動化処理の効率化は、対話型セッションを効率化する場合より取り組みやすいと説明されている。

GitHub自身もGitHubリポジトリでこれらのワークフローを保守・利用しており、利用者と同様にトークン効率を重視している。

本番での計測

GitHubは2026年4月、日常的に利用する多数のワークフローについて、トークン使用量の体系的な最適化を開始した。本番環境のAgentic Workflowsを計測し、どの処理でトークンが非効率に消費されているかを特定する方法を採った。

単に総使用量を見るのではなく、実際に稼働しているワークフローを対象として非効率を明らかにし、その結果を修正へ結び付けている。

MCPツール選定

特定した非効率を自動修正するため、GitHubはエージェントを構築した。改善対象はMCPツールの選定、コンテキスト圧縮、プロンプト改善である。これらを通じて不要なトークン消費を抑え、LLM呼び出しのコストを削減する。

その結果、より多くのワークフローを安定して実行できるようになるとされる。

GitHub Agentic Workflows

GitHub Agentic Workflows can act like teams of street sweepers, cleaning up small messes across a repository. This can improve repository hygiene and quality, but workflows that run for every pull request can generate substantial API costs, making token efficiency an important concern.

Unlike interactive desktop sessions, these automations are automatically scheduled or triggered. Their costs can therefore accumulate out of view as executions continue.

Repeats Every Execution

Optimizing automations is easier than optimizing interactive developer sessions because the work performed by an agentic workflow is fully specified in YAML and repeats with every execution. Work during a developer session can be difficult to predict, while a recurring workflow provides a consistent target for measurement and improvement.

GitHub maintains and uses Agentic Workflows in its own repositories. In April 2026, it began systematically optimizing token usage across many of the workflows it relies on every day.

Production Agentic Workflows

GitHub instrumented its production agentic workflows to identify where tokens were being used inefficiently. Measuring real workflows allowed it to uncover inefficiencies associated with MCP tool selection, the amount of context provided to the model, and the prompts directing the work.

GitHub then built agents that can address those inefficiencies automatically. The fixes focus on selecting MCP tools more effectively, compressing context, and tuning prompts rather than changing the recurring work itself.

Token Efficiency

The goal of these changes is to reduce the cost of LLM calls while preserving the repository hygiene and quality benefits of agentic workflows. Lower token usage also allows more workflows to run reliably without letting API costs grow unchecked through repeated, automatically triggered executions.

Because the workflows are defined in YAML and perform specified work each time, the same measurement and optimization process can be applied systematically across the production automations GitHub uses.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPokoPRごとに動く仕組みって、どうして気づかないうちにAPIコストが膨らむの?Why can workflows that run on every PR rack up API costs before anyone notices?
  2. TECHガイドTECH Guide自動で予定・起動され、実行のたびにトークンを使うからじゃ。この記事では、本番を計測して無駄を見つけ、自動修正するエージェントを構築しておる。They run automatically and consume tokens each time. The article says GitHub measured production workflows, found waste, and built agents to fix it automatically.
  3. ポコPokoリポジトリを掃除するチームが、道具や荷物を整理して少ない燃料で何度も働けるようにする感じ?So it’s like helping a repo-cleaning crew organize its tools and load, so it can work repeatedly on less fuel?
  4. TECHガイドTECH Guideそんなイメージじゃ。紹介された方法は、MCPツールの選定、コンテキスト圧縮、プロンプト改善で、LLMコストを抑えつつ多くの処理を安定して動かす狙いじゃよ。That’s the idea. The methods described are MCP tool selection, context compression, and prompt tuning, aimed at lowering LLM costs while running more workflows reliably.
  5. ポコPokoつまり、同じ仕事を繰り返す自動処理だからこそ、トークンの無駄を見つけて直しやすいんだね!So because the automation repeats a defined job, it’s easier to spot and fix wasted tokens. Got it!
  6. TECHガイドTECH Guideそうじゃ。本文では作業がYAMLで定義され毎回繰り返される一方、自動実行ゆえに小さな無駄も積み重なる点が要注意じゃのう。Exactly. The piece notes that the work is defined in YAML and repeats each run—but because it runs automatically, even small inefficiencies can add up.
記事情報・収集記録Article details & collection record
出典Source
GitHub Copilot Blog公式Official
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
ブログBlog
原文言語Source language
EN
重要度の位置づけImportance in this lane
InfoInformational(GitHub Copilot 218件中、同等以上 218件)(218 of 218 GitHub Copilot entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
1.7 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
長期 (アーキテクチャ)Long-term (architecture)

🧠GitHub Copilot の他の記事More from GitHub Copilotもっと見る →View more →

ページ上部へScroll to top