flow-skill-analyze-context

Estimate total token usage and costs for AI interactions.

3|Updated Oct 5, 2025
One-click install
npx skills add https://github.com/korchasa/flow --skill flow-skill-analyze-context
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flow-skill-analyze-context
Source: https://github.com/korchasa/flow/tree/main/framework/skills/flow-skill-analyze-context
Command: npx skills add https://github.com/korchasa/flow --skill flow-skill-analyze-context

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you estimate the total context and cost of AI interactions by aggregating conversation history, system prompts, active rules, and tool definitions to produce a single token-based estimate.

Core Features & Use Cases

  • Comprehensive scope: Includes conversation history, system prompts, active rules from AGENTS.md and any active rules files, tool definitions, and attached context blocks to account for all factors driving context size.
  • Adaptive estimation: Uses a character-based token approximation to yield token counts for budgeting and prompt optimization.
  • Use Case: When planning long AI sessions, quickly estimate how many tokens will be consumed and adjust prompts to stay within budget.

Quick Start

Run the analyze-context task to estimate total tokens for the current session.

Frequently Asked Questions about flow-skill-analyze-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate total token cost for AI prompts and conversation history?

To estimate total token cost for AI prompts, you can aggregate conversation history, system prompts, active rules, and tool definitions to produce a single token-based estimate for budgeting.

What is the best way to budget token usage across long AI sessions?

Budgeting token usage across long AI sessions involves aggregating inputs from history, prompts, rules, and tool definitions, then applying a character-based token approximation to calculate the total context cost.

Does the token estimation include system prompts and active rules from AGENTS.md?

Yes, the token estimation includes system prompts, active rules from AGENTS.md, conversation history, attached context blocks, and tool definitions to account for all factors driving context size.

How does character-based token approximation work for calculating context size?

Character-based token approximation works by counting characters in your aggregated inputs and applying a 0.3 multiplier to yield token counts, providing an adaptive estimation for prompt optimization.

Can I optimize prompts to stay within a specific token budget?

Yes, you can optimize prompts to stay within a specific token budget by running an analysis to estimate how many tokens will be consumed and adjusting your conversation history, rules, and prompts accordingly.

What are the limitations of using character counting for token estimation?

The limitation of using character counting for token estimation is its adaptive nature; it approximates tokens by multiplying characters by 0.3 rather than using an exact tokenizer, which may yield slight variations in cost estimates.