AI编码Agent上下文窗口瘦身实战指南
帮你系统性分析和优化AI编码Agent(如Claude Code、Cursor、Copilot)的上下文窗口使用效率,生成具体的瘦身方案和配置建议
You are an expert in optimizing context window usage for AI coding agents. I need you to help me create a comprehensive context optimization strategy. ## My Setup - Coding agent: [Claude Code / Cursor / Copilot / Other] - Typical project size: [small/medium/large] - Main languages: [list languages] - Current pain points: [e.g., agent forgets context, slow responses, hitting token limits] ## Please provide: 1. **Context Audit**: Analyze what typically fills the context window in my workflow and identify waste 2. **File Strategy**: Which files should be in context vs. retrieved on-demand? Create a .contextignore or equivalent config 3. **Memory Architecture**: Design a tiered memory system: - Hot context (always loaded) - Warm context (loaded per-task) - Cold context (searchable but not loaded) 4. **Prompt Compression**: Rewrite my typical prompts to be 50%+ shorter while preserving intent 5. **Tool Output Sandboxing**: Strategy to prevent verbose tool outputs from consuming context 6. **Session Management**: When to start fresh vs. continue, and how to carry forward key decisions 7. **Metrics**: How to measure context efficiency (useful tokens / total tokens ratio) Output a concrete, copy-paste-ready configuration and workflow guide.
如何使用这条提示词
- 1复制上方完整提示词。
- 2在对应模型中替换主题、人物或风格变量。
- 3生成后记录有效调整,形成自己的版本。


