Agent skill · AI & Agents

cache-cost-tracking

LLM cost tracking with Langfuse for cached responses. Use when monitoring cache effectiveness, tracking cost savings, or attributing costs to agents in multi-agent systems.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill cache-cost-tracking --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 6 KB
Bundled scripts: none
Version: 1.0.0
Declared author: SkillForge
Path: skills/ai-llm/cache-cost-tracking/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Cache Cost Tracking Monitor LLM costs and cache effectiveness. ## When to Use - Cost attribution by agent - Cache hit rate monitoring - ROI analysis for caching - Multi-agent cost rollup ## Langfuse Automatic Tracking ```python from langfuse.decorators import observe, langfuse_context @observe(as_type="generation") async def call_llm_with_cache( prompt: str, agent_type: str, analysis_id: UUID ) -> str: """LLM call with automatic cost tracking.""" # Link to parent trace langfuse_context.update_current_trace( name=f"{agent_type}_generation", session_id=str(analysis_id) ) # Check caches if cache_key in lru_cache: langfuse_context.update_current_observation( metadata={"cache_layer": "L1", "cache_hit": True} ) return lru_cache[cache_key] similar = await semantic_cache.get(prompt, agent_type) if similar: langfuse_context.update_current_observation( metadata={"cache_layer": "L2", "cache_hit": True} ) return similar # LLM call - Langfuse tracks tokens/cost automatically response = await llm.generate(prompt) langfuse_context.update_current_observation( metadata={ "cache_layer": "L4", "cache_hit": False, "prompt_cache_hit": response.usage.cache_read_input_tokens > 0 } ) return response.con

What's inside
Steps it walks through
  1. When to Use
  2. Langfuse Automatic Tracking
  3. Hierarchical Cost Rollup
  4. Cost Queries
  5. Cache Effectiveness
  6. Key Decisions
  7. Common Mistakes
  8. Related Skills
  9. Capability Details
  10. prompt-caching
  11. response-caching
  12. cost-calculation
  13. usage-tracking
  14. cache-invalidation
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the cache-cost-tracking skill do?

LLM cost tracking with Langfuse for cached responses. Use when monitoring cache effectiveness, tracking cost savings, or attributing costs to agents in multi-agent systems.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill cache-cost-tracking --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going