Budget diminishing continue
Skill ychampion/cskill-agents/agents/claude-code/skills/budget-diminishing-continue
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!
npx -y skills add ychampion/cskill-agents --skill budget-diminishing-continueAssembled 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
Issue continuation nudges while the turn stays under budget, then halt once diminishing returns or the budget cap justify stopping.
SKILL.md
2.4 KB, as published. Nobody here has run it
SKILL: Budget Diminishing Continue
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.
Core Method
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.
Key Rules
- Initialize
BudgetTrackerat turn start and updatecontinuationCount,lastDeltaTokens, andlastGlobalTurnTokensafter each continuation decision. - Allow continuations only when under
budget * COMPLETION_THRESHOLDand the last token deltas are meaningful; otherwise treat it as diminishing returns. - When stoppage occurs due to diminishing returns, include the
completionEventthat records counts, percentages, and elapsed duration so callers can log or surface why the turn ended. - If the budget or agent ID is missing, return an immediate
stopwithcompletionEvent = nullto avoid undefined behavior. - Always compute the continuation message via
getBudgetContinuationMessageso the user sees consistent phrasing and the tracker returns the tidypct/turnTokensmetrics.
Example Application
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.
Anti-Patterns (What NOT to do)
- Do not keep continuing just because the earlier logic returned
continue; re-run the decision each iteration to respect the latest token deltas. - Do not drop the
completionEventdata when stopping; it contains the telemetry the backend uses to tell budgets apart from user cancellations.