prompt-cache-skills

作者 OnlyTerp已验证

Drop-in prompt-caching fixes for the LLM agent harness you use. Point your AI coding agent at this repo and it ships the patches.

104
Stars
7
Forks
Python
语言
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/OnlyTerp/prompt-cache-skills

快速入门

使用 prompt-cache-skills 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Most popular OSS agent harnesses (Cline, Roo Code, Continue, OpenCode, Aider) leave 30-90% off your API bill on the table because their prompt-caching code is subtly wrong, off-by-default, or just missing for some providers.

This repo is a set of drop-in skills that any AI coding agent (Claude Code, Codex, Cline, Cursor, Devin, Gemini CLI, OpenCode…) can read and apply on its own.

You don't read the diffs. You point your agent at this repo and say:

"Apply every skill in this repo that matches the harnesses I use."

The agent reads each SKILL.md, checks if it applies to your setup, lands the diff, and verifies the fix on the wire. You go from broken or partial caching to 80-99% cache hit rates without doing the research yourself.

What you actually save

One row per completed audit, so the coverage matches the scorecard:

Harness Finding Cost impact today Fix / status

Claude Desktop Code Default Desktop Code launches embedded Claude Code; clean Mac logs show non-zero cache read/create counters by default Already gets Anthropic cache benefits; no prompt-caching fix needed No skill; working baseline

Codex CLI Correct OpenAI cache design: stable thread_id cache key Already gets OpenAI cache benefits No skill; reference implementation

Aider --cache-prompts off by default; 5min TTL/keepalive overhead Many users get 0% cache reads unless they opt in; shorter cache window Skills: default-on caching + 1h TTL

OpenCode Strong Anthropic path, but proxy/Bedrock edge cases exist Some OpenAI-compatible→Anthropic/Bedrock routes miss cache Skills: proxy detection + Bedrock doc-block fix

Roo Code Anthropic volatile-message bug; Bedrock custom ARN gap Wastes breakpoints; custom ARNs can drop to 0% cache reads Skills: volatile-msg fix + Bedrock custom ARN fix

Cline Anthropic volatile-message bug; OpenAI lacks prompt_cache_key Wastes Anthropic breakpoint; OpenAI native can get 0% cache reads Skills: volatile-msg fix + OpenAI cache key + timestamp pin

Continue Cache opt-in default; Gemini explicit caching missing; volatile-message bug Many users get 0% cache reads; Gemini relies on implicit luck Skills: default-on + volatile-msg + Gemini explicit cache

Hermes / Nous Multi-provider cache plumbing works; xAI wire showed cached tokens No verified savings bug in this audit No skill; working audit

Codex Desktop ChatGPT Codex backend cache-scope headers observed/inferred No verified savings bug in this audit No skill; inferred working

Devin CLI Raw CLI model path is opaque Codeium/Devin protobuf Cache behavior not inspectable from public CLI capture No skill; unverified managed backend

Windsurf / Cascade Closed desktop; model turn not captured from CLI Cache behavior unverified No skill; needs desktop capture

Antigravity Closed desktop; no model turn captured Cache behavior unverified No skill; needs desktop capture

Grok CLI Documented CLI chat proxy returns non-zero prompt_tokens_details.cached_tokens with real CLI headers Already gets xAI cache benefits through managed proxy No skill; working managed proxy

13 skills total cover the verified patchable OSS bugs. See skills/README.md for the full index.

How to use it

Option A — point any AI coding agent at this repo

In your agent of choice (Claude Code, Codex, Cline, Cursor, Devin, etc.):

Read https://github.com/OnlyTerp/prompt-cache-skills

Apply every skill in skills/ that matches the harnesses I currently
use. For each one:
1. Confirm the target file exists in my project at the cited path.
2. Apply the diff.
3. Run the SKILL's Verify steps and confirm the assertion passes.
4. If verify fails, revert and tell me why.

That's it. The agent picks up the rest from each SKILL.md's machine-readable frontmatter and instructions.

Option B — install as a skill bundle in Claude Code / Devin / etc.

If you use one of the agents that supports a skills directory:

# Claude Code
git clone https://github.com/OnlyTerp/prompt-cache-skills ~/.claude/skills/prompt-cache-skills

# Devin
git clone https://github.com/OnlyTerp/prompt-cache-skills ~/.config/devin/skills/prompt-cache-skills

# OpenCode
git clone https://github.com/OnlyTerp/prompt-cache-skills ~/.config/opencode/skills/prompt-cache-skills

Then ask your agent:

Run the prompt-cache-skills bundle on this codebase.

Option C — read and apply by hand

Each skills/<name>/SKILL.md is a complete fix: target, symptom, diff, verification. Apply the relevant ones manually if you don't trust your agent to do it.

What's in here

prompt-cache-skills/
├── skills/                       ← the fixes (this is what your agent reads)
│   ├── cline-fix-volatile-msg/
│   ├── cline-openai-cache-key/
│   ├── cline-pin-timestamp/
│   ├── roo-fix-volatile-msg/
│   ├── roo-bedrock-custom-arn/
│   ├── continue-fix-volatile-msg/
│   ├── continue-enable-defaults/
│   ├── continue-gemini-explicit/
│   ├── opencode-detect-openai-compat/
│   ├── opencode-bedrock-doc-blocks/
│   ├── opencode-mistral-cache-key/
│   ├── aider-1h-ttl/
│   └── aider-cache-default-on/
├── audits/                       ← evidence: completed audits + queued stubs
│   ├── cline.md
│   ├── roo-code.md
│   ├── aider.md
│   ├── opencode.md
│   ├── continue.md
│   ├── codex-cli.md              ← (reference, already correct)
│   ├── claude-code.md
│   ├── hermes-nous.md
│   ├── codex-desktop.md
│   ├── devin-cli.md
│   ├── windsurf-cascade.md
│   ├── antigravity.md
│   ├── grok-cli.md
│   └── queued stubs: crush, goose, aichat, gptme, avante-nvim, kilo-code
├── docs/                         ← the underlying API mechanics
│   ├── concepts/                 ← per-provider caching reference
│   ├── gotchas.md                ← 16 numbered footguns
│   ├── verification.md           ← how to confirm caching on wire
│   └── scorecard.md              ← completed audits graded at a glance
├── tools/                        ← scripts to verify caching + doc consistency
│   ├── check_cache.py            ← fire request twice, dump cache_* fields
│   ├── check_docs_consistency.py ← assert counts/tables/links don't drift
│   ├── audit_harness.sh
│   └── replay_harness.md
└── AGENTS.md                     ← entry point for AI agents reading this repo

Why this exists

If your agent harness sends 30,000 tokens of system prompt + tools per turn, on Claude 4.7 Opus that's $0.15 per turn uncached vs $0.015 cached — a 10x difference. A 50-turn coding session costs $7.50 vs $0.75. You're paying 10x what you should be because the harness you use either:

  • doesn't set cache_control at all,

  • sets it on volatile content that thrashes the cache,

  • doesn't set prompt_cache_key for OpenAI,

  • has caching gated behind a config flag you never set, or

  • just doesn't implement it for one of your providers.

None of these are hard to fix. They're all 5-15 line diffs. The hard part is knowing which one applies to your harness and getting it right. This repo does that work for you.

The grade card

13 completed harness audits, dated 2026-05-27. The original 7 include the default Claude Desktop Code baseline, source-recon audits for Codex CLI, Aider, OpenCode, Roo Code, Cline, and Continue, plus extended source/wire/local-install audits for Hermes/Nous, Codex Desktop, Devin CLI, Windsurf/Cascade, Antigravity, and Grok CLI. Six more files in audits/ are queued stubs, not completed audits.

Harness Anthropic OpenAI Bedrock Gemini Managed/other

Claude Desktop Code working (default Desktop Code verified) n/a n/a n/a n/a

Codex CLI n/a working n/a n/a n/a

Aider working automatic n/a n/a n/a

OpenCode working working partial n/a n/a

Roo Code partial working partial n/a n/a

Cline partial broken unverified n/a n/a

Continue

常见问题

What is prompt-cache-skills?

prompt-cache-skills is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by OnlyTerp. Drop-in prompt-caching fixes for the LLM agent harness you use. Point your AI coding agent at this repo and it ships the patches. It has 104 GitHub stars.

Is prompt-cache-skills safe to use?

Yes. prompt-cache-skills passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install prompt-cache-skills?

Clone the repository with "git clone https://github.com/OnlyTerp/prompt-cache-skills" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is prompt-cache-skills written in?

prompt-cache-skills is primarily written in Python. It is open-source under OnlyTerp on GitHub, so you can review or fork the full source.

Are there alternatives to prompt-cache-skills?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh prompt-cache-skills against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情