rtk: fleet install + chezmoi-managed config with dialed-back hook filters#8
Draft
simshanith wants to merge 2 commits into
Draft
rtk: fleet install + chezmoi-managed config with dialed-back hook filters#8simshanith wants to merge 2 commits into
simshanith wants to merge 2 commits into
Conversation
rtk (token-optimizing Claude Code proxy) now installs fleet-wide via the committed mise baseline instead of machine-local config.toml, so a fresh checkout gets it. Document the one-time `rtk init -g` step in 2026_REFRESH.md; left manual since it writes to ~/.claude/ (unmanaged by chezmoi).
One shared template (.chezmoitemplates/rtk-config.toml) rendered to ~/.config/rtk/ on linux and ~/Library/Application Support/rtk/ on darwin (rtk ignores XDG there); the unused path is suppressed per-OS in .chezmoiignore. Entries are .tmpl so symlink mode writes real files — sandboxed rtk must read its own config (same lesson as ~/.gitattributes). The config itself dials the hook back to where filtering pays off: - exclude rg/grep/curl/diff: rtk grep backends to BSD grep and swallows its errors with exit 0 (silent empty results); grep was 254/287 of all parse failures; curl saved 2 tokens on 138K input; diff failed to parse 28 of 36 calls and strips hunk context - git restricted to commit/fetch (88%/66% avg savings) via transparent_prefixes: compact filters stripped needed output, e.g. git stash SHAs, forcing follow-up rev-parse calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two commits making rtk consistent across the fleet:
rtk init -gdocumented in 2026_REFRESH.md..chezmoitemplates/rtk-config.toml) rendered to~/.config/rtk/config.tomlon linux and~/Library/Application Support/rtk/config.tomlon darwin (rtk hard-wires the Library path and ignores XDG on macOS — verified empirically). The unused path is suppressed per-OS in.chezmoiignore. Both entries are.tmplso symlink-mode chezmoi writes real files; sandboxed rtk invocations must be able to read the config (same ELOOP lesson as~/.gitattributes).Why the dialed-back filters
Analysis of rtk's history DB (1,498 commands) + Claude session transcripts:
rtk grepbackends to BSD grep on macOS (even with ripgrep on PATH) and swallows its usage errors with exit 0 → silent empty results; caused a real derailment (rg--globin a dep-upgrade session). grep was also 254/287 of all hook parse failures. Lifetime savings: 6.1K.rtk curl: 2 tokens saved on 138K input.rtk diff: failed to parse 28 of 36 calls; condensing strips hunk context.rtk gitcompact filters stripped needed output (e.g.git stashSHA → extra rev-parse round-trip), so git is restricted tocommit/fetch(88%/66% avg savings) viatransparent_prefixes.Verify any rewrite decision with
rtk hook check "<cmd>".Verification
chezmoi diff --source <worktree>against the live darwin config: empty (byte-identical render, apply is a no-op on this machine).chezmoi managed: Library chain managed with matching perms (no chmod churn);.config/rtkcorrectly ignored on darwin.rtk hook check: rg/grep/curl/diff + non-commit/fetch git pass through; commit/fetch/ls/gh/ps/vitest still rewrite.