Cache prefix stability for subagents

From ychampion/cskill-agents · View interactive version

Cache prefix stability for subagents is an AI agent skill from the GitHub repository ychampion/cskill-agents. Preserve cache-critical request fields when a child agent must share the parent's prompt prefix for cache hits.

How to use this skill

Skill file

SKILL: Cache Prefix Stability For Subagents

Domain: agentic-loop

Trigger: Apply when a subagent should share the parent's cached prompt prefix instead of recomputing a divergent request shape.

Source Pattern: Distilled from reviewed subagent orchestration, isolation, and lifecycle implementations.

Core Method

Treat prompt-cache compatibility as an explicit contract when building child agent options. Preserve the cache-critical fields that define the API request prefix, including the merged tool pool, thinking configuration, query source, and content-replacement state, instead of letting child defaults drift away from the parent request. This keeps forked or exact-tool subagents eligible for the same cached prefix while still allowing non-cache-sensitive options to vary.

Key Rules

Example Application

If a forked review agent must reuse the parent’s prompt cache, build its options from the parent’s tool list and thinking config instead of resetting them to child defaults; the child can then reuse cached request prefixes while still emitting its own downstream messages.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.