Skip to content
Back to search

codex-token-skills

⚡ Cut 60-80% token cost for DeepSeek V4 Pro on Codex CLI. token-saver + memory skills with prefix-cache optimization.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lokikill123-codex-token-skills/badge.svg)](/listings/lokikill123-codex-token-skills)

HTML

<a href="/listings/lokikill123-codex-token-skills"><img src="/api/listings/lokikill123-codex-token-skills/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 87 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # ⚡ Codex Token Skills
  2. > 专为 **DeepSeek V4 Pro** 优化的 Codex skill,大幅降低 token 消耗并提升前缀缓存命中率。
  3. [![Codex](https://img.shields.io/badge/Codex-CLI-blue)](https://github.com/openai/codex)
  4. [![Skills](https://img.shields.io/badge/skills-2-green)]()
  5. [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
  6. ---
  7. ## 为什么需要?
  8. DeepSeek V4 Pro 的前缀缓存机制:**系统提示词 + 上下文文件越稳定,缓存命中率越高**。如果你的 SKILL.md / AGENTS.md 频繁变动,每次对话都要重新处理全部上下文,浪费大量 token。
  9. 这两个 skill 的核心思路:
  10. | 问题 | 解决方案 |
  11. |------|---------|
  12. | 上下文频繁变动 → 缓存失效 | Skill 文件写好后**冻结不动** |
  13. | Codex 输出冗长 → token 浪费 | 强制**极简输出**,改完只说路径+done |
  14. | 上下文压缩 → 丢失记忆 | 用文件做**持久记忆**,跨对话恢复 |
  15. ---
  16. ## Skill 列表
  17. ### 🔧 token-saver — 强制省 token
  18. Smart 双模式:
  19. - **简单任务**(修 bug、改配置、装东西):禁止 preamble、禁止计划、禁止解释、禁止验证
  20. - **复杂任务**(vibecoding、数据分析、架构设计):允许简短交流,但严格控制
  21. > 实测预计省 **60-80%** token。
  22. ### 🧠 memory — 全局持久记忆
  23. 上下文窗口被压缩后,下次对话自动从 `MEMORY.md` 恢复:
  24. - 用户偏好与习惯
  25. - 项目结构与关键路径
  26. - 已做决策与反馈
  27. > 每次仅消耗 `~800 token`,换来跨对话一致性。
  28. ---
  29. ## 快速安装
  30. ```bash
  31. # 克隆到 Codex skills 目录
  32. git clone https://github.com/lokikill123/codex-token-skills.git
  33. cp -r codex-token-skills/skills/* ~/.codex/skills/
  34. # 重启 Codex 即可生效
  35. ```
  36. 或通过 skill-installer:
  37. ```
  38. install-skill --repo lokikill123/codex-token-skills --path skills/token-saver
  39. install-skill --repo lokikill123/codex-token-skills --path skills/memory
  40. ```
  41. ---
  42. ## 缓存优化原理
  43. ```
  44. [system prompt] + [AGENTS.md] + [各 skill SKILL.md] + [user message]
  45. ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  46. 系统固定 这部分 skill 文件冻结不变 → 前缀缓存命中 → 省 50%+ token
  47. ```
  48. **关键原则**:Skill 文件一次写定,永不修改。项目级动态内容放项目目录的 AGENTS.md,不放 skill 里。
  49. ---
  50. ## 搭配建议
  51. - `token-saver` + `memory` 同时激活,效果最大化
  52. - 在 `~/.codex/AGENTS.md` 中配置自动激活
  53. - 如需 UI 开发配合,可搭配 mac-style-ui skill(见作者其他 repo)
  54. ---
  55. ## License
  56. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.