obs-cost — ai-agents obs-cost, shepard-obs-stack, community, ai-agents, ide skills, claude-code, gemini-cli, grafana, observability, opentelemetry, Claude Code

v1.0.0
GitHub

About this Skill

Perfect for AI Coding Agents needing advanced cost analysis and observability capabilities. Self-hosted observability for AI coding agents. Clone. Configure. See.

# Core Topics

shepard-system shepard-system
[60]
[4]
Updated: 3/12/2026

Agent Capability Analysis

The obs-cost skill by shepard-system is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. Optimized for ai-agents, claude-code, gemini-cli.

Ideal Agent Persona

Perfect for AI Coding Agents needing advanced cost analysis and observability capabilities.

Core Value

Empowers agents to analyze cost and token usage breakdown by provider and model using Prometheus queries, providing insights into Claude cost by model, total cost, and token usage, as well as session count per provider, all through a self-hosted observability platform.

Capabilities Granted for obs-cost

Analyzing cost and token usage for Claude and Gemini models
Generating cost and session reports for AI coding agents
Optimizing AI model usage based on cost and performance metrics

! Prerequisites & Limits

  • Requires Prometheus API access
  • Limited to Claude and Gemini models
  • Needs scripts/obs-api.sh for query execution
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

obs-cost

Install obs-cost, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Obs Cost Report

Cost and token usage breakdown by provider and model.

Arguments

User may specify a time range. Default: 24h. Mapping: today24h, yesterday → offset query, week7d. Replace [24h] in queries below with the appropriate range.

Queries to run

Use scripts/obs-api.sh for all queries. Run independent queries in parallel.

Claude cost by model

bash
1scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[] | select(.metric.model != "") | "\(.metric.model)\t\(.value[1])"' --data-urlencode 'query=sort_desc(sum by (model) (max_over_time(shepherd_claude_code_cost_usage_USD_total[24h])))'

Claude cost total

bash
1scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[0].value[1] // "0"' --data-urlencode 'query=sum(max_over_time(shepherd_claude_code_cost_usage_USD_total[24h]))'

Claude tokens by type

bash
1scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[] | select(.metric.type != "") | "\(.metric.type)\t\(.value[1])"' --data-urlencode 'query=sort_desc(sum by (type) (max_over_time(shepherd_claude_code_token_usage_tokens_total[24h])))'

Gemini tokens by type

bash
1scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[] | select(.metric.type != "") | "\(.metric.type)\t\(.value[1])"' --data-urlencode 'query=sort_desc(sum by (type) (max_over_time(shepherd_gemini_cli_token_usage_total[24h])))'

Codex tokens

bash
1scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[0].value[1] // "0"' --data-urlencode 'query=sum(sum_over_time(shepherd:codex:tokens_input:1m[24h]))' 2scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[0].value[1] // "0"' --data-urlencode 'query=sum(sum_over_time(shepherd:codex:tokens_output:1m[24h]))'

Session count per provider

bash
1scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[0].value[1] // "0"' --data-urlencode 'query=count(max_over_time(shepherd_claude_code_session_count_total[24h]))' 2scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[0].value[1] // "0"' --data-urlencode 'query=count(max_over_time(shepherd_gemini_cli_session_count_total[24h]))' 3scripts/obs-api.sh prom /api/v1/query --raw --jq '.data.result[0].value[1] // "0"' --data-urlencode 'query=sum(sum_over_time(shepherd:codex:sessions:1m[24h]))'

Output columns

SectionColumns
Cost by modelModel | Cost ($)
TokensProvider | Type | Count
SessionsProvider | Count

For output format options (table/csv/json), read .claude/skills/obs-shared/assets/output-formats.md.

Presentation

  1. Total cost (sum across providers)
  2. Cost by model table
  3. Token breakdown per provider (input/output/cache)
  4. Session count per provider
  5. Calculate cost-per-session and tokens-per-dollar where meaningful
  6. If all values are 0: "No activity in the last 24h. Stack may not be receiving telemetry — try /obs-status."
  7. Note: only Claude emits cost metrics. Gemini and Codex show tokens only.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is obs-cost?

Perfect for AI Coding Agents needing advanced cost analysis and observability capabilities. Self-hosted observability for AI coding agents. Clone. Configure. See.

How do I install obs-cost?

Run the command: npx killer-skills add shepard-system/shepard-obs-stack/obs-cost. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for obs-cost?

Key use cases include: Analyzing cost and token usage for Claude and Gemini models, Generating cost and session reports for AI coding agents, Optimizing AI model usage based on cost and performance metrics.

Which IDEs are compatible with obs-cost?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for obs-cost?

Requires Prometheus API access. Limited to Claude and Gemini models. Needs scripts/obs-api.sh for query execution.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add shepard-system/shepard-obs-stack/obs-cost. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use obs-cost immediately in the current project.

Related Skills

Looking for an alternative to obs-cost or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI