context-compactor

Compact, trim, and summarize AI model context windows to reduce token count.

Updated May 11, 2026
One-click install
npx skills add https://github.com/AesopScott/mojo --skill context-compactor-aesopscott
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-compactor
Source: https://github.com/AesopScott/mojo/tree/main/harnesses/skills/context-compactor
Command: npx skills add https://github.com/AesopScott/mojo --skill context-compactor-aesopscott

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses latency and throughput bottlenecks by intelligently compacting context and selecting optimal window sizes, ensuring prompts remain efficient and within model limits.

Core Features & Use Cases

  • Context Optimization: Implements strategies like context-packing, trimming, and summarization to maximize token efficiency.
  • Performance Tuning: Provides a structured runbook to identify and resolve slow or over-synchronized request paths.
  • Use Case: When an AI agent experiences high latency due to bloated conversation history, use this Skill to define a compaction strategy that preserves critical instructions while reducing total token count.

Quick Start

Use the context-compactor skill to analyze the current performance bottleneck and propose a compaction strategy for the active harness.

Frequently Asked Questions about context-compactor

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

FAQPage Schema
How do I reduce AI model latency caused by bloated conversation history?

To reduce AI model latency caused by bloated conversation history, apply context compaction strategies like trimming and summarization. This preserves critical instructions while reducing total token count to optimize request paths.

What is the best way to optimize AI context windows for prompt engineering?

The best way to optimize AI context windows for prompt engineering is implementing context-packing and trimming techniques. This maximizes token efficiency and ensures prompts remain within strict model limits.

How does context compaction manage token efficiency in AI harness development?

Context compaction manages token efficiency in AI harness development by intelligently selecting optimal window sizes and summarizing historical data. This resolves throughput bottlenecks and minimizes processing overhead.

Can I use context trimming to resolve slow request paths in performance engineering?

Yes, you can use context trimming to resolve slow request paths in performance engineering. A structured runbook identifies high latency areas and applies trimming to reduce processing overhead.

What are the limitations when applying context summarization to active AI harnesses?

Limitations when applying context summarization to active AI harnesses include the need to adhere to defined safety boundaries and observability standards. All configuration changes require strict compliance to maintain system integrity.

When do I need context window optimization for my AI agent workflows?

You need context window optimization for your AI agent workflows when experiencing high latency or throughput bottlenecks. Compacting context ensures prompts stay efficient and within model limits during heavy processing.