Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .chezmoiignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ iterm2-preferences
# (.chezmoiignore is itself templated; stat is re-evaluated every apply, so this
# self-corrects after `brew bundle` installs the app, or if it's removed).
{{ if or (ne .chezmoi.os "darwin") (not (stat "/Applications/Sublime Text.app")) }}bin/subl{{ end }}

# rtk config: one shared template, two OS-specific targets. rtk hard-wires
# ~/Library/Application Support on darwin (ignores XDG) and ~/.config elsewhere.
{{ if ne .chezmoi.os "darwin" }}Library{{ else }}.config/rtk{{ end }}
87 changes: 87 additions & 0 deletions .chezmoitemplates/rtk-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[tracking]
enabled = true
history_days = 90

[display]
colors = true
emoji = true
max_width = 120

[filters]
ignore_dirs = [
".git",
"node_modules",
"target",
"__pycache__",
".venv",
"vendor",
]
ignore_files = [
"*.lock",
"*.min.js",
"*.min.css",
]

[tee]
enabled = true
mode = "failures"
max_files = 20
max_file_size = 1048576

[telemetry]
enabled = false
consent_given = false
consent_date = "2026-06-21T06:05:58.603291+00:00"

[hooks]
exclude_commands = [
"rg", # rtk grep backend is BSD grep on macOS; rg flags break silently (exit 0)
"grep", # 254/287 parse failures; 6.1K lifetime savings vs silent zero-match risk
"curl", # 2 tokens saved on 138K input; schema-compaction risks mangling API responses
"diff", # 28 parse failures vs 8 filtered runs; condensing strips hunk context
]
# git restricted to commit/fetch: compact filters strip output the model needs (e.g. stash SHA)
transparent_prefixes = [
"git stash",
"git status",
"git log",
"git diff",
"git add",
"git push",
"git pull",
"git branch",
"git show",
"git worktree",
"git checkout",
"git switch",
"git restore",
"git reset",
"git merge",
"git rebase",
"git remote",
"git rev-parse",
"git tag",
"git blame",
"git ls-files",
"git ls-remote",
"git reflog",
"git cherry-pick",
"git describe",
"git config",
"git check-attr",
"git submodule",
"git clean",
"git rm",
"git mv",
"git init",
"git clone",
"git apply",
"git bisect",
]

[limits]
grep_max_results = 200
grep_max_per_file = 25
status_max_files = 15
status_max_untracked = 10
passthrough_max_chars = 2000
23 changes: 23 additions & 0 deletions 2026_REFRESH.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Old bash-specific files removed (git history preserved).
| ripgrep (rg) | Better grep |
| fzf | Fuzzy finder |
| git-delta | Better git diff |
| rtk | Token-optimizing CLI proxy for Claude Code (one-time `rtk init -g`, see below) |

### Brewfile Pared Down

Expand Down Expand Up @@ -114,6 +115,28 @@ cd ~/.dotfiles
exec zsh
```

### Post-install: wire rtk into Claude Code (one-time, per machine)

`rtk` (the token-optimizing Claude Code proxy) installs fleet-wide via the mise
baseline, but its Claude integration writes to `~/.claude/` — which chezmoi does
not manage — so it needs a single manual step after install:

```bash
rtk init -g # hook + RTK.md + @RTK.md in ~/.claude/CLAUDE.md + settings.json
rtk init --show # verify: all rows [ok]
```

Idempotent — safe to re-run. Skips automation in the dotfiles repo on purpose so
chezmoi never fights rtk over `~/.claude/CLAUDE.md` and `settings.json`.

rtk's own config *is* chezmoi-managed (`.chezmoitemplates/rtk-config.toml`, one
template → `~/.config/rtk/` on linux, `~/Library/Application Support/rtk/` on
darwin). It dials the hook back to where filtering measurably pays off: `rg`,
`grep`, `curl`, `diff` excluded (silent-failure risk or ~zero savings) and git
restricted to `commit`/`fetch` via `transparent_prefixes` (compact filters
stripped output the model needed, e.g. `git stash` SHAs). Verify a rewrite
decision anytime with `rtk hook check "<cmd>"`.

## Verification

```bash
Expand Down
1 change: 1 addition & 0 deletions dot_config/mise/conf.d/fresh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ starship = "latest"
# AI coding agents
codex = "latest" # openai/codex
opencode = "latest" # anomalyco/opencode
rtk = "latest" # aqua:rtk-ai/rtk — token-optimizing CLI proxy for Claude Code.

# Dotfiles management — must be in the committed baseline so a fresh machine's
# install.sh (mise install -> chezmoi init) can bootstrap. (Previously chezmoi
Expand Down
1 change: 1 addition & 0 deletions dot_config/rtk/config.toml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- template "rtk-config.toml" . -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- template "rtk-config.toml" . -}}