一键导入
role-aware-context-slimming
Trim user and system context based on the agent’s role so read-only helpers don’t inherit stale git or CLAUDE metadata.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Trim user and system context based on the agent’s role so read-only helpers don’t inherit stale git or CLAUDE metadata.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Collapse multiple change sources into one caller-facing boolean so headless bootstraps know whether a downstream refresh is necessary.
After awaiting persistence work, update the shared budget state for each `tool_use_id` exactly once so no concurrent reader ever sees a half-committed decision.
Issue continuation nudges while the turn stays under budget, then halt once diminishing returns or the budget cap justify stopping.
Lazily extract referenced files for bundled skills so large prompts stay offline until needed.
Persist a cache-safe stop-hook context snapshot only for main session queries so later helpers can resume from stable state without fork pollution.
Sweep stale extension caches before activation, then fall back to a sticky manual-refresh flag if the live refresh fails.
| name | role-aware-context-slimming |
| description | Trim user and system context based on the agent’s role so read-only helpers don’t inherit stale git or CLAUDE metadata. |
| metadata | {"author":"ychampion"} |
Domain: context-management
Trigger: When an agent declares omitClaudeMd or runs as an Explore/Plan helper, slim the context before handing it to runAgent.
Source Pattern: Distilled from reviewed context, compaction, and memory-governance patterns.
Use the omitClaudeMd flag (and the tengu_slim_subagent_claudemd feature gate) to strip claudeMd from the user context unless an override was explicitly provided. For read-only helpers such as Explore or Plan, drop the gitStatus entry from the system context because it is stale and bloats the payload. Always compute new context objects instead of mutating the originals so other agents can still read the full metadata set.
claudeMd when agentDefinition.omitClaudeMd is true, no user override is present, and the feature flag allows it, so you do not throw away intentional user context edits.userContextNoClaudeMd by destructuring the base context and omitting claudeMd before assigning resolvedUserContext.gitStatus from resolvedSystemContext any time agentDefinition.agentType is Explore or Plan, while leaving other system keys intact.When the CLI launches an Explore subagent, apply this skill to create resolvedUserContext without claudeMd and resolvedSystemContext without gitStatus, saving dozens of tokens and preventing stale git information from confusing the helper.
claudeMd even though the caller supplied an override user context; that override often carries explicit corrections or clarifications.gitStatus for Explore/Plan agents, which bloats the prompt with stale files and slows down the API call.