agentsclimarketplace

Cache prefix stability for subagents

Skill ychampion/cskill-agents/agents/claude-code/skills/cache-prefix-stability-for-subagents

Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!

Install
npx -y skills add ychampion/cskill-agents --skill cache-prefix-stability-for-subagents

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Preserve cache-critical request fields when a child agent must share the parent's prompt prefix for cache hits.

SKILL.md

2.2 KB, as published. Nobody here has run it

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

  • Only inherit cache-critical request fields when the child is intentionally sharing the parent's prefix, such as the use exact tools path.
  • Keep the resolved tool list, thinking configuration, and content-replacement state aligned with the parent request so cache keys do not diverge accidentally.
  • Preserve the recursive-fork guard inputs like query source when they are part of the cached request prefix contract.
  • Do not inherit unrelated defaults blindly; share only the fields that stabilize the prefix and let other child-specific behavior vary intentionally.

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)

  • Do not disable thinking or rebuild the tool pool for a cache-sharing child unless you also accept losing cache alignment.
  • Do not rely on accidental structural similarity between parent and child requests; explicitly carry forward the fields that define the cache prefix.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.