一键导入
empty-trigger-short-circuit-before-app-state
Skip nested memory collection when no triggers exist so render-bound `getAppState()` is never invoked unnecessarily.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Skip nested memory collection when no triggers exist so render-bound `getAppState()` is never invoked unnecessarily.
用 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 | empty-trigger-short-circuit-before-app-state |
| description | Skip nested memory collection when no triggers exist so render-bound `getAppState()` is never invoked unnecessarily. |
| metadata | {"author":"ychampion"} |
Domain: context-management
Trigger: Use when nested memory attachment triggers may be empty and you want to avoid React render-cycle work unless there is actual work to do.
Source Pattern: Distilled from reviewed context, compaction, and memory-governance patterns.
Before calling expensive or render-bound helpers, check the cheap trigger state. If nestedMemoryAttachmentTriggers is missing or empty, return immediately so that the expensive getAppState() call does not fire on every turn. Only when work exists do you fetch the React-bound state and iterate over the trigger set, ensuring each attachment run still has access to the required context but only when needed.
nestedMemoryAttachmentTriggers for truthiness and non-zero size before doing anything else.getAppState() or other render-dependent helpers after you confirm there are triggers to process.In a turn that has no nested memory triggers, return [] right away so getAppState() is never invoked; when triggers exist, call getAppState(), collect each nested attachment, and clear the set afterward as usual.
appState before validating that the trigger set requires it.