Manage Claude Code's built-in includeGitInstructions token consumption.
Subcommand routing
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>super-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" |
Invocation guard — enforce for destructive subcommands only
If the subcommand is install or revert:
Verify explicit invocation: the triggering user message MUST contain <command-name>super-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 (or revert)."
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: false in ~/.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.
Execution
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.
Language
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).
Output conventions
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.
Error handling
- Exit code 1 (general error): print stderr, suggest running
status.
- Exit code 2 (unknown subcommand): surface the hint from the script, no further work.
Design reference
The hook content and behavior are documented in the super-token-saver README (Git instructions section). Key points for the user if they ask:
- Original CC built-in injects ~2,200 tokens per session (git status snapshot + full commit/PR workflow).
- Our replacement is ~280 tokens (11 override rules + compact git state line with file list).
- 88% token reduction, 95%+ of the safety rules preserved.
- Other style/workflow guidance is dropped because Claude's training already covers it (e.g., PR title conventions, HEREDOC format awareness, gh usage).
1---2name: setup-git-lite3description: Disable Claude Code built-in git instructions and inject a curated 280-tok minimum via SessionStart hook. Saves ~2,200 tok/session + ~1,700 tok/call.4---56Manage Claude Code's built-in `includeGitInstructions` token consumption.78## Subcommand routing910Parse the first argument from `$ARGUMENTS`:1112| Subcommand | Risk | AI-allowed | Behavior |13| ---------- | ---- | ---------- | -------- |14| `install` | 🔴 destructive | ❌ user-only | Modifies ~/.claude/settings.json + shell profile. Requires explicit `<command-name>super-token-saver:setup-git-lite</command-name>` tag with `<command-args>install</command-args>` |15| `revert` | 🔴 destructive | ❌ user-only | Aggressive cleanup. Same gating as install |16| `status` | 🟢 safe | ✅ allowed | Read-only diagnostic |17| `dismiss-banner` | 🟢 safe | ✅ allowed | Suppresses the recommendation banner (preferences.json flag) |18| `undismiss-banner` | 🟢 safe | ✅ allowed | Re-enables the banner |19| `help` | 🟢 safe | ✅ allowed | Prints usage |20| (empty) | 🟢 safe | ✅ allowed | Run `status`, then append one-line usage hint: "Subcommands: install, revert, status, dismiss-banner, undismiss-banner, help" |2122## Invocation guard — enforce for destructive subcommands only2324If the subcommand is `install` or `revert`:25261. **Verify explicit invocation**: the triggering user message MUST contain `<command-name>super-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:2728 > "This action modifies your global Claude Code settings and shell profile. Please invoke explicitly by typing `/setup-git-lite install` (or `revert`)."29302. **User confirmation before execution**: even when the tag is present, print a one-line summary and ask for a literal "yes":3132 > "Install will:33 > - Set `includeGitInstructions: false` in ~/.claude/settings.json34 > - Append a marker block to your shell profile exporting CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=135 > Proceed? (type yes to confirm)"3637 Only proceed on a literal `yes`. Any other response — cancel.3839Safe subcommands (`status`, `dismiss-banner`, `undismiss-banner`, `help`) skip the guard entirely.4041## Execution4243After (if required) passing the guard + confirmation, run:4445```bash46node ${CLAUDE_PLUGIN_ROOT}/scripts/setup-git-lite.js <subcommand>47```4849Relay stdout verbatim to the user. On non-zero exit, surface stderr.5051## Language5253Detect 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).5455## Output conventions5657- `status`: translate stdout into the user's language, then relay.58- `install`: translate stdout, then add a **short** line pointing to README for the rationale.59- `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).60- `dismiss`/`undismiss`: translate stdout, then relay.61- `help`: translate stdout, then relay.6263## Error handling6465- Exit code 1 (general error): print stderr, suggest running `status`.66- Exit code 2 (unknown subcommand): surface the hint from the script, no further work.6768## Design reference6970The hook content and behavior are documented in the super-token-saver README (Git instructions section). Key points for the user if they ask:7172- Original CC built-in injects ~2,200 tokens per session (git status snapshot + full commit/PR workflow).73- Our replacement is ~280 tokens (11 override rules + compact git state line with file list).74- 88% token reduction, 95%+ of the safety rules preserved.75- Other style/workflow guidance is dropped because Claude's training already covers it (e.g., PR title conventions, HEREDOC format awareness, gh usage).