一键导入
quota-sentry
Use when managing Quota Sentry, checking Codex quota guard state, starting the background quota monitor, or installing the global Codex hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when managing Quota Sentry, checking Codex quota guard state, starting the background quota monitor, or installing the global Codex hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | quota-sentry |
| description | Use when managing Quota Sentry, checking Codex quota guard state, starting the background quota monitor, or installing the global Codex hook. |
Quota Sentry is a local Codex quota guard.
codex app-server --stdio by default, reading account/rateLimits/read.--source auto cannot use the app-server path.windowMinutes: 300).windowMinutes: 10080) as advisory status by default.usedPercent >= 95.99% when enabled.resetsAt plus a 60-second buffer.The background daemon observes quota and writes state every five minutes by default, tightening its cadence near the quota threshold. Actual blocking requires a synchronous guard path to run from a global Codex hook or wrapper. Do not claim that the daemon can interrupt an already-running model request.
Installed Codex hooks must only read cached daemon state and must not invoke a live quota source from the hook process. SessionStart should run start --quiet synchronously because Codex 0.140.0 skips async hooks. UserPromptSubmit should use prompt-guard; PreToolUse should use guard --state-only --no-notify.
Run from the plugin root:
./scripts/quota-sentry poll
./scripts/quota-sentry start
./scripts/quota-sentry status
./scripts/quota-sentry guard
./scripts/quota-sentry stop
./scripts/quota-sentry install-hook
./scripts/quota-sentry configure --weekly-mode hard-block --weekly-threshold-percent 99
./scripts/autonomous-test
Use install-hook to merge global hooks into ~/.codex/hooks.json. Restart Codex if the current session does not pick them up.
Use ./scripts/autonomous-test for the E2E harness. It performs one live Codex quota-source smoke poll and uses fake codex and codexbar binaries for quota-edge scenarios so it does not burn quota through repeated real prompts.
poll, start, and guard accept --source auto|codex-app-server|codexbar. Default auto uses Codex app-server first and falls back to CodexBar.
Weekly usage is advisory by default. Use configure --weekly-mode hard-block --weekly-threshold-percent 99 to opt in to weekly blocking, or configure --weekly-mode advisory to return to status-only weekly behavior. Config lives at ~/.config/quota-sentry/config.json; installed hook commands should remain unchanged.
guard keeps stdout/stderr quiet by default to avoid flooding Codex hook context after long waits. It still writes one wait notice directly to the controlling terminal when waiting starts unless --no-notify is set. Use guard --verbose only for manual debugging, guard --no-notify to suppress the terminal notice, and guard --state-only when a hook must not perform a live quota-source poll.
Set QUOTA_SENTRY_DISABLE=1 to bypass blocking.