🧠
AI Engineering

Context Management

by kangarooking

Context Management is an AI Engineering skill for Claude Code, published by kangarooking in system-prompt-skills.

182 stars40 forkson kangarooking/system-prompt-skillsAdded 2026/09/06+3% in starsRepository updated 2026/05/04
agent-designagent-skillsai-agentscangjie-skillcontext-managementprompt-engineeringprompt-injectionsystem-prompttool-use
Install in seconds
Install Context Management
Copy Context Management into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/kangarooking/system-prompt-skills/tree/main/context-management ~/.claude/skills/context-management

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/kangarooking/system-prompt-skills.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
context-management/SKILL.md in kangarooking/system-prompt-skills
Installs to
~/.claude/skills/context-management
Collection
One of 15 skills cataloged from this repository
Category
AI Engineering3278 skills

What Context Management does

Context Management helps design token budgets, compression strategies, lazy loading, and persistent memory for long-running AI assistants and multi-session systems. Use it when conversation history, large files, or user preferences need to stay usable without overflowing the context window.

Context Management is cataloged under AI Engineering on DirSkills. Context Management comes from a repository tagged agent-design, agent-skills, ai-agents, cangjie-skill and context-management.

Documentation

README

上下文与窗口管理

R — 原文 (Reading)

跨供应商系统提示词中浮现的上下文管理核心模式:Gemini CLI 将上下文窗口称为"最珍贵的资源"并配合子代理压缩;Claude Code 使用文件级记忆(MEMORY.md 索引)+ 自动上下文压缩;ChatGPT Agent 用 memento 工具处理超限场景并注入用户画像(时区、位置);Claude Chrome 定义了 11 节对话摘要模板用于压缩;Warp 对大文件使用 5000 行固定分块;Claude ScheduleWakeup 根据缓存感知选择延迟时间(5分钟内保持缓存)。核心共识:上下文窗口是稀缺资源,必须主动管理。

I — 方法论骨架 (Interpretation)

  1. Token 预算意识 — 将上下文窗口视为固定预算,主动分配而非被动填充;预算用尽前触发压缩
  2. 分层压缩策略 — 原始对话 → 摘要压缩 → 关键点提取 → 持久化记忆,按距离当前轮次的远近逐层压缩
  3. 延迟加载 (Lazy Loading) — 不预先加载所有可用信息,按需从文件/数据库/工具中发现和加载
  4. 层级化持久记忆 — 对话级(临时)→ 会话级(摘要)→ 项目级(MEMORY.md)→ 用户级(画像),形成记忆金字塔
  5. 结构化摘要模板 — 定义压缩后的标准格式(如 Claude Chrome 的 11 节模板),确保压缩不丢失关键信息
  6. 缓存感知调度 — 利用模型缓存机制优化延迟选择,短间隔(< 5min)保持缓存命中
  7. Token 节约语法 — 压缩 URL(Notion AI 的 {{1}})、省略标记、引用编号(Claude Design 的 [id:mNNNN]

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Context Management

  • What else does kangarooking publish alongside Context Management?

    Context Management is one of 15 skills that DirSkills catalogs from kangarooking/system-prompt-skills, the repository it ships in. Its siblings there include Agent Delegation, Citation System and Code Engineering. Each one is a separate skill with its own page in this directory, installs the same way Context Management does, and is maintained by kangarooking in that same repository. The rest of the collection is listed on the kangarooking/system-prompt-skills page.

  • How does Context Management compare to other AI Engineering skills?

    Context Management ranks #3046 by stars among the 3278 AI Engineering skills in this catalog. The most-starred ones next to it are Architecture Decision Records, AI-First Engineering and Agentic OS. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Context Management against them. Open each page to compare what they document and how they install.

More from kangarooking/system-prompt-skills

Context Management is one of 15 skills cataloged on DirSkills from kangarooking/system-prompt-skills.

See all 15 skills
🧩
5h ago

Agent Delegation

Agent Delegation describes how to split work across specialized sub-agents with isolated context, briefing-based handoffs, and validation gates. Use it when designing multi-agent systems, task lifecycles, or cross-tool coordination; not for single-agent routing.
AI Engineering
18240
🔗
5h ago

Citation System

Citation System defines inline citation formats and source-tracking rules for answers that need traceable evidence. Use it for document Q&A, RAG, code references, and other outputs where users must verify where information came from.
AI Engineering
18240
🛠️
5h ago

Code Engineering

Code Engineering defines system-prompt rules for coding agents that edit files, manage Git workflows, and verify changes. Use it for autonomous or guided code modification tasks, not for pure code Q&A or infrastructure setup.
AI Engineering
18240
🧭
5h ago

Conversation Flow

Conversation Flow defines how an AI classifies user intent, routes requests into task-specific paths, and chooses when to ask clarifying questions versus proceed autonomously. Use it for multi-step assistants and agents that need structured dialogue management.
AI Engineering
18240
🛡️
5h ago

Injection Defense

Injection Defense helps design system prompts that resist prompt injection, jailbreaks, social engineering, and trust-boundary breaks. Use it for agents or chatbots that process external content like documents, web pages, email, or memory.
AI Engineering
18240
🧠
5h ago

Memory System

Memory System designs how an AI stores, retrieves, applies, and updates user and project memories across sessions. Use it when building personalization, handling sensitive memories, or deciding when memory should be applied silently.
AI Engineering
18240