# Cache Prefix Stability For Subagents

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

- **Type:** Skill
- **Install:** `agentstack add skill-ychampion-cskill-agents-cache-prefix-stability-for-subagents`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ychampion](https://agentstack.voostack.com/s/ychampion)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ychampion](https://github.com/ychampion)
- **Source:** https://github.com/ychampion/cskill-agents/tree/main/agents/claude-code/skills/cache-prefix-stability-for-subagents
- **Website:** https://x.com/YashasGunderia/status/2039990540016693692?s=20

## Install

```sh
agentstack add skill-ychampion-cskill-agents-cache-prefix-stability-for-subagents
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ychampion](https://github.com/ychampion)
- **Source:** [ychampion/cskill-agents](https://github.com/ychampion/cskill-agents)
- **License:** MIT
- **Homepage:** https://x.com/YashasGunderia/status/2039990540016693692?s=20

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ychampion-cskill-agents-cache-prefix-stability-for-subagents
- Seller: https://agentstack.voostack.com/s/ychampion
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
