~ / rigs / Sagargupta16 / claude-cost-optimizer

Sagargupta16/claude-cost-optimizer

Save 30-60% on Claude Code costs -- proven strategies, real benchmarks, copy-paste configs, and interactive tools

↗ GitHub ★ 29 mit updated 3mo ago project Claude Code Claude plugin
share on X
ARCHETYPE
Fort Knox
Deny lists, pre-tool hooks, sandboxing. Nothing touches prod without a signature.
CONTEXT TAX · EVERY TURN
~798 tokens
Featherweight · median rig: 2.3k · breakdown
GUARDRAILS
4/5
Blocks destructive commands · Protects secrets · Pre-tool screening hook · No YOLO mode · details

Copy this rig

# review before running: this installs third-party code
$ npx degit Sagargupta16/claude-cost-optimizer/.claude ./rig-claude-cost-optimizer  # inspect, then merge into .claude/

MCP servers are added to Claude Code at local scope; env vars are shown as YOUR_… placeholders — we never store values. Files are fetched with degit into a separate folder so you can review before merging.

$ npx degit Sagargupta16/claude-cost-optimizer/plugins/cost-mode/skills/cost-mode .claude/skills/cost-mode

Merge into .claude/settings.json (project) or ~/.claude/settings.json (user). Hook commands reference scripts in the source repo — copy those too.

{
  "permissions": {
    "deny": [
      "Read(.env)",
      "Read(.env.*)",
      "Read(./node_modules/**)",
      "Read(./dist/**)",
      "Read(./build/**)",
      "Read(./tools/vscode-extension/out/**)",
      "Read(*.vsix)",
      "Read(*.tsbuildinfo)",
      "Read(*.lock)",
      "Read(package-lock.json)",
      "Read(pnpm-lock.yaml)",
      "Read(./__pycache__/**)",
      "Read(*.pyc)",
      "Read(./.ruff_cache/**)",
      "Read(./.pytest_cache/**)",
      "Read(./coverage/**)",
      "Read(./htmlcov/**)",
      "Read(.coverage)",
      "Read(*.log)",
      "Read(./.venv/**)",
      "Read(./venv/**)",
      "Read(./.vscode/**)",
      "Read(./.idea/**)",
      "Read(./.git/**)"
    ]
  },
  "hooks": {
    "PreToolUse": [
      {
        "matcher": ".*",
        "hooks": [
          {
            "type": "command",
            "command": "bash hooks/budget-tracker.sh"
          },
          {
            "type": "command",
            "command": "bash hooks/cost-logger.sh"
          }
        ]
      }
    ]
  }
}

Skills (1)

Hooks (3)

eventmatcherruns
PreToolUse.*bash hooks/budget-tracker.sh
PreToolUse.*bash hooks/cost-logger.sh
Stop*bash hooks/session-summary.sh

Permissions

deny (24)
Read(.env)
Read(.env.*)
Read(./node_modules/**)
Read(./dist/**)
Read(./build/**)
Read(./tools/vscode-extension/out/**)
Read(*.vsix)
Read(*.tsbuildinfo)
Read(*.lock)
Read(package-lock.json)
Read(pnpm-lock.yaml)
Read(./__pycache__/**)
Read(*.pyc)
Read(./.ruff_cache/**)
Read(./.pytest_cache/**)
Read(./coverage/**)
Read(./htmlcov/**)
Read(.coverage)
Read(*.log)
Read(./.venv/**)
Read(./venv/**)
Read(./.vscode/**)
Read(./.idea/**)
Read(./.git/**)
ask (0)
—
allow (11)
Read(**)
Bash(python tools/claude-rate/rate.py:*)
Bash(python tools/badge-generator/generate.py:*)
Bash(python scripts/check-pricing-sync.py:*)
Bash(python scripts/check-links.py:*)
Bash(python -m compileall:*)
Bash(npm run build)
Bash(npm run lint)
Bash(npx tsc:*)
Bash(git status)
Bash(git diff:*)

Similar rigs

copied ✓