You're running agents on a Max plan with zero visibility into quota consumption. That changed in v2.1.80.
Claude Code now pipes rate_limits data to custom statusline scripts. You get five_hour.used_percentage, seven_day.used_percentage, and resets_at timestamps for both windows — all as JSON to stdin.
The statusline is that customizable bar at the bottom of every Claude Code session. Configure it in ~/.claude/settings.json:
"statusline": {
"script": "~/.claude/statusline.sh"
}
}
Your script receives JSON on stdin with the full session state. The rate limit fields you care about:
INPUT=$(cat)
FIVE_HR=$(echo "$INPUT" | jq -r '.rate_limits.five_hour.used_percentage // "?"')
SEVEN_DAY=$(echo "$INPUT" | jq -r '.rate_limits.seven_day.used_percentage // "?"')
echo "⛽ 5h: ${FIVE_HR}% | 7d: ${SEVEN_DAY}%"
The companion PermissionDenied hook event fires after auto-mode denials. Return {retry: true} to retry the operation — useful for self-healing patterns where you fix the issue and want the agent to try again.
This turns headless agents from fire-and-forget into supervised autonomy. The agent runs independently on routine work, but pauses at dangerous boundaries and waits for you. Combined with the --channels flag (v2.1.81), you could get notified via Dispatch or your Telegram bot when an agent is waiting for approval.
The pattern: let agents run free for reads, writes, and research. Defer on git pushes, deployments, external API calls, and anything that affects shared state.
HumanLayer's research established that frontier LLMs can follow approximately 150-200 instructions with reasonable consistency. Claude Code's own system prompt consumes ~50 of those slots. That leaves your CLAUDE.md roughly 100-150 effective instruction slots before adherence degrades.
Every instruction you add pushes another one closer to being ignored. This reframes CLAUDE.md from "documentation" to "attention budget."
Practical rules:
Keep root CLAUDE.md under 100 lines. Boris Cherny (Claude Code creator) keeps his at ~100. HumanLayer's is under 60. If yours is longer, you're spending tokens the model won't follow.
Never use CLAUDE.md as a linter. "Use 2-space indentation" and "Always add trailing commas" waste instruction slots. Put those in .eslintrc or a pre-commit hook where they're enforced mechanically.
Use progressive disclosure. Move task-specific docs to docs/ or agent_docs/, referenced by one-line descriptions in CLAUDE.md. Let Claude decide which to read. The @import syntax (up to 5 levels deep) helps here.
Exploit recency bias. LLMs pay more attention to instructions at the beginning and end of context. Put your hardest rules — the ones agents violate most — at the top and bottom of CLAUDE.md.
Audit your agents. Count the instructions in each agent's CLAUDE.md. If any exceed ~100 effective instructions, refactor. Every instruction should either be impossible to encode elsewhere (lint rule, hook, test) or critical enough to justify the attention cost.
Your agents each have their own CLAUDE.md. A bloated one is why agents "forget" rules on long runs.
This is not a typo. OpenAI released codex-plugin-cc — an open-source (Apache 2.0) plugin that runs inside Claude Code. It adds three slash commands:
/codex:review— Standard code review powered by Codex/codex:adversarial-review— Challenges design decisions and tradeoffs (not just style)/codex:rescue— Delegates work to Codex as a subagent for bug investigation or second-pass fixes
Requires a ChatGPT subscription (free tier works) or an OpenAI API key, plus Node 18.18+.
Install:
- Open a new Claude Code session. You should see the fuel gauge in the status bar at the bottom.
- Run a few prompts and watch the 5-hour percentage tick up.
Expected outcome: Every Claude Code session — interactive and headless — shows a colored fuel gauge with 5-hour and 7-day quota percentages, reset time, and current model.
Verify:
- Open Claude Code and confirm the statusline shows
🟢 5h: X% | 7d: Y% - Run 2-3 prompts and confirm the percentage increases
- Check that
~/.claude/statusline.shreceives valid JSON:echo '{"rate_limits":{"five_hour":{"used_percentage":42},"seven_day":{"used_percentage":15}}}' | ~/.claude/statusline.sh