max-tokens-ceiling-guard

Installation
SKILL.md

Max Tokens Ceiling Guard (Task-Calibrated Output Budgeting)

Overview

When invoking LLM APIs (/v1/chat/completions or /v1/messages), client SDKs commonly omit or default the max_tokens parameter to 4,096 or 8,192 tokens.

Defaulting to maximum ceilings creates severe operational hazards:

  1. Runaway Generation Loops: If the model encounters a recursive prompt or looping pattern, it streams 4,096 tokens of garbage text before hitting the stop token, burning $0.06 to $0.12 per loop.
  2. Slow Crash Latency: A looping task hangs the agent for 40 to 60 seconds while streaming unnecessary tokens.
  3. Financial Exposure: Runaway background jobs can consume hundreds of dollars in hours without hard output limits.

The Max Tokens Ceiling Guard Protocol enforces task-calibrated output clamping - restricting the output ceiling strictly to the expected payload size.


Default 4,096 Ceiling vs. Task-Calibrated Budget Guard

Installs
1
GitHub Stars
2
First Seen
Oct 24, 2026