output-dev-cost-hooks

output-dev-cost-hooks is a skill for Claude Code from growthxai/output. It costs 63 tokens per session (2,555 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,555 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.02555
Opus 5.5 $0.00025 $0.01022
Sonnet 5.5 $0.00013 $0.00511
Haiku 4.5 $0.00006 $0.00255

Measured 3d ago against content hash 3d09db333164, 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 3d 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 · 235 lines

How it starts

The opening of the file, as written. The whole thing — 235 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/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 · 235 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. 3d ago Changed 3d09db333164
  2. 18d ago Changed · -1 lines 15fc2c0f676a
  3. 28d 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 (443 stars, last pushed today), licensed Apache-2.0. It adds 63 tokens to every session and 2,555 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

Other skills, from other repositories

ax-ai

This skill helps an LLM generate correct AI provider setup and configuration code using @ax-llm/ax. Use when the user asks about ai(), providers, models, routing, adaptive balancing, presets, embeddings, batch audio with ai.transcribe() or ai.speak(), extended thinking, context caching, or mentions…

ax-llm/ax · 105 tokens

ax-agent

This skill helps an LLM generate correct core AxAgent code using @ax-llm/ax. Use when the user asks about agent(), child agents, namespaced functions, discovery mode, clarification, bubbleErrors, host-side final/clarification protocol, or ordinary agent runtime behavior. For MCP clients, native runtime modules…

ax-llm/ax · 131 tokens

ax-cpp-ai

Use when writing C++ code with axllm for named deployment profiles, generic provider clients, model selection, OpenAI-compatible calls, Responses, Gemini, Anthropic, routers, and balancers.

ax-llm/ax · 47 tokens

ax-cpp-gen

Use when writing C++ code with axllm for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.

ax-llm/ax · 48 tokens

ax-go-gen

Use when writing Go code with github.com/ax-llm/ax/packages/go for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.

ax-llm/ax · 54 tokens

ax-java-gen

Use when writing Java code with dev.axllm:ax for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.

ax-llm/ax · 49 tokens