claude

token-guard

Token consumption guards: large-read warning (100KB+), read budget limit, subagent cap, and token budget tracking. Reduce waste by 20-40%.

1 on GitHubby gaebalaiv1.0.0MITupdated 5 months agooptimization
/

Plugin token-guard from marketplace cc-guard in ilhae-ai/cc-guard. Commands read from the repo's manifest — 25 days ago.

This plugin runs code on your machine — its hooks fire automatically on events like tool use. The exact commands are listed below; read them before installing.

What it installs

Hooks (4)

  • PreToolUse

    INPUT=$(cat); FP=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null); [ -z "$FP" ] || [ ! -f "$FP" ] && exit 0; SZ=$(stat -c%s "$FP" 2>/dev/null || stat -f%z "$FP" 2>/dev/null); [ "$

  • PreToolUse

    BUDGET=${CC_READ_BUDGET:-100}; WARN=${CC_READ_WARN:-50}; T=/tmp/cc-read-budget-$PPID; INPUT=$(cat); FP=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null); [ -z "$FP" ] && exit 0; C=

  • PreToolUse

    MAX=${CC_MAX_AGENTS:-3}; T=/tmp/cc-agents-$PPID; C=0; [ -f "$T" ] && C=$(cat "$T"); C=$((C+1)); echo $C > "$T"; [ $C -gt $MAX ] && { echo "[BLOCK] Subagent limit (${MAX}). Complete existing agents fir

  • PostToolUse

    WARN=${CC_TOKEN_BUDGET:-50000}; BLOCK=${CC_TOKEN_BLOCK:-100000}; T=/tmp/cc-tokens-$PPID; INPUT=$(cat); SZ=${#INPUT}; TK=$((SZ/4)); TOTAL=0; [ -f "$T" ] && TOTAL=$(cat "$T"); TOTAL=$((TOTAL+TK)); echo

View source on GitHub claudecode.to

More from ilhae-ai/cc-guard

All 4 plugins →

Protect secrets and credentials: block writes to .env files, detect API keys in commands, prevent hardcoded tokens, guard service account files.

hooks

1

Git safety hooks: block force-push, protect main/master, prevent hard-reset, guard rebase, and auto-backup before destructive operations.

hooks

1

5 essential safety hooks: block rm -rf, force-push, hard-reset, env overwrites, and package publish. The minimum viable safety net.

hooks

1

Similar plugins

nextjs

claude

Official Next.js skills: adopt and optimize Cache Components, adopt Partial Prefetching, and verify runtime behavior against a running dev server.

6 skills

vercel/next.js 143,495

Token usage tracking, model cost attribution per agent, budget alerts, and optimization recommendations

24 skills · 1 command · 1 agent · hooks

ruvnet/ruflo 81,589

Skill: add headroom-ai compress() to a Python or TypeScript app to cut LLM input tokens (tool outputs, logs, JSON, chat history). No API key.

1 skill

headroomlabs-ai/headroom 79,508

mem0

claudecodex

Cross-session memory and token savings for coding agents.

6 skills · 1 agent · 1 MCP server · hooks

mem0ai/mem0 68,893

azure

claude

Transform Claude into an Azure expert. This plugin integrates the Azure MCP server and specialized Azure skills to move beyond generic advice. It enables Claude to perform real-world tasks: listing resources, validating deployments, diagnosing infrastructure issues, and optimizing costs across 50+ Azure services.

44 skills · 1 MCP server

anthropics/claude-plugins-official 47,076

ifixai

claudecodex

Independent auditing for AI agents, open source. Claude discovers your setup, confirms the cost, and audits your agent against the one question other tools skip: is it doing the job it's supposed to do, given your business rules and org structure? Test any model (Anthropic, OpenAI, Gemini, Azure, Bedrock, …) graded by self, one independent judge, or a cross-vendor panel; each provider is billed to its own account via a key in your settings, never the command line. Results render as an interactive artifact (with a static-report fallback).

1 skill · hooks

ifixai-ai/iFixAi 45,158

Maintain token-guard?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex plugins4 plugins