ai-sdlc-workflow: Command for Claude Code

.cursor/commands/ai-cost-check.md

ai-cost-check is a command for Claude Code, Cursor from phuoctrung-ppt/ai-sdlc-workflow. It costs 55 tokens per session (323 once invoked), scanned A, original, MIT.

A review command for checking whether an AI feature follows the project's rules for language-model use, spending, safety, and explanations. It reads the project's AGENTS.md instructions before auditing the specified code path.

In plain words
What is it for?
Use it to audit code that calls language models, checking routing, cost tracking, fallbacks, input handling, human approval, and explanations for decisions that affect users.
Why use it?
It finds common problems such as scattered provider calls, missing budget checks, incomplete usage records, unsanitized input, or missing human review for high-impact decisions. The result is a PASS or FAIL report with specific issues and file locations.

Command for Claude CodeCursor

Written for Cursor and Claude Code: installed under .cursor/, but also a Claude Code command (commands/*.md). Also seen: mentions AGENTS.md.

This is phuoctrung-ppt/ai-sdlc-workflow's own configuration. It tells Claude Code and Cursor how to work on ai-sdlc-workflow itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-sdlc-workflow configures →

Reuse

Borrowing it

Nothing to install: this file belongs to phuoctrung-ppt/ai-sdlc-workflow. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/phuoctrung-ppt/ai-sdlc-workflow/master/.cursor/commands/ai-cost-check.md
Clone the repo
git clone --depth 1 https://github.com/phuoctrung-ppt/ai-sdlc-workflow

Made for: Claude Code, Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-cost-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/phuoctrung-ppt/ai-sdlc-workflow/ai-cost-check/github.svg)](https://agentmods.dev/commands/phuoctrung-ppt/ai-sdlc-workflow/ai-cost-check)
Your own site
<a href="https://agentmods.dev/commands/phuoctrung-ppt/ai-sdlc-workflow/ai-cost-check"><img src="https://agentmods.dev/badge/commands/phuoctrung-ppt/ai-sdlc-workflow/ai-cost-check/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-cost-check

Your own site · 80×15
<a href="https://agentmods.dev/commands/phuoctrung-ppt/ai-sdlc-workflow/ai-cost-check"><img src="https://agentmods.dev/badge/commands/phuoctrung-ppt/ai-sdlc-workflow/ai-cost-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 323 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.00323
Opus 5 $0.00028 $0.00161
Sonnet 5 $0.00011 $0.00065
Haiku 4.5 $0.00006 $0.00032

Measured 8d ago against content hash 1b8dd64efb09, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

ai-cost-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/commands/ai-cost-check.md · 25 lines

What it actually says

Domain command — only relevant when AGENTS.md §2 AI/LLM ≠ none. Skip for projects with no LLM features.

Act as AI Worker compliance review.

Review: {ai_code_path}

Read AGENTS.md §2 (AI/LLM providers, cost policy) and §5 (AI ethics requirements) before auditing.

Verify:

  1. All LLM calls route through a central router/service — no direct provider calls scattered in controllers or routes
  2. Budget check performed before every LLM call; cost usage logged after every call
  3. Usage event emitted after each call with: provider, model, tokens in/out, cost_usd, latency_ms (and any project-specific dimensions from AGENTS.md §2)
  4. Fallback provider configured on primary failure
  5. Cost calculation uses a shared utility (not duplicated per caller)
  6. Human-in-the-loop gate for consequential AI decisions (per AGENTS.md §5 — e.g. hire/reject, loan, medical)
  7. XAI explanation returned for AI decisions that affect users (confidence score, key factors)
  8. User input sanitized before passing to LLM

Output: PASS/FAIL with specific issues and file:line references.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 25 lines · 55 tokens per session scan A 1b8dd64efb09

Subscribe to this mod's changes

ai-cost-check is a command published in the GitHub repository phuoctrung-ppt/ai-sdlc-workflow (2 stars, last pushed yesterday), licensed MIT. It adds 55 tokens to every session and 323 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.