moai-foundation-context

Solid

Manages context window optimization, session state persistence, and token budget allocation for multi-agent workflows. Use for token budget management, context limits, or session handoff across agents.

AI & Automation 1,050 stars 192 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

## Quick Reference Enterprise Context and Session Management - Unified context optimization and session state management for Claude Code with 200K token budget management, session persistence, and multi-agent handoff protocols. Core Capabilities: - 200K token budget allocation and monitoring - Session state tracking with persistence - Context-aware token optimization - Multi-agent handoff protocols - Progressive disclosure and memory management - Session forking for parallel exploration When to Use: - Session initialization and cleanup - Long-running workflows exceeding 10 minutes - Multi-agent orchestration - Context window approaching limits exceeding 150K tokens - Model switches between Haiku and Sonnet - Workflow phase transitions Key Principles: Avoid Last 20%: Performance degrades in final fifth of context window. Aggressive Clearing: Execute /clear every 1-3 messages for SPEC workflows. Lean Memory Files: Keep each file under 500 lines. Disable Unused MCPs: Minimize tool definition overhead. Quality Over Quantity: 10% relevant context beats 90% noise. --- ## Implementation Guide ### Features - Intelligent context window management for Claude Code sessions - Progressive file loading with priority-based caching - Token budget tracking and optimization alerts - Selective context preservation across /clear boundaries - MCP integration context persistence ### When to Use - Managing large codebases exceeding 150K token limits - Optimizing token usage in long...

Details

Author
modu-ai
Repository
modu-ai/moai-adk
Created
8 months ago
Last Updated
today
Language
Go
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

context-optimizer

Optimize token usage and context management. Use when sessions feel slow, context is degraded, or you're running out of budget.

2,259 Updated 4 days ago
rohitg00
AI & Automation Solid

context-manager

Manage the LLM's context window — token budgeting, prompt assembly, truncation strategies. Use when approaching context limits or optimizing prompt costs.

108 Updated today
Mark393295827
AI & Automation Listed

context-window

Use when allocating context-window budget across system, skill-injection, working, and output zones; monitoring context health; deciding when to compact; preserving state before compaction; recovering after compaction; or choosing strategies for 1M, 200K, or 128K context windows. Covers zone budgets, practical model-budget tables, the 80% compaction rule, pre/post-compact protocols, persistence hierarchy, operation token costs, and token-reduction techniques. Do NOT use for deciding what information belongs in the working set (use `context-management`), prompt design (use `prompt-craft`), graph architecture (use `context-graph`), or memory curation.

0 Updated 6 days ago
jacob-balslev
AI & Automation Listed

context-window

Use when allocating context-window budget across system, skill-injection, working, and output zones; monitoring context health; deciding when to compact; preserving state before compaction; recovering after compaction; or choosing strategies for 1M, 200K, or 128K context windows. Covers zone budgets, practical model-budget tables, the 80% compaction rule, pre/post-compact protocols, persistence hierarchy, operation token costs, and token-reduction techniques. Do NOT use for deciding what information belongs in the working set (use `context-management`), prompt design (use `prompt-craft`), graph architecture (use `context-graph`), or memory curation.

0 Updated 6 days ago
jacob-balslev
AI & Automation Listed

context-budget

Token and context budget audit for agents, skills, rules, and MCP overhead. Use when sessions feel bloated or repeated references are wasting context.

0 Updated today
JunMystery