By weibaohui
Automatically compresses long Claude Code conversations into concise classical Chinese summaries before context compaction, preserving core entities, emotions, and logic to save tokens in extended projects.
代码如诗,上下文亦可成文。 中华文明,博大精深;AI 时代,大放异彩。
cc-poem 是一个 Claude Code 上下文压缩插件。它将冗长的对话上下文压缩为凝练的文言文,以数十年华之积淀,书写千言之意蕴。
上古之人,结绳记事,以简驭繁。 今有 AI,上下文中藏万象,亦可以文言驭之。
文言文,上下五千年文明之载体,言简意赅,博大精深。 今借此瑰宝,压缩上下文,以数十字叙千言之事,节省 token,亦传承文明。
PreCompact 事件,在上下文压缩前自动触发agent 类型调用 Claude Code 自身进行压缩,无需额外 API Key上下文过长 → PreCompact Hook 触发 →
调用 Claude Code 自身(agent 类型)压缩为文言文 → 注入压缩摘要到对话
# 使用 --plugin-dir 加载插件
claude --plugin-dir /path/to/cc-poem
在 ~/.claude/settings.json 中添加插件路径:
{
"plugins": [
"/path/to/cc-poem"
]
}
cc-poem/
├── .claude-plugin/
│ └── plugin.json # 插件清单
├── hooks/
│ └── hooks.json # Hook 配置(监听 PreCompact,使用 agent 类型)
└── skills/
└── compress/
└── SKILL.md # 压缩策略技能
输入:数千字的技术讨论、需求变更、代码逻辑推导
输出:
【风格】文言文
【正文】
需求变更,状态机重构乃急。路由派发之制,执令、候令、运转、完结四态。压缩存要,后视文言可复。
【译】需求变更;状态机;四态;压缩;可复
# 重载插件(在 Claude Code 中)
/reload-plugins
MIT
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub weibaohui/cc-poemUltra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Memory compression system for Claude Code - persist context across sessions
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract proven patterns into reusable skills.