Coding Agents
LeftSize has no separate API, CLI or MCP server for agents, and it doesn’t need one. Findings are GitHub Issues, you ask for detail with an @leftsize comment, and the answer arrives as a comment.
That means any agent that can run gh, or use the GitHub MCP server, can already work with your findings. This page covers the conventions it needs to know.
Tip
Rather than paste this page into your agent, install the skill. It loads these conventions automatically:
npx skills add LeftSize/agent-skills
The source is at github.com/LeftSize/agent-skills.
The mental model
| You want to… | The agent does… |
|---|---|
| See all findings | gh issue list --label leftsize |
| Narrow them down | Filter on cost-optimization, cloud:aws, severity:high, rule:<id> |
| Read one finding | gh issue view <n> --comments |
| Get the fix | Comment @leftsize howto or @leftsize script terraform, then read the reply |
| Dismiss or postpone | Comment @leftsize ignore <reason> or @leftsize snooze 3m |
| Mark it fixed | gh issue close <n> |
Everything is an ordinary GitHub action, so it shows up in the issue history with an author and a timestamp, visible to your whole team.
Prerequisites
- The GitHub CLI installed and authenticated as yourself (
gh auth login), or the GitHub MCP server - Access to the repository where LeftSize opens issues
Finding the findings
Every LeftSize issue has the leftsize label and is opened by leftsize[bot].
# All open findings
gh issue list --repo acme/cloud --label leftsize
# Cost findings on AWS
gh issue list --repo acme/cloud --label leftsize --label cost-optimization --label cloud:aws
# Only high severity
gh issue list --repo acme/cloud --label leftsize --label severity:high
| Label | Values |
|---|---|
leftsize |
On every LeftSize issue |
| Category | cost-optimization, deprecation, security, governance |
cloud: |
aws, azure |
severity: |
critical, high, medium, low, info |
rule: |
The rule id, for example rule:leftsize-unattached-disk |
resource-type: |
For example resource-type:disk |
Cost issue titles end with the estimated savings, such as [COST] 3 unattached disks (≈ $42/mo), so an agent can total and rank them from gh issue list --json number,title,labels.
Reading a finding
gh issue view 31 --repo acme/cloud --comments
Each issue covers one rule in one scope (an Azure resource group, or an AWS account and region). The body lists the affected resources with their ids, the estimated savings, the available commands and example fix commands. Every scan rewrites the body with the current state. The comments hold earlier answers from LeftSize and your team’s discussion.
Asking for more detail
Post a command as a comment. LeftSize replies with a new comment, usually within a few seconds:
gh issue comment 31 --repo acme/cloud --body '@leftsize script aws-cli'
gh issue view 31 --repo acme/cloud --comments
explain, howto, impact, alternatives, script <type> and prompt only add a comment and change nothing. See Commands for the full reference.
Acting on a finding
# Postpone: closes now, reopens after 3 months if the problem is still there
gh issue comment 31 --repo acme/cloud --body '@leftsize snooze 3m'
# Dismiss for good, with a reason for the team
gh issue comment 31 --repo acme/cloud --body '@leftsize ignore Batch account, idle by design'
# Fixed it
gh issue close 31 --repo acme/cloud --reason completed --comment 'Removed the unused functions.'
Confirm before closing
ignore, wrong and closing the issue are permanent: LeftSize won’t reopen the issue or open a new one for that rule and scope. A good starting pattern is to let the agent propose what to fix, snooze and ignore, and have a person approve it.
LeftSize itself only reads. It never changes your infrastructure, and commands like stop or delete are refused. When the agent fixes something, it does so with your own tools and permissions, ideally as a pull request to your infrastructure code.
Things agents get wrong
- Any
@leftsizein a comment is a command. LeftSize runs the first@leftsizeanywhere in the comment. An agent writing a note should write “LeftSize” without the@. - Comments from bots are ignored. Commands posted by
github-actions[bot]or another GitHub App do nothing. The agent must comment as you. - Replies are asynchronous. The answer isn’t in the output of
gh issue comment; read the comments again a few seconds later. scriptdefaults to Azure CLI, also on AWS issues. Use@leftsize script aws-clifor AWS.
Running a scan
gh workflow run leftsize.yml --repo acme/cloud
The run’s job summary shows the findings per rule and the estimated savings. See Troubleshooting if a scan fails.
Giving agents the documentation
These docs are available as Markdown for agents:
| File | What it is |
|---|---|
support.leftsize.com/llms.txt |
Index of every docs page |
support.leftsize.com/<page>.md |
Any docs page as Markdown, for example commands.md |
leftsize.com/llms.txt |
Product overview and every rule |
Which agents work
Anything that can run shell commands or use the GitHub MCP server: Claude Code, Codex, Cursor, Copilot, Devin, Gemini, OpenCode and others. Nothing here is agent-specific.
Related
- Commands: the complete command reference
- How It Works: the scan cycle and issue lifecycle
- Rules: every rule LeftSize checks
Was this article helpful?