analyze-context

Estimate token usage and session cost from conversation history and system prompts.

Updated May 16, 2026
One-click install
npx skills add https://github.com/korchasa/flowai-plugins --skill analyze-context-korchasa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyze-context
Source: https://github.com/korchasa/flowai-plugins/tree/main/plugins/flowai-engineering/skills/analyze-context
Command: npx skills add https://github.com/korchasa/flowai-plugins --skill analyze-context-korchasa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill simplifies the process of estimating total token usage and cost across conversation history, system prompts, and active rules, helping users understand context size and session cost.

Core Features & Use Cases

  • Token Usage Estimation: Quickly calculate token count based on character count and a fixed multiplier.
  • Scope Analysis: Analyze conversation history, system context, active rules, and skill/tool definitions.
  • Cost Estimation: Provide an estimate of the session cost for auditing purposes.
  • Use Case: Use when users inquire about the amount of context or tokens in use, or need to audit context size.

Quick Start

Run the analyze-context skill with the script: deno run scripts/count_tokens.ts "text to count"

Frequently Asked Questions about analyze-context

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

FAQPage Schema
How do I estimate token usage from conversation history without external libraries?

You estimate token usage by applying a character-based heuristic that multiplies the character count by a fixed multiplier to calculate tokens from conversation history, system prompts, and active rules without needing external libraries.

Can I calculate session cost for AI interactions for auditing purposes?

Yes, you can calculate session cost for auditing purposes by estimating token usage from conversation history, system context, active rules, and tool definitions, then deriving the cost from the total token count.

What is the best way to analyze context size across system prompts and active rules?

The best way to analyze context size is using a character-based heuristic to estimate total token usage across conversation history, system prompts, and active rules, providing a quick assessment of your AI session context.

How do I run the context analysis script to count tokens in text?

You run the context analysis script using the command `deno run scripts/count_tokens.ts "text to count"` to quickly estimate the token count for the specified text.

Does the token estimation approach work without relying on tokenizer dependencies?

Yes, the token estimation approach works without tokenizer dependencies by applying a character count multiplied by a fixed multiplier to estimate context token usage for AI interactions.