loop-budget

Monitors and enforces token budget and run-log spend during loop iterations.

Updated Jul 5, 2026
One-click install
npx skills add https://github.com/chenxingqiang/loops-automatic-researching --skill loop-budget-chenxingqiang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loop-budget
Source: https://github.com/chenxingqiang/loops-automatic-researching/tree/main/skills/loop-budget
Command: npx skills add https://github.com/chenxingqiang/loops-automatic-researching --skill loop-budget-chenxingqiang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill ensures that token budgets and run-log spends are monitored and enforced during loop iterations, preventing overages and ensuring actionable work.

Core Features & Use Cases

  • Budget Monitoring: Check token budget and run-log spend before and after a loop run.
  • Early Exit: Enforce early exit when over budget or when there is no actionable work.
  • Report-Only Mode: Enter report-only mode when spending reaches 80% of the pattern's daily cap.
  • Loop Guard: Run at the start and end of every loop iteration to maintain control and accuracy.

Quick Start

Run the loop-budget skill at the start and end of each loop iteration to monitor your token budget and run-log spend.

Frequently Asked Questions about loop-budget

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I monitor token budget spend during loop iterations?

Token budget spend during loop iterations is monitored by running a loop guard script at the start and end of each cycle. This checks token consumption against defined limits to ensure actionable work and prevent overages.

How does early exit work when enforcing run-log spend limits?

Early exit triggers when a loop run detects spending has exceeded the allocated token budget or when no actionable work remains. It halts the loop iteration immediately to prevent overages and save resources.

What is report-only mode for loop token consumption?

Report-only mode is a throttling state activated when run-log token spending reaches 80% of the pattern's daily cap. It restricts further actionable execution and focuses solely on logging remaining activity.

Do I need specific files to enable loop monitoring and budget enforcement?

Yes, loop monitoring and budget enforcement require access to loop-budget.md for budget thresholds and loop-run-log.md for run-log spend data. These files provide the baseline for all token checks.

When should I run a loop guard script to prevent token overages?

You should run the loop guard script at both the start and end of every loop iteration. This ensures continuous budget enforcement, maintains control over token spend, and accurately tracks run-log data.