output-dev-cost-hooks

output-dev-cost-hooks is a skill for Claude Code from growthxai/output. It costs 63 tokens per session (2,741 once invoked), scanned A, original, Apache-2.0.

A guide for subscribing to software cost events and forwarding language-model and web-request spending to an observability system.

In plain words
What is it for?
It helps send cost data to webhooks, structured logs, metrics systems, and real-time workflow-spend reports.
Why use it?
It makes per-request spend available for logs, dashboards, alerts, and audits instead of leaving costs visible only inside the application framework.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the outputai plugin — 51 skills, 5 agents, 1 hook shipped together

Good fit It helps send cost data to webhooks, structured logs, metrics systems, and real-time workflow-spend reports.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/growthxai/output/output-dev-cost-hooks
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add growthxai/output --skill output-dev-cost-hooks
Clone the repo
git clone --depth 1 https://github.com/growthxai/output

Made for: Claude Code.

Or install outputai, the plugin that ships this one along with the rest of its 51 skills, 5 agents, 1 hook.

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 output-dev-cost-hooks

README.md
[![agentmods](https://agentmods.dev/badge/skills/growthxai/output/output-dev-cost-hooks/github.svg)](https://agentmods.dev/skills/growthxai/output/output-dev-cost-hooks)
Your own site
<a href="https://agentmods.dev/skills/growthxai/output/output-dev-cost-hooks"><img src="https://agentmods.dev/badge/skills/growthxai/output/output-dev-cost-hooks/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 output-dev-cost-hooks

Your own site · 80×15
<a href="https://agentmods.dev/skills/growthxai/output/output-dev-cost-hooks"><img src="https://agentmods.dev/badge/skills/growthxai/output/output-dev-cost-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,741 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.00063 $0.02741
Opus 5.5 $0.00025 $0.01096
Sonnet 5.5 $0.00013 $0.00548
Haiku 4.5 $0.00006 $0.00274

Measured 17d ago against content hash cd3c56afb1bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

output-dev-cost-hooks 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 17d 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.

coding_assistants/claude/plugins/outputai/skills/output-dev-cost-hooks/SKILL.md · 242 lines

How it starts

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

Cost Observability Hooks

Overview

This skill documents how to subscribe to Output's cost events so every priced LLM call and every HTTP call with attached cost (via addRequestCost, see output-dev-http-client-create) can be forwarded to your own observability system — a webhook, a structured log pipeline, a metrics backend, etc. Handler errors are caught and logged by the framework; they never affect the workflow or the request that triggered them.

When to Use This Skill

  • Forwarding per-call spend to an external observability/webhook endpoint
  • Logging cost events as structured fields for a log platform
  • Building alerting or dashboards on top of workflow spend
  • Auditing which workflows/activities are driving cost, in real time rather than after the fact

This skill is about project-wide hook registration for cost data already emitted by the framework. To make an HTTP client emit cost in the first place, see output-dev-http-client-create.

Setup

1. Create a hook file

// src/cost_hooks.ts
import { on } from '@outputai/core/hooks';
import type { HttpRequestCostEvent } from '@outputai/core/http';
import type { LLMGenerationMeteringEvent } from '@outputai/core/llm';

on<HttpRequestCostEvent>('cost:http:request', async event => {
  // handle HTTP cost
});

on<LLMGenerationMeteringEvent>('llm:generation:metering', async event => {
  // handle LLM cost
});

2. Register the file

Add the file to outputai.hookFiles in package.json, alongside any existing hook files. Paths are relative to the package root and point at the built .js output — npm run output:worker:build compiles src/ to dist/ (per tsconfig.json's rootDir/outDir), so src/cost_hooks.ts is registered as dist/cost_hooks.js, not the .ts source itself. The worker loads these files at startup.

{
  "outputai": {
    "hookFiles": [
      "./dist/cost_hooks.js"
    ]
  }
}

If you'd rather skip the build step, a hook file can also be plain, uncompiled JavaScript registered directly at its src/ path ("./src/cost_hooks.js") — see https://docs.output.ai/operations/error-hooks for that variant. The rest of this skill uses TypeScript + the built-output path, since that's what the framework's own examples (and every other file in a scaffolded project) use.

Read the full file on GitHub · 242 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. 17d ago Changed · +7 lines cd3c56afb1bd
  2. 1mo ago Changed 5330bd9a068c
  3. 1mo ago Changed 3d09db333164
  4. 2mo ago Changed · -1 lines 15fc2c0f676a
  5. 2mo ago First seen · 236 lines · 63 tokens per session scan A 757fe51f7dcd

Subscribe to this mod's changes

output-dev-cost-hooks is a skill published in the GitHub repository growthxai/output (445 stars, last pushed today), licensed Apache-2.0. It adds 63 tokens to every session and 2,741 once invoked, about $0.0003 per session on Opus 5.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-19.

Related

output-dev-cost-hooks compared with skills from other repositories

output-dev-cost-hooks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
output-dev-cost-hooksgrowthxai/outputSkill445todayApache-2.0A63Claude Code
ax-aiax-llm/axSkill3.0ktodayApache-2.0A105Claude Code, Codex
ax-agent-rlmax-llm/axSkill3.0ktodayApache-2.0A88Claude Code, Codex
ax-cpp-aiax-llm/axSkill3.0ktodayApache-2.0A47Claude Code, Codex
ax-cpp-genax-llm/axSkill3.0ktodayApache-2.0A48Claude Code, Codex
ax-java-genax-llm/axSkill3.0ktodayApache-2.0A49Claude Code, Codex
ax-agentax-llm/axSkill3.0ktodayApache-2.0A131Claude Code, Codex