rune-context-engine

Monitors tool call counts to classify context health and triggers state-preserving compaction.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/dangvu008/VietTruyen --skill rune-context-engine-dangvu008
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rune-context-engine
Source: https://github.com/dangvu008/VietTruyen/tree/main/.agents/skills/rune-context-engine
Command: npx skills add https://github.com/dangvu008/VietTruyen --skill rune-context-engine-dangvu008

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Long AI coding sessions silently lose critical decisions and progress when the context window fills up, forcing agents to restart work from scratch after compaction. ## Core Features & Use Cases - Context Health Classification: Counts tool calls and maps them to GREEN/YELLOW/ORANGE/RED health levels with adjusted thresholds for large-file codebases. - State-Preserving Compaction: Coordinates with session-bridge to save decisions, files touched, and continuation points before any compaction occurs. - Preview Cost Gate: Estimates token cost of context bundles before dispatch and emits proceed/warn/block actions per caller (adversary, team, review, audit). - Use Case: During a long refactoring session exceeding 120 tool calls, the skill saves architectural decisions and the exact resume point to .rune/ before triggering compaction, so work continues seamlessly. ## Quick Start Ask the agent to check current context health and recommend whether to compact the session now.

Frequently Asked Questions about rune-context-engine

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

FAQPage Schema
How do I prevent losing context during long AI coding sessions?

Track tool call counts as a proxy for context usage and classify health into GREEN, YELLOW, ORANGE, or RED levels. At RED, save decisions and progress to project files before triggering compaction so work resumes exactly where it stopped.

How to estimate token cost before dispatching a large context bundle?

Multiply total character count by 0.25 to estimate tokens without a tokenizer dependency. Compare the estimate against per-caller warn and block thresholds to decide whether to proceed, warn, or abort the dispatch.

Why is tool call count used instead of token percentage for context monitoring?

Claude Code does not expose actual token usage to skills, so tool call count serves as a directional proxy. Sessions with many large file reads consume context faster, so thresholds adjust downward by 0.8x when files average over 500 lines.

When is it safe to compact context mid-implementation?

Compaction during implementation is safe only at clean task boundaries where a file is fully written and tested. State must be flushed to session storage first, and tool_use/tool_result pairs must never be split across the compaction boundary.

What are the limitations of character-based token estimation?

The 0.25 chars-to-tokens ratio is calibrated for English code and markdown, underestimating Japanese or Chinese content by 30-50% and overestimating repetitive code by 20-30%. Both error directions remain safe because dispatch-time hard caps catch underestimates.