Skip to main content

agent-cost

Estimate the cost of the current coding task with the agent-cost CLI. Use when a user asks what an agent run may cost, which configured model is the balanced choice, or invokes /agent-cost before starting coding work.

Jump to install

Source facts

Repository
devinat1/agent-cost
Last source activity
July 11, 2026 at 16:11
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
2 files

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
agent-cost
description
Estimate the cost of the current coding task with the agent-cost CLI. Use when a user asks what an agent run may cost, which configured model is the balanced choice, or invokes /agent-cost before starting coding work.
# Agent Cost Infer the concrete coding task from the current conversation and estimate it in the current Git repository. Ask for task text only when the conversation does not contain a concrete task. ## Run the estimate 1. Confirm the workspace is a Git repository and `git ls-files` returns at least one file. Stop clearly if either check fails. Never add untracked content to the estimate. 2. Check `node --version` is at least 22.12 and `npm --version` succeeds. If not, stop and direct the user to install a current Node.js LTS release from nodejs.org; do not install Node or npm. 3. If the `agent-cost` executable is unavailable, run: ```sh npm install --global @devinat1/agent-cost ``` 4. Use the current workspace as `--repo`. Pass the inferred task as one argument without interpolating it into shell syntax. Prefer an argv-capable execution tool; otherwise write it to a secure temporary file with platform APIs, pass `--task @<path>`, and delete the file afterward. 5. Use a user-provided budget override when present; otherwise use `0.50`. Run: ```sh agent-cost preflight --repo <workspace> --task <task-or-@file> --probe-budget <budget> --yes --json ``` 6. If the command reports that no profile exists, run `agent-cost profile` in an interactive terminal. This securely prompts for a missing OpenRouter key, saves it in the user config directory, and launches model/access setup. Then rerun the preflight once. Invoking this skill authorizes the bounded paid preflight and transmission of the CLI's displayed Git-tracked context through OpenRouter. Do not ask for another confirmation. Never print, echo, read back, or place the API key in a repository. ## Return the result Read the final JSON result. Find `recommendations.balanced`, then the matching entry in `models`. Return only: - model ID and its configured access path or paths; - predicted `costUsd.low`–`costUsd.high` range; - confidence. If no balanced model exists or the command fails, return one short cause and the next action. Do not run `record` or `history`.
View on GitHub