cost-management-mcp: Instructions file for Claude Code

CLAUDE.md

cost-management-mcp CLAUDE.md is an instructions file for Claude Code from knishioka/cost-management-mcp. It costs 2,172 tokens per session, scanned A, original, MIT.

Claude Code instructions for a TypeScript Model Context Protocol server that monitors costs and usage across cloud and API providers. Claude Code is a coding assistant that follows repository instructions while changing code.

In plain words
What is it for?
Use it when developing, building, testing, linting, type-checking, or committing changes to the cost-management-mcp repository.
Why use it?
It gives developers the project's purpose, commands, provider structure, and checks to run before committing changes.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: positional $N argument.

This is knishioka/cost-management-mcp's own configuration. It tells Claude Code how to work on cost-management-mcp 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 cost-management-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to knishioka/cost-management-mcp. 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/knishioka/cost-management-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/knishioka/cost-management-mcp

Made for: Claude Code.

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 cost-management-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/knishioka/cost-management-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/knishioka/cost-management-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/knishioka/cost-management-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/knishioka/cost-management-mcp/claude-md/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 cost-management-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/knishioka/cost-management-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/knishioka/cost-management-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,172 This file is loaded in full into every session.
When invoked 2,172 The same file — it is already loaded in full.
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.02172 $0.02172
Opus 5 $0.01086 $0.01086
Sonnet 5 $0.00434 $0.00434
Haiku 4.5 $0.00217 $0.00217

Measured 10d ago against content hash 81fe31faa7d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

cost-management-mcp CLAUDE.md 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 10d 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.

CLAUDE.md · 366 lines

How it starts

The opening of the file, as written. The whole thing — 366 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Development Guidelines for Cost Management MCP

Project Overview

This is a Model Context Protocol (MCP) server that provides unified cost monitoring across multiple cloud and API providers (AWS, OpenAI). The server allows users to retrieve cost data, monitor usage, and track expenses across different services through a consistent interface.

Key Commands

Development

  • npm run dev - Start development server with hot reload
  • npm run build - Build TypeScript to JavaScript
  • npm run test - Run all tests
  • npm run lint - Check code style
  • npm run typecheck - Check TypeScript types

Before Committing

Pre-commit hooks are configured to automatically run checks:

  • ESLint - Automatically fixes code style issues
  • Prettier - Formats code for consistency

The hooks run automatically on git commit. To run checks manually:

npm run lint
npm run typecheck
npm test

If you need to bypass hooks temporarily (not recommended):

git commit --no-verify -m "your message"

Architecture Overview

Provider Structure

Each provider (AWS, OpenAI) has:

  • client.ts - API client implementation
  • types.ts - TypeScript type definitions
  • transformer.ts - Transforms provider data to unified format

Unified Data Model

interface UnifiedCostData {
  provider: 'aws' | 'openai';
  period: { start: Date; end: Date };
  costs: {
    total: number;
    currency: string;
    breakdown: Array<{
      service: string;
      amount: number;
      usage?: { quantity: number; unit: string };
    }>;
  };
  metadata: {
    lastUpdated: Date;
    source: 'api' | 'cache' | 'manual';
  };
}

Implementation Guidelines

Error Handling

  • Always use custom error classes from src/common/errors.ts
  • Implement retry logic with exponential backoff for API calls
  • Log errors appropriately without exposing sensitive data
  • Provide meaningful error messages to users

Caching Strategy

  • Cache all API responses to minimize costs (especially AWS at $0.01/request)
  • Default TTL: 1 hour (configurable via CACHE_TTL env var)
  • Implement cache invalidation on demand
  • Use separate cache keys for each provider/query combination

Read the full file on GitHub · 366 lines

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. 10d ago First seen · 366 lines · 2,172 tokens per session scan A 81fe31faa7d7

Subscribe to this mod's changes

cost-management-mcp CLAUDE.md is an instructions file published in the GitHub repository knishioka/cost-management-mcp (0 stars, last pushed 10d ago), licensed MIT. It adds 2,172 tokens to every session, about $0.0109 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-09-01.

Related

Other instructions, from other repositories