From cc-token-saver
Disables Claude Code built-in git instructions to save ~2200 tok/session + ~1700 tok/call, injecting 280-tok lite version via SessionStart hook. Safe subcommands auto-invoke; destructive (install/revert) user-only with guards.
npx claudepluginhub ww-w-ai/cc-token-saverThis skill uses the workspace's default tool permissions.
Manage Claude Code's built-in `includeGitInstructions` token consumption.
Sets up Claude Code PreToolUse hooks to block dangerous git commands (push, reset --hard, clean, branch -D) before execution. Prevents destructive git ops in AI coding.
Installs 695 pre-built safety hooks for Claude Code preventing file deletions, credential leaks, git disasters, and token waste in autonomous AI coding sessions. Use for safe AI-driven development.
Installs/uninstalls hooks in Claude Code that block raw git commands like 'git pull' and 'git checkout -b', enforcing git-town alternatives such as 'git town sync' and 'git town hack'.
Share bugs, ideas, or general feedback.
Manage Claude Code's built-in includeGitInstructions token consumption.
Parse the first argument from $ARGUMENTS:
| Subcommand | Risk | AI-allowed | Behavior |
|---|---|---|---|
install | ๐ด destructive | โ user-only | Modifies ~/.claude/settings.json + shell profile. Requires explicit <command-name>cc-token-saver:setup-git-lite</command-name> tag with <command-args>install</command-args> |
revert | ๐ด destructive | โ user-only | Aggressive cleanup. Same gating as install |
status | ๐ข safe | โ allowed | Read-only diagnostic |
dismiss-banner | ๐ข safe | โ allowed | Suppresses the recommendation banner (preferences.json flag) |
undismiss-banner | ๐ข safe | โ allowed | Re-enables the banner |
help | ๐ข safe | โ allowed | Prints usage |
| (empty) | ๐ข safe | โ allowed | Run status, then append one-line usage hint: "Subcommands: install, revert, status, dismiss-banner, undismiss-banner, help" |
If the subcommand is install or revert:
Verify explicit invocation: the triggering user message MUST contain <command-name>cc-token-saver:setup-git-lite</command-name> along with <command-args>install</command-args> (or revert). If these tags are absent (i.e., you inferred the intent from natural-language context), STOP and respond:
"This action modifies your global Claude Code settings and shell profile. Please invoke explicitly by typing
/setup-git-lite install(orrevert)."
User confirmation before execution: even when the tag is present, print a one-line summary and ask for a literal "yes":
"Install will:
- Set
includeGitInstructions: falsein ~/.claude/settings.json- Append a marker block to your shell profile exporting CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 Proceed? (type yes to confirm)"
Only proceed on a literal yes. Any other response โ cancel.
Safe subcommands (status, dismiss-banner, undismiss-banner, help) skip the guard entirely.
After (if required) passing the guard + confirmation, run:
node ${CLAUDE_PLUGIN_ROOT}/scripts/setup-git-lite.js <subcommand>
Relay stdout verbatim to the user. On non-zero exit, surface stderr.
Detect the user's language from the conversation. Translate ALL user-facing output into that language. The script outputs English โ you MUST translate before relaying. Keep technical identifiers verbatim (file paths, env var names, command names, setting keys).
status: translate stdout into the user's language, then relay.install: translate stdout, then add a short line pointing to README for the rationale.revert: translate stdout, then note "Your current shell env may still have the variable set โ restart the shell or run unset CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS." (in the user's language).dismiss/undismiss: translate stdout, then relay.help: translate stdout, then relay.status.The hook content and behavior are documented in the cc-token-saver README (Git instructions section). Key points for the user if they ask: