Agent skill

Cline OpenAI Prompt Cache Key Fix

by OnlyTerp in OnlyTerp/prompt-cache-skills

Patch guide for adding a stable per-task prompt_cache_key to Cline's OpenAI native provider so cached token counts stop reading as zero.

Custom licenceAuto-check passedAI & LLM Engineering

Install Cline OpenAI Prompt Cache Key Fix

skills CLI
$ npx skills add OnlyTerp/prompt-cache-skills --skill cline-openai-cache-key -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OnlyTerp/prompt-cache-skills cline-openai-cache-key --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OnlyTerp/prompt-cache-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cline-openai-cache-key .claude/skills/cline-openai-cache-key && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cline-openai-cache-key
GitHub stars
114
Token cost
~868 tokens
SKILL.md length
283 words
Files
1
Skills in repo
13
Repo updated
First seen
Licence
Custom licence

At a glance

Patch guide for adding a stable per-task prompt_cache_key to Cline's OpenAI native provider so cached token counts stop reading as zero.

  • Works in 5 steps: Start mitmproxy capture as before. → Configure Cline with an OpenAI model… → Send two identical prompts in the same… → …
  • Cline reports zero cached tokens with an OpenAI model
  • SKILL.md covers Target, Symptom, Fix and Verify, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill describes one specific fix to src/core/api/providers/openai-native.ts in the cline/cline repository. Cline's OpenAI native provider only reads cache statistics from responses and never enables caching, so no prompt_cache_key goes out on Responses API calls, and hit rates stay low and unpredictable because requests are routed across pods at random.

The fix sets a stable prompt_cache_key derived from the task ID, or from a hash of the system instructions when there is no task ID, and warns never to use a per-request UUID. On the legacy Chat Completions endpoint the field is not valid, so the only lever is a stable prefix without timestamps, session IDs or random content. Verification means capturing traffic with mitmproxy, sending two identical prompts in one task, confirming the key and system prompt match across them, and seeing cached_tokens above zero with a ratio of at least 0.5 on a steady-state turn.

When your agent uses it

  • Cline reports zero cached tokens with an OpenAI model
  • Adding a prompt_cache_key to Responses API calls in an agent harness
  • Checking that two identical prompts in one task hit the cache

Example prompts

  • “Patch Cline's openai-native.ts to send a stable prompt_cache_key per task.”
  • “Why does Cline report cached_tokens as zero with my OpenAI model?”
  • “Verify with mitmproxy that the cache key is identical across two prompts in one task.”

Requirements

  • A checkout of cline/cline containing the openai-native.ts provider
  • mitmproxy for the verification step
  • An OpenAI model configured in Cline

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Start mitmproxy capture as before.
  2. Configure Cline with an OpenAI model (gpt-5.4, gpt-5-codex, etc.).
  3. Send two identical prompts in the same task.
  4. Inspect captured requests
  5. Inspect responses

What it can do on your machine

Read from SKILL.md and the folder at commit 5b58ae2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and diff).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cline OpenAI Prompt Cache Key Fix loads about 868 tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 283 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~35
When it runs · the whole SKILL.md, loaded when a task matches
~868

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 283 words (~868 tokens).

name
cline-openai-cache-key
target_harness
Cline
target_repo
cline/cline
target_files
src/core/api/providers/openai-native.ts
target_commit
65e9727c (verify current at apply time)
estimated_savings
50-90% input discount on OpenAI calls (currently 0%)

Read the full SKILL.md on GitHub

Files

Just SKILL.md in skills/cline-openai-cache-key of OnlyTerp/prompt-cache-skills.

Open the folder on GitHubat commit 5b58ae2

Compare with similar skills

Cline OpenAI Prompt Cache Key Fix next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cline OpenAI Prompt Cache Key Fix compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cline OpenAI Prompt Cache Key Fix this skillOnlyTerp/prompt-cache-skills114—~868Automated safety check: PassCustom licence
Claude APIKocoro-lab/Kocoro4147 repos~4.5kAutomated safety check: PassApache-2.0
Azure Openai To Responsesmicrosoft/ai-agents-for-beginners77k—~6kAutomated safety check: NotesMIT
Claude APIloulanyue/awesome-claude-notes2722 repos~2.1kAutomated safety check: PassMIT
Azure Openai To Responsesmicrosoft/ai-agents-for-beginners77k—~6kAutomated safety check: NotesMIT
Mmsp TypescriptPrism-Shadow/model-message-stream-protocol113—~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Claude API

    Kocoro-lab/Kocoro

    Build apps with the Claude API or Anthropic SDK. An agent skill from Kocoro-lab/Kocoro.

    414 GitHub starsUsed in 7 repos~4.5k tokens
    AI & LLM EngineeringAuto-check passed
  • Azure Openai To Responses

    microsoft/ai-agents-for-beginners

    Official

    Migrate Python apps from Azure OpenAI Chat Completions to the Responses API.

    77k GitHub stars~6k tokensUpdated 20 days ago
    AI & LLM EngineeringAuto-check: notes
  • Claude API

    loulanyue/awesome-claude-notes

    Anthropic Claude API patterns for Python and TypeScript. An agent skill from loulanyue/awesome-claude-notes.

    272 GitHub starsUsed in 2 repos~2.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Azure Openai To Responses

    microsoft/ai-agents-for-beginners

    Official

    Shift Python apps dem from Azure OpenAI Chat Completions go Responses API.

    77k GitHub stars~6k tokensUpdated 20 days ago
    AI & LLM EngineeringAuto-check: notes
  • Mmsp Typescript

    Prism-Shadow/model-message-stream-protocol

    Guidance for using the MMSP TypeScript SDK (@prismshadow/mmsp).

    113 GitHub stars~1.4k tokensUpdated 5 days ago
    AI & LLM EngineeringAuto-check passed
  • ClawRouter LLM Gateway

    BlockRunAI/ClawRouter

    Describes ClawRouter, a local proxy that forwards each LLM request to the blockrun.ai gateway, which routes to a cheaper capable model, paid by USDC wallet or API key credit.

    6.6k GitHub stars~6.8k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed

More from OnlyTerp/prompt-cache-skills

All 13 skills in this repo
  • Aider One-Hour Cache TTL

    OnlyTerp/prompt-cache-skills

    Patches Aider to request Anthropic's one-hour prompt cache lifetime, so long pauses between turns no longer expire the cache or need paid keepalive pings.

    114 GitHub stars~990 tokensUpdated 1 mo ago
    Auto-check passed
  • Aider Prompt Caching Default

    OnlyTerp/prompt-cache-skills

    Patch recipe that turns on Aider's --cache-prompts by default for models that support caching, with a verification procedure against the wire request.

    114 GitHub stars~638 tokensUpdated 1 mo ago
    Auto-check passed
  • Cline Prompt Cache Ladder Check

    OnlyTerp/prompt-cache-skills

    Verifies how Cline marks Anthropic prompt-cache breakpoints on the wire, then adds a tools breakpoint and tunes the cache TTL in its AI SDK code.

    114 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Cline Pin Timestamp

    OnlyTerp/prompt-cache-skills

    Cline's system prompt includes a timestamp that may be recomputed per request, invalidating the system-prompt cache.

    114 GitHub stars~751 tokensUpdated 1 mo ago
    Auto-check passed
  • Continue Enable Defaults

    OnlyTerp/prompt-cache-skills

    Continue's prompt caching is opt-in via config and off by default.

    114 GitHub stars~977 tokensUpdated 1 mo ago
    Auto-check passed
  • Continue Gemini Explicit

    OnlyTerp/prompt-cache-skills

    Continue's Gemini provider doesn't use the cachedContents API at all.

    114 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Cline OpenAI Prompt Cache Key Fix

What does Cline OpenAI Prompt Cache Key Fix do?

Patch guide for adding a stable per-task prompt_cache_key to Cline's OpenAI native provider so cached token counts stop reading as zero. ts in the cline/cline repository. Cline's OpenAI native provider only reads cache statistics from responses and never enables caching, so no prompt_cache_key goes out on Responses API calls, and hit rates stay low and unpredictable because requests are routed across pods at random.

When should I use Cline OpenAI Prompt Cache Key Fix?

Cline OpenAI Prompt Cache Key Fix fits situations like: cline reports zero cached tokens with an OpenAI model; adding a prompt_cache_key to Responses API calls in an agent harness; checking that two identical prompts in one task hit the cache.

How do I install Cline OpenAI Prompt Cache Key Fix in Claude Code?

Run `npx skills add OnlyTerp/prompt-cache-skills --skill cline-openai-cache-key -a claude-code`. Or copy the skill folder (skills/cline-openai-cache-key in OnlyTerp/prompt-cache-skills) into .claude/skills/cline-openai-cache-key in your project. Claude Code loads it when a task matches its description.

How do I install Cline OpenAI Prompt Cache Key Fix in Codex?

Run `npx skills add OnlyTerp/prompt-cache-skills --skill cline-openai-cache-key -a codex`. Or copy the skill folder (skills/cline-openai-cache-key in OnlyTerp/prompt-cache-skills) into .agents/skills/cline-openai-cache-key in your project. Codex loads it when a task matches its description.

Can I use Cline OpenAI Prompt Cache Key Fix in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OnlyTerp/prompt-cache-skills --skill cline-openai-cache-key -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cline-openai-cache-key, .gemini/skills/cline-openai-cache-key, .github/skills/cline-openai-cache-key and .opencode/skills/cline-openai-cache-key in your project.

What does Cline OpenAI Prompt Cache Key Fix need to run?

SKILL.md names no scripts, command-line tools or credentials: Cline OpenAI Prompt Cache Key Fix is instructions for the agent only. Our summary lists: A checkout of cline/cline containing the openai-native.ts provider; mitmproxy for the verification step; An OpenAI model configured in Cline.

Does Cline OpenAI Prompt Cache Key Fix access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Cline OpenAI Prompt Cache Key Fix safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cline OpenAI Prompt Cache Key Fix use?

Cline OpenAI Prompt Cache Key Fix has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Cline OpenAI Prompt Cache Key Fix use?

About 868 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cline OpenAI Prompt Cache Key Fix?

Skills that share tags, products or a category with Cline OpenAI Prompt Cache Key Fix: Claude API (Kocoro-lab/Kocoro, 414 stars), Azure Openai To Responses (microsoft/ai-agents-for-beginners, 77k stars), Claude API (loulanyue/awesome-claude-notes, 272 stars) and Azure Openai To Responses (microsoft/ai-agents-for-beginners, 77k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cline OpenAI Prompt Cache Key Fix?

OnlyTerp (a GitHub user) maintains it in OnlyTerp/prompt-cache-skills, which has 114 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on August 29, 2026.

Source: OnlyTerp/prompt-cache-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.