context

A project-context manager for coding-agent sessions. It loads the project’s goals, technology choices, constraints, current phase, related documents, and task details from files such as progress.md.

In plain words
What is it for?
Use it to load, save, or display the working context when switching sessions, starting a task, compressing a long conversation, or resuming unfinished work.
Why use it?
It reduces the need to repeat project background when starting or continuing a conversation. It also records progress, unfinished work, and key decisions for later sessions.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/xiaobei930/cc-best/context
Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.00575
Opus 5 $0.00014 $0.00287
Sonnet 5 $0.00006 $0.00115
Haiku 4.5 $0.00003 $0.00057

Measured 2d ago against content hash fa03c6fb7eb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/context.md · 87 lines

What it actually says

/context - 上下文管理

管理 AI 对话上下文,确保信息连续性。

上下文层级

1. 项目上下文(固定)

始终需要了解的信息:

  • 项目目标和核心功能
  • 技术栈选型
  • 关键约束条件

2. 阶段上下文(阶段内固定)

当前阶段需要的信息:

  • 当前 Phase 和 Step
  • 阶段目标和验收标准
  • 相关的设计文档

3. 任务上下文(任务内)

当前任务需要的信息:

  • 具体任务描述
  • 相关代码文件
  • 依赖和接口

新会话启动流程

1. 读取 memory-bank/progress.md
   → 了解当前状态、已完成工作和下一步任务

2. 读取当前任务相关文件(按需)
   → 代码文件、设计文档

3. 确认任务并继续
   → 更新 TodoWrite

上下文文件清单

必读(每次会话)

文件 内容 优先级
memory-bank/progress.md 状态和进度 P0
CLAUDE.md 项目说明 P1

按需读取

文件 何时读取
memory-bank/architecture.md 涉及架构设计时
memory-bank/tech-stack.md 技术决策时

上下文压缩策略

长会话时

  1. 定期同步状态到 progress.md
  2. 完成的任务只保留摘要
  3. 相关代码只保留接口定义

会话切换时

  1. 保存当前状态到 progress.md
  2. 记录未完成任务
  3. 记录关键决策

命令

  • /cc-best:context load - 加载项目上下文
  • /cc-best:context save - 保存当前状态
  • /cc-best:context show - 显示当前上下文范围

记住: 上下文是 AI 协作的核心资产,花时间维护上下文就是在为未来的效率投资。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 87 lines · 28 tokens per session scan A fa03c6fb7eb0

Subscribe to this mod's changes

context is a command published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 575 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.