Skip to content
Back to skills

Agent Leeway

DSecurity

Occasional check-up of this computer's Claude Code, Codex and Antigravity CLI logs with the agent-leeway command. Finds mechanical cost leaks (expired prompt cache, repeated or failing commands, re-reads, oversized tool output) and intent drift (where the agent did something other than what was asked). Use when the user asks for a leak check, an in-depth check or drift check, a token or cost waste report, or a Leeway report, or asks to update agent-leeway.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 24, 2026
ai-agentsgoshellbashgitapi

Works with

  • claude code
  • terminal
  • cli
  • api

Security analysis

D42/100
  • criticalPipes output to a shell interpreter
  • mediumUses curl or wget to download content
  • criticalDownloads and executes remote scripts — classic supply chain attack

Pro shows the line behind each finding and how to fix it

Scanned December 1, 2026

npx -y skills add Mango-Juice/agent-leeway --skill agent-leeway --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Leeway?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Leeway
[![Security: D — Skills Directory](https://www.skillsdirectory.com/api/skills/mango-juice-agent-leeway/badge)](https://www.skillsdirectory.com/skills/mango-juice-agent-leeway)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-leeway
description: Occasional check-up of this computer's Claude Code, Codex and Antigravity CLI logs with the agent-leeway command. Finds mechanical cost leaks (expired prompt cache, repeated or failing commands, re-reads, oversized tool output) and intent drift (where the agent did something other than what was asked). Use when the user asks for a leak check, an in-depth check or drift check, a token or cost waste report, or a Leeway report, or asks to update agent-leeway.
---

# Leeway (agent-leeway)

Everything here runs the `agent-leeway` program, which is installed separately and found on PATH.
Run the commands exactly as written; they work the same in bash, zsh and PowerShell.

## Commands

- `agent-leeway leak` - cost leaks in the last 30 days, by habit and by cause, direct conversations vs
  automations. Reads local logs only; no model calls. Options: `--since 2w`, `--tool claude`, `--json`.
- `agent-leeway report --tool claude --lang <en|ko>` - the report: the cost check plus the in-depth check
  results already stored for Claude Code sessions, written as Markdown and HTML files on this computer, with a
  short summary printed. Pass the language the user writes to you in (`ko` for Korean, otherwise `en`). `leak`
  and `drift` take `--lang` too. The cost side always covers every tool whose logs are found.
- `agent-leeway drift --dry-run --tool claude` - the in-depth check's plan: how many Claude Code sessions are
  in the window, which would be checked (the 50 most recent not checked yet by default, 30 for Antigravity CLI;
  one call each), the expected judging model and the estimate. Nothing is sent. If you are Codex, use `--tool codex` instead of `--tool claude` in these commands; if you are Antigravity CLI (agy), use `--tool agy`.
- `agent-leeway drift --yes --tool claude` - runs the in-depth check with the official Claude Code CLI
  (`claude -p`) on the account it is logged in with, then one grouping call that groups the problems found by
  meaning (`--no-grouping` skips it). On a subscription this counts against the plan's usage; with an API key
  it costs the dry run's estimate. Run it only after showing the dry run's numbers and getting the user's
  explicit yes in this conversation. `--max-sessions N` checks a different number of the most recent sessions
  not checked yet (0 = all); `--budget USD` adds a dollar limit, mainly for API-key users. If your command tool
  has a time limit, use a smaller `--max-sessions` or run the command in the background; stopping early is safe
  and a rerun continues. Do not estimate how long it will take: you have no measured figure for this computer.
  The only thing to say about time is the fixed sentence in paragraph ⑤.
- Only Claude Code sessions are checked by default, because checking the other tool's sessions would use the
  other provider's plan. If the user asks for both tools, use `--tool all` (it runs the other provider's CLI too,
  which needs that CLI installed and logged in). The cost check (`leak`) and the report's cost side always read
  every tool's logs found on this computer (Claude Code, Codex, and Antigravity CLI when its folder exists).
- Antigravity CLI (`--tool agy`): its sessions are not checked in depth by default, and the report's cost side
  covers only its logs. They are checked only in a way the user chooses: `--model agy=claude` or
  `--model agy=codex` (excerpts of the user's agy conversations go to Anthropic or OpenAI, through that CLI's
  login) or `--model agy=agy` (agy judges them itself, on the user's agy login and plan usage). Use one only when
  the user asks for it, and only after the user has read the dry run's line that says so (step 2) and said yes to
  it in this conversation.
- `agent-leeway idle` - recent sessions whose prompt cache has probably expired, and what resuming costs.
- `agent-leeway privacy` - where data lives and what leaves the computer.
- `agent-leeway self-update --check --lang <en|ko>` - whether a newer version exists, and the one command that
  updates this copy. It downloads nothing. `agent-leeway --version` prints the version installed.

## When the user asks for a report

Two words are fixed, toward the user: the **basic report** ("기본 리포트": cost only, made right away) and the
**in-depth check** ("정밀 점검": reads each session to see whether the agent did what was asked). Do not call it
"drift check", "이탈 점검", "판정", "판정하기" or "판정 대기".

1. Run `agent-leeway report --tool claude --lang <en|ko>`. If you are Codex, use `--tool codex` instead of `--tool claude` in these commands; if you are Antigravity CLI (agy), use `--tool agy`.
2. If the summary's last line is a question about the in-depth check, some Claude Code sessions are not
   checked in depth. Run the `agent-leeway drift --dry-run ...` command printed just before that question
   (nothing is sent). Then send exactly these five paragraphs, separated by blank lines, and nothing else (no
   list of fixes, nothing after the question):
   - ① The summary's first line, word for word, in bold.
   - ② The cost result in one or two sentences (spend, the part lost to habits, the biggest item), with the
     report's file path.
   - ③ In these words (when some sessions are already checked, start with "남은 세션은 아직 확인하지
     않았습니다." / "The remaining sessions are not checked yet." instead of the first sentence):
     "에이전트가 내 요청대로 움직였는지는 아직 확인하지 않았습니다. 이건 **정밀 점검**을 따로 실행해야 알 수
     있습니다. 정밀 점검은 세션마다 대화를 읽고, 에이전트가 요청과 다르게 한 곳과 그 이유, 고칠 점을 찾습니다." /
     "Whether the agent did what you asked has not been checked yet. That takes a separate **in-depth check**:
     it reads each session and finds where the agent did something other than what you asked, why, and what to
     change."
   - ④ From the dry run. {count} is the number of sessions its plan line says it will check, {unchecked} the
     number not checked yet (the total of its "By project" line plus any it leaves out with --max-sessions);
     drop the bracket when {count} equals {unchecked}. {model} is the name on its "Expected judging model" /
     "예상 판정 모델" line; when it has one such line per tool ("Expected judging model for Claude Code sessions"
     / "Claude Code 세션 예상 판정 모델"), {model} is each name followed by its tool in brackets, joined with
     "와" / "and", for example "Claude Opus 5.5(Claude Code)와 Gemini 4 Neon Medium(Antigravity CLI)". {usd} is
     its dollar estimate. When its plan line gives the amount in two parts (one for the Claude Code and Codex
     CLIs, one for agy), the third sentence is instead those two sentences of the plan line, word for word.
     "대상은 최근 세션 {count}개입니다(확인하지 않은 세션 {unchecked}개 중). 세션마다 {model} 모델을 한 번씩
     호출합니다. 내 Claude Code 로그인으로 호출하니, 구독이면 요금제 사용량을 쓰고 API 키면 약 ${usd}입니다.
     원하신다면 최근 10개만, 지난 1주일만, 프로젝트 하나만으로 줄일 수도 있습니다." /
     "It checks the {count} most recent sessions (of {unchecked} not checked yet). It calls {model} once per
     session. The calls run on your own Claude Code login: on a subscription they use your plan's usage, with
     an API key about ${usd}. If you like, it can be smaller: only the 10 most recent, only the last week, or one
     project."
     When the dry run gives no dollar estimate, the third sentence is "내 Claude Code 로그인으로 호출하니,
     구독이면 요금제 사용량을 씁니다." / "The calls run on your own Claude Code login and use your plan's usage
     on a subscription." Do not add a time estimate here; paragraph ⑤ carries the one sentence about time.
     For Antigravity CLI sessions judged by agy itself (`--tool agy`; its plan says "judged by agy itself" /
     "agy가 직접 판정"), the third sentence is instead "내 agy 로그인으로 agy가 직접 판정하니 agy 요금제 사용량을
     씁니다(API 정가로 환산하면 약 ${usd})." / "agy judges them itself on your own agy login, so they use your
     agy plan's usage (about ${usd} converted at API list prices)." When the plan says the Antigravity CLI
     sessions go to Anthropic or OpenAI (`--model agy=claude` or `agy=codex`), add that plan line word for word
     as the last sentence of ④.
     If you are Antigravity CLI (agy) and the dry run checks nothing because the in-depth check of Antigravity CLI
     sessions is off by default, ④ is instead the dry run's line that says so and why ("Antigravity CLI 세션의 정밀
     점검은 기본으로 꺼져 있습니다. ..." / "The in-depth check of Antigravity CLI sessions is off by default, ..."),
     word for word, and nothing else.
   - ⑤ The summary's last line, word for word, as the very last line of the message: its question in bold,
     then its second sentence as it is. Nothing after it.
3. If they answer with a different scope, run the dry run again with it and send ④ and ⑤ again. Run
   `agent-leeway drift --yes --tool claude` with the same options as the dry run they approved, only after a
   clear yes in this conversation, then run the report again and present it. If they decline, say:
   "기본 리포트는 그대로 쓰시면 됩니다. 정밀 점검은 언제든 '정밀 점검 해줘'라고 하면 됩니다." / "You can use
   the basic report as it is. Ask for the in-depth check any time."
   If you are Antigravity CLI (agy) and ④ said the check is off by default, the user answers with a way. If the
   answer names no way (such as "네" or "해줘" / "yes" or "do it"), ask again which of the three ways below; do not
   choose one for them. For a way, run `agent-leeway drift --dry-run --tool agy --model agy=claude` (Claude Code), `--model agy=codex` (Codex) or
   `--model agy=agy` (agy itself), and send ④ again from that dry run. When they chose agy itself, its plan has a
   line that starts with a note about Google ("확인: 이 방식은 ..." / "Check: this is outside ..."): put that
   whole line, word for word, as the last sentence of ④, every time. End with "**이 방법으로 정밀 점검을
   실행할까요?** 기본 리포트보다 시간이 더 걸립니다." / "**Run the in-depth check this way?** It takes longer than
   the basic report." as the very last line. Only after a clear yes, run `agent-leeway drift --yes --tool agy`
   with the same options as that dry run (its `--model` included), then run the report again with the same
   `--model`. If they want neither way, say the sentence above about the basic report.
4. If `drift` exits with code 4, the CLI did not accept the model. Tell the user, in one short paragraph: the
   CLI did not accept {model}, so the check stopped; the {done} sessions already checked are kept. Run the dry
   run it prints (with its `--model`), send ④ with the new model, and end with "남은 세션을 {next} 모델로 정밀
   점검할까요?" / "Check the remaining sessions with {next}?". Do not say whether {next} was tested. Run it only
   after a clear yes.
   If `drift` says agy judging is refused or skipped, show that line as it is and stop; use `--agy-unlock` only
   when the user asks for it. If agy did not take the model or answered with another one and the check stopped,
   show that line and let the user choose the model, instead of the dry run above (it prints none).
5. If any `agent-leeway drift` command (the dry run too) fails with a network, permission or CLI-check error
   and your command tool runs in a sandbox, ask the user to allow it to run outside the sandbox (it calls the
   Claude Code CLI, which needs the network), then run it again.
6. If the summary has no such question, everything in the period is checked: present the report without
   asking.

## Presenting the report (skip when step 2 applies)

After `agent-leeway report`, present the "What to fix first" findings in your own words or as printed,
whichever reads better in the conversation, then give the report's file path (the HTML; the Markdown copy is in
the same folder). Answer follow-up questions from the
report files. Keep these rules:

- Name the tool (Claude Code, Codex or Antigravity CLI) whenever a piece of advice is specific to one tool.
- Never compare the judges' drift rates; they are calibrated differently.
- Never edit instruction files (CLAUDE.md, AGENTS.md) or settings unless the user asks you to.
- Keep the source labels ("Official docs", "Our rule of thumb", ...) when you repeat advice.
- The judges' summaries are the judging model's words (in the user's language for results judged since rubric version +t2, in English before); present them as the judge's view, not as facts.

For other commands, show the output as it is. Amounts are USD at API list prices (list-price equivalents, not a
bill).

## When the user asks to update agent-leeway

1. Run `agent-leeway self-update --check --lang <en|ko>`. If it says the version is up to date, tell the user so
   and stop. If it fails, show its one line and stop; do not run an install line instead.
2. Otherwise it prints one command for how this copy was installed (Homebrew, Scoop or the installer), or a
   download page. Run that command exactly as printed. It needs no administrator rights, except when the output
   says to use a terminal opened as administrator (Scoop installed for all users): then do not run it; show it to
   the user and ask them to run it there. If any command asks for such rights (sudo, an administrator prompt),
   stop and ask the user first. If your command tool runs in a sandbox and the
   command fails on the network, ask the user to allow it outside the sandbox. For a download page, give the
   user the link instead of running anything.
3. Run `agent-leeway --version` and tell the user the version now installed. If Homebrew or Scoop said it was
   already up to date, say the new version has not reached it yet and to try again in a few minutes.

## If agent-leeway is not installed

If running `agent-leeway` fails because the command is not found, do not download or install anything on your
own. Show the user the install line for their system and ask whether you should run it:

- macOS or Linux: `curl -fsSL https://raw.githubusercontent.com/Mango-Juice/agent-leeway/main/install/install.sh | sh`
- Windows (PowerShell): `irm https://raw.githubusercontent.com/Mango-Juice/agent-leeway/main/install/install.ps1 | iex`

Run it only after the user says yes in this conversation. It downloads the release from GitHub, checks it
against the release's checksums, installs the program and adds this skill for Claude Code and Codex (the Antigravity CLI reads the Codex copy). Then run
your command again, with the full path the installer printed if `agent-leeway` is still not found (a new
terminal picks up the PATH change).

<!-- agent-leeway skill repository copy sha256:d8c615276243d70ae560229f32afc8aca83a961b47abfc1311dc6bfa4f8c265b (installed by `agent-leeway install-skills`; `agent-leeway uninstall-skills` removes it) -->

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.