一键导入
budget-diminishing-continue
Issue continuation nudges while the turn stays under budget, then halt once diminishing returns or the budget cap justify stopping.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Issue continuation nudges while the turn stays under budget, then halt once diminishing returns or the budget cap justify stopping.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
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.
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.
Warm the authoritative cache path first, then fan out cache-only readers in parallel so derived loaders never race stale state.
基于 SOC 职业分类
| name | budget-diminishing-continue |
| description | Issue continuation nudges while the turn stays under budget, then halt once diminishing returns or the budget cap justify stopping. |
| metadata | {"author":"ychampion"} |
Domain: tool-orchestration
Trigger: Apply when you have a task-level token budget and must decide between continuing and stopping while respecting diminishing returns.
Source Pattern: Distilled from reviewed tool-loop and result-shaping patterns.
Track the cumulative tokens consumed per turn, issue a continuation nudge while the usage stays below completionThreshold (90% by default), and stop once token deltas shrink across repeated continuations. Diminishing-return detection keeps the loop from looping forever: once two cells in a row add fewer than DIMINISHING_THRESHOLD tokens, or the tracker reached several continuations, stop and emit the final completion payload. The tracker also guides budgetDecision.action so callers can differentiate between gentle nudges and hard stop signals.
BudgetTracker at turn start and update continuationCount, lastDeltaTokens, and lastGlobalTurnTokens after each continuation decision.budget * COMPLETION_THRESHOLD and the last token deltas are meaningful; otherwise treat it as diminishing returns.completionEvent that records counts, percentages, and elapsed duration so callers can log or surface why the turn ended.stop with completionEvent = null to avoid undefined behavior.getBudgetContinuationMessage so the user sees consistent phrasing and the tracker returns the tidy pct/turnTokens metrics.If a query advances toward a 100k token budget, continue streaming until usage hits 90% or token growth slows; when the stop decision triggers, log the diminishing-returns flag so both user and telemetry know the stream ended intentionally.
continue; re-run the decision each iteration to respect the latest token deltas.completionEvent data when stopping; it contains the telemetry the backend uses to tell budgets apart from user cancellations.