compress
压缩记忆文件以节省 Token
AI 记忆文件会变得庞大并浪费输入 Token。此技能可将自然语言散文压缩为 caveman 格式,在保留所有代码、URL 和技术内容的同时节省 65-75% 的 Token。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“compress”。 You should always make sure to run the test suite before pushing any changes to the main branch. This is important because it helps catch bugs early and prevents broken builds from being deployed to production.
预期结果:
Run tests before push to main. Catch bugs early, prevent broken prod deploys.
正在使用“compress”。 The application uses a microservices architecture with the following components. The API gateway handles all incoming requests and routes them to the appropriate service. The authentication service is responsible for managing user sessions and JWT tokens.
预期结果:
Microservices architecture. API gateway route all requests to services. Auth service manage user sessions + JWT tokens.
安全审计
低风险Static analysis produced 53 potential findings, all evaluated as false positives. The subprocess.run call to 'claude' CLI uses hardcoded arguments with no user input. Environment variable access (ANTHROPIC_API_KEY, CAVEMAN_MODEL) is expected functionality for an AI tool. File path references to .env, .aws, .ssh are part of a security denylist that prevents compressing sensitive files. No confirmed security risks found.
中风险问题 (1)
低风险问题 (2)
风险因素
⚙️ 外部命令 (1)
🔑 环境变量 (1)
检测到的模式
质量评分
你能构建什么
压缩大型 CLAUDE.md 文件
当您的 CLAUDE.md 项目记忆文件超过 5000 Token 时,将其压缩为 caveman 格式以在每次 Claude 会话中节省输入 Token,同时保留所有技术细节。
优化待办事项和偏好文件
压缩包含自然语言说明的个人生产力文件,如 TODO.md、preferences.md 或 notes.md,减少 Token 使用量而不会丢失操作项或设置。
为 AI 上下文准备文档
在将文档粘贴到 Claude 进行分析之前,将冗长的解释压缩为 caveman 格式以在上下文窗口中容纳更多内容,同时保留所有技术规格。
试试这些提示
Compress my CLAUDE.md file to caveman format
Compress the file at /path/to/notes.md using caveman format
Compress all markdown files in my /docs directory to caveman format
Compress README.md and show me the token savings comparison
最佳实践
- 在删除备份前始终检查 .original.md 备份以确保压缩质量
- 先在非关键文件上测试压缩,以验证输出是否符合您的需求
- 保留包含复杂代码块的原始文件备份,直到您验证压缩已完全保留它们
- 使用压缩触发器 /caveman:compress <filepath> 进行精确的文件定位
避免
- 不要压缩 .py、.js、.json 或 .yaml 等代码文件,因为该技能会拒绝处理它们
- 不要压缩包含敏感凭据、API 密钥或密码的文件
- 在验证压缩版本正常工作之前,不要删除 .original.md 备份文件
- 不要将此技能用于二进制文件或大于 500KB 的文件