context-engine

context-engine is a skill for Claude Code from Rune-kit/rune. It costs 40 tokens per session (5,760 once invoked), scanned C, original, MIT.

A context-management tool for long coding sessions. It compacts the conversation when it becomes too large while preserving important decisions and progress, and can switch between development, research, and review modes.

In plain words
What is it for?
Use it during extended implementation, investigation, or code-review sessions where the conversation is approaching its limit.
Why use it?
Long sessions can exceed the available context and lose earlier information. This keeps essential state available across compaction.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

Part of the rune plugin — 66 skills, 1 command, 66 agents, 6 hooks shipped together

Good fit Use it during extended implementation, investigation, or code-review sessions where the conversation is approaching its limit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rune-kit/rune/context-engine
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Rune-kit/rune --skill context-engine
Clone the repo
git clone --depth 1 https://github.com/Rune-kit/rune

Made for: Claude Code.

Or install rune, the plugin that ships this one along with the rest of its 66 skills, 1 command, 66 agents, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-engine

README.md
[![agentmods](https://agentmods.dev/badge/skills/rune-kit/rune/context-engine/github.svg)](https://agentmods.dev/skills/rune-kit/rune/context-engine)
Your own site
<a href="https://agentmods.dev/skills/rune-kit/rune/context-engine"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/context-engine/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-engine

Your own site · 80×15
<a href="https://agentmods.dev/skills/rune-kit/rune/context-engine"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/context-engine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,760 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.05760
Opus 5.5 $0.00016 $0.02304
Sonnet 5.5 $0.00008 $0.01152
Haiku 4.5 $0.00004 $0.00576

Measured 8d ago against content hash 38aaa955fd24, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

context-engine scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Confirmations of irreversible actions (`rm -rf`, force-push, drop table, prod deploy)
skills/context-engine/SKILL.md · 489 lines

How it starts

The opening of the file, as written. The whole thing — 489 lines — stays where its author put it; the contents beside it link to each section on GitHub.

context-engine

Purpose

Context window management for long sessions. Detects when context is approaching limits, triggers smart compaction preserving critical decisions and progress, and coordinates with session-bridge to save state before compaction. Prevents the common failure mode of losing important context mid-workflow.

Behavioral Contexts

Context-engine also manages behavioral mode injection via contexts/ directory. Three modes are available:

Mode File When to Use
dev contexts/dev.md Active coding — bias toward action, code-first
research contexts/research.md Investigation — read widely, evidence-based
review contexts/review.md Code review — systematic, severity-labeled

Mode activation: Orchestrators (cook, team, rescue) can set the active mode by writing to .rune/active-context.md. The session-start hook injects the active context file into the session. Mode switches mid-session are supported — the orchestrator updates the file and references the new behavioral rules.

Default: If no .rune/active-context.md exists, no behavioral mode is injected (standard Claude behavior).

Triggers

  • Called by cook and team automatically at context boundaries
  • Auto-trigger: when tool call count exceeds threshold or context utilization is high
  • Auto-trigger: before compaction events

Calls (outbound)

Exception: L3→L3 coordination

  • session-bridge (L3): coordinate state save when context critical

Called By (inbound)

  • cook (L1): Phase boundaries and when tool count exceeds thresholds
  • team (L1): before parallel workstream dispatch, after merge
  • rescue (L1): between refactoring sessions for state persistence
  • context-pack (L3): when packaging context for sub-agent handoff
  • session-bridge (L3): coordinates with context-engine for compaction timing
  • adversary (L2): (oracle-mode) emit context.preview before bundle build to gate token cost

Read the full file on GitHub · 489 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 489 lines · 40 tokens per session scan C 38aaa955fd24

Subscribe to this mod's changes

context-engine is a skill published in the GitHub repository Rune-kit/rune (96 stars, last pushed 2d ago), licensed MIT. It adds 40 tokens to every session and 5,760 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-22.

Related

context-engine compared with skills from other repositories

context-engine next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-engineRune-kit/runeSkill962d agoMITC40Claude Code
session-learningssentimony/skillsSkill8todayMITA121Claude Code
tddsentimony/skillsSkill8todayMITA43Claude Code
vaultr-memoryskoowoo/vaultr-notesSkill892mo agoApache-2.0A87Claude Code, Codex
vaultr-compile-noteskoowoo/vaultr-notesSkill892mo agoApache-2.0A116Claude Code, Codex
vaultr-index-knowledgeskoowoo/vaultr-notesSkill892mo agoApache-2.0A107Claude Code, Codex
vaultr-recapskoowoo/vaultr-notesSkill892mo agoApache-2.0A192Claude Code, Codex