dotfiles / rtk
AGENTS.md16 starsChanged 48 days agoMITView on GitHub
- config.toml and filters.toml are linked into ~/Library/Application Support/rtk/. Everything else there (history.db, tee/, trusted_filters.json) is machine state and stays untracked. - Wiring: the Claude Code PreToolUse hook rtk hook claude (claude-code/settings.json) rewrites Bash commands (git status → rtk git status), also an inner built-in inside a wrapper (uv run pytest → uv run rtk pytest), in the main session and in subagents. What the agent is told about it is claude-code/RTK.md. - Transcripts log the command before the rewrite.…
In this repository50 other files it gives its agents.
- ableton/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- aichat/AGENTS.mdAGENTS.md
- aider/AGENTS.mdAGENTS.md
- annepro2/AGENTS.mdAGENTS.md
- applesauce/AGENTS.mdAGENTS.md
- atuin/AGENTS.mdAGENTS.md
- btop/AGENTS.mdAGENTS.md
- chromium-vimium-extension/AGENTS.mdAGENTS.md
- claude-code/AGENTS.mdAGENTS.md
- codex/AGENTS.mdAGENTS.md
- constants/AGENTS.mdAGENTS.md
- contextMenu/AGENTS.mdAGENTS.md
- cron/AGENTS.mdAGENTS.md
- docker/AGENTS.mdAGENTS.md
- docker-logger/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- dotfiles_tests/AGENTS.mdAGENTS.md
- eza/AGENTS.mdAGENTS.md
- firefox-vimium-addon/AGENTS.mdAGENTS.md
- fork/AGENTS.mdAGENTS.md
- git/AGENTS.mdAGENTS.md
- hammerspoon/AGENTS.mdAGENTS.md
- heroic/AGENTS.mdAGENTS.md
- homebrew/AGENTS.mdAGENTS.md
- iina/AGENTS.mdAGENTS.md
- install/AGENTS.mdAGENTS.md
- iterm/AGENTS.mdAGENTS.md
- jetbrains rider/AGENTS.mdAGENTS.md
- karabiner/AGENTS.mdAGENTS.md
- lazydocker/AGENTS.mdAGENTS.md
- lazygit/AGENTS.mdAGENTS.md
- macos/AGENTS.mdAGENTS.md
- macos_cleanup/AGENTS.mdAGENTS.md
- macos_shortcuts/AGENTS.mdAGENTS.md
- macos_update/AGENTS.mdAGENTS.md
- marta/AGENTS.mdAGENTS.md
- noti/AGENTS.mdAGENTS.md
- npm/AGENTS.mdAGENTS.md
- opencode/AGENTS.mdAGENTS.md
- python/AGENTS.mdAGENTS.md
- qdrant/AGENTS.mdAGENTS.md
- tmux/AGENTS.mdAGENTS.md
- uv/AGENTS.mdAGENTS.md
- voiceink/AGENTS.mdAGENTS.md
- vscode/AGENTS.mdAGENTS.md
- xcode/AGENTS.mdAGENTS.md
- zap/AGENTS.mdAGENTS.md
- zsh/AGENTS.mdAGENTS.md
- claude-code/CLAUDE.mdCLAUDE.md
The file
Files
rtk — Rust Token Killer config
config.tomlandfilters.tomlare linked into~/Library/Application Support/rtk/. Everything else there (history.db,tee/,trusted_filters.json) is machine state and stays untracked.- Wiring: the Claude Code PreToolUse hook
rtk hook claude(claude-code/settings.json) rewrites Bash commands (git status→rtk git status), also an inner built-in inside a wrapper (uv run pytest→uv run rtk pytest), in the main session and in subagents. What the agent is told about it isclaude-code/RTK.md. - Transcripts log the command before the rewrite. Counting
rtkprefixes in them undercounts coverage, and the "missed savings" table ofrtk discoverlists commands the hook already handles; its TOP UNHANDLED section is the honest half. Measure withhistory.db, confirm one command withrtk hook check "<cmd>".
A filter in filters.toml does not make the hook rewrite a command
The hook rewrites only its ~50 built-in tools (rtk --help) and never consults
filters.toml; the only knob is [hooks] exclude_commands. A filter for any other command
is inert: rtk hook check "<cmd>" answers No rewrite for: …. That is why the python3,
hs, launchctl and git ls-files filters were deleted (2026-08-09, re-checked on 0.45.0)
and only docker-compose is left — docker is a built-in, so the filter augments it.
To cover more, the command has to be a built-in or wrap one. uv run script.py and ssh
stay raw, and nothing local changes that.
Trust
rtk gain prints N untrusted custom filter(s) not applied until rtk trust --yes. Trust
is the path plus the sha256 of filters.toml, so every edit revokes it. up re-trusts from
$HOME, where no project-local .rtk/filters.toml exists, so it can only trust this file.
Filters are declarative (strip, keep, truncate lines) and run no code: the prompt guards
against a project hiding errors from the agent.
After an upgrade
rtk verify — hook integrity and the bundled filters' self-tests.
Never rtk learn --write-rules
rtk learn pairs a failed command with the next successful one sharing its first two words.
Agent commands start with cd <dir> && …, so two unrelated commands in one project become a
"correction": 374 of 547 pairs on 2026-10-02 (rtk 0.50.0) were keyed on cd.
--write-rules writes them to ~/.claude/rules/, which Claude Code loads into every session
as instructions. up no longer runs it.
codex-hook.sh
Codex speaks Claude Code's hook protocol, but needs hookSpecificOutput.permissionDecision
in the reply, which rtk does not write; the shim adds it. Wired in ~/.codex/hooks.json.
Verified on codex-cli 0.149.0 (2026-08-24).
- An untrusted hook is skipped silently, which looks exactly like a broken shim. Re-run
with
--dangerously-bypass-hook-trust: if the rewrite appears, only trust is missing. - Trust is written by the interactive TUI prompt alone (it is not a hash of
hooks.jsonor of the script), so it takes one interactivecodexrun in a real terminal. - That flag must not go into the Telegram bot's codex argv.
~/.codex/is writable by every agent the bot spawns, so one topic could plant ahooks.jsonwhose command then runs in every other topic's session.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

