agentsclimarketplace

Token counter

Skill navveenb/lean-agentic-ai/lean-agentic-ai-claude-implementation/.claude/skills/token-counter

Lean Agentic AI

Install
npx -y skills add navveenb/lean-agentic-ai --skill token-counter

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Estimate token usage for LLM API calls found in code

SKILL.md

1.3 KB, 339 tokens by cl100k_base, as published. Nobody here has run it

Token Counter Skill

When you find an LLM API call in code, estimate its token usage using these rules:

Estimation Rules

Input Tokens

  • System prompt: Look for system message content. Estimate 1 token per 4 characters.
  • User message: Look for user/human message content. If it includes variable interpolation, estimate based on typical content size.
  • Few-shot examples: Count examples in the messages array. Each example ≈ 200-500 tokens.
  • Tool descriptions: Count tool/function definitions. Each tool ≈ 100-500 tokens.

Output Tokens

  • max_tokens parameter: If set, use that as the upper bound.
  • If not set: Estimate by task type:
    • Classification/routing: ~10-50 tokens
    • Extraction: ~50-200 tokens
    • Summarization: ~100-500 tokens
    • Code generation: ~200-2000 tokens
    • Creative writing: ~500-4000 tokens

Cost Rates (per 1M tokens)

ModelInputOutput
Haiku / GPT-4o-mini$0.25$1.25
Sonnet / GPT-4o$3.00$15.00
Opus / GPT-4 / o1$15.00$75.00

Per Call Output

  • Estimated input tokens: ____
  • Estimated output tokens: ____
  • Current model cost per call: $____
  • Right-sized model cost per call: $____

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.