npx skills add https://github.com/jmsktm/claude-settings --skill 'Context Manager'上下文管理器技能可帮助您优化对话上下文,以在长时间会话中保持 Claude 的有效性。它跟踪上下文窗口使用情况,识别何时需要总结或修剪上下文,并帮助您构建对话结构,以便在令牌限制内保持相关信息可访问。
此技能对于复杂、多天的项目至关重要,因为对话历史记录会变得庞大。它帮助您决定保留什么、总结什么以及丢弃什么,确保 Claude 在不超过上下文限制的情况下,能持续了解重要决策和项目状态。
在长时间的开发会话期间、开始新的主要功能之前,或者当您注意到因上下文膨胀导致性能下降时,请主动使用此技能。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 操作 | 命令/触发条件 |
|---|---|
| 检查上下文状态 | "Check context window" 或 "How's our context?" |
| 总结对话 | "Summarize this conversation" |
| 使用摘要开始新对话 | "Start new thread with summary" |
| 修剪旧上下文 | "Clear old context" 或 "Prune conversation" |
| 优化上下文结构 | "Optimize our context" |
| 保留关键决策 | "Document key decisions" |
| 估算上下文使用量 | "How much context are we using?" |
长对话 →
详细摘要(减少 50%) →
执行摘要(减少 80%) →
关键决策(减少 95%)
在上下文中保留:
- 最近 1 小时:完整细节
- 最近 4 小时:已总结
- 最近 1 天:仅关键决策
- 更早的:链接到外部文档
为以下内容创建独立线程:
- 功能开发
- 错误调查
- 部署/运维
- 架构讨论
根据需要在线程间链接
开始时仅包含:
- 当前任务上下文
按需添加:
- 相关决策
- 相关代码
- 背景信息
完成后移除
开始主要任务前,请验证:
注意以下迹象:
将这些信息移至文件,而非上下文中:
| 信息类型 | 最佳存储方式 |
|---|---|
| 项目概述 | README.md |
| 架构决策 | ARCHITECTURE.md 或 ADRs |
| API 契约 | OpenAPI 规范或模式文件 |
| 当前项目状态 | PIPELINE_STATUS.md 或 TODO.md |
| 配置 | .env, config files |
| 代码风格规则 | .eslintrc, prettier.config.js |
| 部署流程 | DEPLOYMENT.md 或 CI/CD 配置 |
| 团队决策 | DECISIONS.md 或会议记录 |
## 项目:[名称]
- **状态**:[当前流水线阶段]
- **当前重点**:[我们正在做什么]
- **最近完成**:[近期成就]
- **后续步骤**:[立即任务]
- **阻碍**:[阻碍进展的因素]
- **关键决策**:[近期重要选择]
## 决策:[主题]
- **日期**:[何时]
- **背景**:[为何需要决策]
- **考虑的选项**:[替代方案]
- **选择**:[我们决定的内容]
- **理由**:[为何选择此方案]
- **后果**:[接受的权衡]
## 会话摘要:[日期]
- **时长**:[多久]
- **完成事项**:[我们构建/修复了什么]
- **决策**:[做出的选择]
- **发现的问题**:[发现的问题]
- **下次会话**:[从何处继续]
供高级用户使用:
/src/utils/data.ts 中的函数 processData"
* 而不是:[粘贴整个函数]每周安装次数
–
代码仓库
GitHub 星标数
2
首次出现时间
–
安全审计
The Context Manager skill helps you optimize conversation context to maintain Claude's effectiveness throughout long sessions. It tracks context window usage, identifies when to summarize or prune context, and helps you structure conversations to keep relevant information accessible while staying within token limits.
This skill is essential for complex, multi-day projects where conversation history grows large. It helps you decide what to preserve, what to summarize, and what to discard, ensuring Claude maintains awareness of important decisions and project state without hitting context limits.
Use this skill proactively during long development sessions, before starting new major features, or when you notice performance degradation due to context bloat.
| Action | Command/Trigger |
|---|---|
| Check context status | "Check context window" or "How's our context?" |
| Summarize conversation | "Summarize this conversation" |
| Start fresh with summary | "Start new thread with summary" |
| Prune old context | "Clear old context" or "Prune conversation" |
| Optimize context structure | "Optimize our context" |
| Preserve key decisions | "Document key decisions" |
| Estimate context usage | "How much context are we using?" |
Monitor Proactively : Don't wait for performance issues
Summarize Regularly : Compress history at natural breakpoints
Externalize Static Info : Move unchanging content to files
Use Structured Formats : Make information dense and scannable
Preserve Decisions : Always keep the "why"
Discard Aggressively : Be ruthless with temporary content
Long conversation →
Detailed summary (50% reduction) →
Executive summary (80% reduction) →
Key decisions (95% reduction)
Keep in context:
- Last 1 hour: Full detail
- Last 4 hours: Summarized
- Last day: Key decisions only
- Older: Link to external docs
Separate threads for:
- Feature development
- Bug investigation
- Deployment/ops
- Architecture discussion
Link between threads as needed
Start with:
- Current task context only
Add on demand:
- Related decisions
- Relevant code
- Background information
Remove when done
Before starting a major task, verify:
Watch for these indicators:
Move these to files, not context:
| Information Type | Best Storage |
|---|---|
| Project overview | README.md |
| Architecture decisions | ARCHITECTURE.md or ADRs |
| API contracts | OpenAPI spec or schema files |
| Current project state | PIPELINE_STATUS.md or TODO.md |
| Configuration | .env, config files |
| Code style rules | .eslintrc, prettier.config.js |
| Deployment process | DEPLOYMENT.md or CI/CD config |
| Team decisions | DECISIONS.md or meeting notes |
## Project: [Name]
- **Status**: [Current pipeline stage]
- **Current focus**: [What we're working on]
- **Last completed**: [Recent achievement]
- **Next steps**: [Immediate tasks]
- **Blockers**: [What's preventing progress]
- **Key decisions**: [Recent important choices]
## Decision: [Topic]
- **Date**: [When]
- **Context**: [Why we needed to decide]
- **Options considered**: [Alternatives]
- **Choice**: [What we decided]
- **Rationale**: [Why this choice]
- **Consequences**: [Trade-offs accepted]
## Session Summary: [Date]
- **Duration**: [How long]
- **Accomplished**: [What we built/fixed]
- **Decisions**: [Choices made]
- **Issues found**: [Problems discovered]
- **Next session**: [Where to continue]
For power users:
Use references : Link to code instead of pasting
processData in /src/utils/data.ts"Leverage AI memory : Store in knowledge graph
Create abbreviations : Define once, use everywhere
Use diff format : Show changes, not entire files
Batch similar information : Group related items
Weekly Installs
–
Repository
GitHub Stars
2
First Seen
–
Security Audits
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
109,600 周安装
iOS Swift Core Bluetooth 开发指南:BLE 扫描连接与数据交换
523 周安装
iOS App Clips 开发指南:轻量级即时应用创建、调用与配置
518 周安装
Airflow DAG编写指南:使用af CLI创建与验证DAG的最佳实践
508 周安装
iOS设备完整性验证:DeviceCheck与App Attest完整指南 | Swift开发
520 周安装
AI每日摘要:从90个热门技术博客中智能筛选最新文章,生成每日AI精选摘要
516 周安装
FFmpeg视频处理与编辑自动化教程:剪辑、转场、音频混音、批量处理与导出优化
519 周安装
Start Fresh Strategically : Know when to begin new conversation
Document Externally : Use files for persistent knowledge