# Context Fundamentals

> 用于上下文工程基础问题：当用户要理解 context window、注意力行为、progressive disclosure、context budgeting 或高层 agent 上下文架构，或者会问“为什么 agent 一长对话就失忆”“为什么 agent 聊久了就不靠谱”“上下文到底怎么设计”“context budget 怎么分”“上下文预算怎么分”“为什么 prompt 很长反而更差”“为什么 prompt 越堆越差”，or English asks like “why does the agent get worse in long chats”, “how should I budget context”, “why does a longer prompt perform worse” 时使用。Prefer `context-compression` for 会话内压缩，Prefer `memory-systems` for 跨会话长期记忆；Do not use for 直接实现具体压缩流程或持久化记忆系统。

- Skill: `hebertzhu/context-fundamentals` (Agent Skill)
- Install (CLI): `npx skillmds@latest add hebertzhu/context-fundamentals`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hebertzhu/context-fundamentals/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: hebertzhu (https://skillmd.com/u/hebertzhu)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/hebertzhu/context-fundamentals

---


# context-fundamentals

## Intent
- 用于上下文工程基础问题：当用户要理解 context window、注意力行为、progressive disclosure、context budgeting 或高层 agent 上下文架构，或者会问“为什么 agent 一长对话就失忆”“为什么 agent 聊久了就不靠谱”“上下文到底怎么设计”“context budget 怎么分”“上下文预算怎么分”“为什么 prompt 很长反而更差”“为什么 prompt 越堆越差”，or English asks like “why does the agent get worse in long chats”, “how should I budget context”, “why does a longer prompt perform worse” 时使用。Prefer `context-compression` for 会话内压缩，Prefer `memory-systems` for 跨会话长期记忆；Do not use for 直接实现具体压缩流程或持久化记忆系统。

## Default operating pattern
1. Separate short-term context from durable memory or documentation.
2. Define the minimum information model that must survive the current session.
3. Choose storage, compression, retrieval, and update boundaries deliberately.
4. Call out trade-offs, failure modes, and evaluation signals.
5. Recommend the smallest next architecture or workflow improvement.

## Pack fit
- Included in: `context-systems`
- Keep examples generic, privacy-safe, and portable across hosts.

## Boundary
- Do not stop at theory when the user really needs a concrete storage or retrieval design.

