Eighteen AI coding agents are supported end-to-end. Each row lists the
install method, which sides of the loop trs touches (input / output),
how trs stats --by-agent labels runs from that agent, and the
install scope.
| Agent | Install method | Input hook (rewrite) | Output-saver | Attribution label | Scope |
|---|---|---|---|---|---|
| Claude Code | programmatic hook | ✓ | ✓ (@import) |
claude |
global + project |
| Gemini CLI | programmatic hook | ✓ | ✓ (@import) |
gemini |
global + project |
| Cursor | programmatic hook | ✓ | ✓ (local plugin) | cursor |
global + project |
| OpenCode | plugin template | ✓ | ✓ (inline block) | opencode |
global |
| Kilo Code | plugin template | ✓ | ✓ (inline block) | kilo |
global |
| Pi Coding Agent | programmatic hook (extension) | ✓ | — | pi |
global + project |
| Factory Droid | programmatic hook | ✓ | ✓ (inline block) | droid |
global + project |
| Antigravity IDE | rules file only (see research notes) | — | ✓ (@import) |
antigravity (env fallback) |
global |
Antigravity CLI (agy) |
rules file only (see research notes) | — | ✓ (@import) |
antigravity (env fallback) |
global |
| Codex CLI | programmatic hook (codex-cli ≥ 0.134), rules fallback | ✓ (≥ 0.134) | ✓ (inline block) | codex (fallback (untagged)) |
global + project |
| Devin Desktop | rules file only | — | ✓ (inline block) | (untagged) |
global + project |
| Devin CLI | programmatic hook | ✓ | — | devin-cli |
global + project |
| VS Code Copilot / Copilot CLI | programmatic hook | ✓ | ✓ | vscode / copilot-cli |
global + project |
| OpenClaw | plugin template | ✓ | ✓ (unverified) | openclaw |
global |
| Hermes | plugin template | ✓ | — | hermes |
global |
| Trae | programmatic hook (unverified) | ✓ | — | trae |
global + project |
| Mistral Vibe | programmatic hook (unverified) | ✓ | — | vibe |
global |
| Zed (Agent Panel) | rules file only (AGENTS.md) | — | — | (untagged); ACP external agents show their own label |
project |
trs init can install a hook that
rewrites the agent’s outbound commands (git status → trs git
status). Rules-only agents cannot do this; the model ends up
running raw commands unless the user prefixes trs manually.trs output-saver --install can inject
the rules block (Pi and Hermes are not yet wired). Antigravity 2.0 (IDE + CLI)
shares Gemini’s
~/.gemini/GEMINI.md and ~/.gemini/trs.md for the output-saver
side; only the hooks are jetski-specific (see Antigravity section
below).trs stats --by-agent shows for runs
triggered by this agent. (untagged) means trs has no
programmatic signal to identify the agent, rules-only agents fall
here, as do direct shell invocations.~/.claude/,
etc.) or only per-project (./AGENTS.md, etc.). Project-only means
every repo needs its own trs init inside it.hook_event_name: PreToolUse envelope over
stdin; trs replies with a modified command field.~/.claude/settings.json (global) or
.claude/settings.json (project).~/.claude/trs-output-saver.md
with an @import line added to CLAUDE.md.trs init claude --global.hook_event_name: BeforeTool; same response
shape as Claude.~/.gemini/settings.json.@import, mirroring Claude.hook_event_name: preToolUse (camelCase vs
Claude’s PascalCase).~/.cursor/hooks.json.~/.cursor/plugins/local/trs/ with
one rule (alwaysApply: true). Cursor does not read ~/.cursor/rules
(a known gap on their side), and a rule without frontmatter is not
guaranteed to load. Run Developer: Reload Window (or restart Cursor)
once after installing, and check Customize → Rules. On Teams and
Enterprise an admin can turn off local plugins (Allow Local Plugin
Imports); then use Settings → Rules → User Rules instead. Installing
also removes the file older trs versions wrote to ~/.cursor/rules/,
only when it is trs’s own.preToolUse: it’s the only Cursor hook that can rewrite the
command (via the updated_input field); beforeShellExecution can
only allow/deny, not modify.trs rewrite with the command before exec.spawnHook that rewrites the command and sets env before exec,
same tier as Claude/Cursor/OpenCode/Kilo, not rules-only.~/.pi/agent/extensions/trs.ts (global) or
.pi/extensions/trs.ts (project).pi: the extension’s env carries TRS_AGENT=pi.trs init pi (aliases: pi, pi.dev,
pidev). Upstream: pi.dev (repo earendil-works/pi).hook_event_name: PreToolUse
wire format verbatim; the hook command carries --caller droid so
runs show up as droid in trs stats --by-agent. Installs from
before v0.6.16 shared Claude’s label, re-run trs init droid to
pick up the labeled hook.agy)docs/development/antigravity-hooks-research.md.agy 1.0.1 (not a trs version) showed that user-defined
entries in ~/.gemini/antigravity-{cli,ide}/hooks.json load as
subagents (the name+description fields are required by
JSONHookSpec with jsonschema_description “Used to invoke it via
invoke_subagent”). Bash invocations go through
*gemini_coder_go_proto.Step_RunCommand, which bypasses the
user-visible PreToolHook pipeline. Five different hook schemas were
tested with side-channel probes, none fired.trs init antigravity (or agy /
antigravity-cli) appends a sentinel-wrapped rules block to
~/.gemini/GEMINI.md. Both IDE and CLI read that file at session
start. The block tells the agent to prefix shell commands with
trs when token-optimized output is desired.~/.gemini/trs.md + the @trs.md
import in ~/.gemini/GEMINI.md keeps the rules block active for both Antigravity surfaces. This part of the
integration does work because it’s LLM-side (prompt context),
not runtime hooks.trs init antigravity → IDE (back-compat).
trs init antigravity-cli or trs init agy → CLI. trs init --show
lists both rows separately so you can see what’s detected.(untagged) in trs stats --by-agent. We have no
programmatic signal (no hook ever fires for Antigravity-launched
commands). Same posture as Codex/Devin Desktop. When the user prefixes
trs git status manually, those runs also land in (untagged).trs init and trs uninstall both sweep the
inert artifacts from previous releases:
hooks.json at ~/.gemini/antigravity-{cli,ide}/hooks.json
(jetski PreToolUse, never actually fired)~/.gemini/settings.json (aliased to
Gemini’s harness, also never fired).agent/rules/antigravity-trs-rules.md per-project
rules filefix/antigravity-rules-only-revert, see
the research doc.hookSpecificOutput.updatedInput.command in its
PreToolUse hook), trs init codex --global merges a real
PreToolUse hook (matcher "Bash", command
trs rewrite --caller codex) into ~/.codex/hooks.json, preserving
the user’s other hooks. Approve it once via Codex’s /hooks prompt
and commands rewrite automatically. On older builds (or an untrusted
hook) it falls back to a rules block in ~/.codex/AGENTS.md
recommending manual trs <cmd> prefixes.codex exec (non-interactive) doesn’t dispatch
PreToolUse; the hook fires in interactive sessions only.codex when the hook is active (the hook command
carries TRS_AGENT=codex); the rules-only fallback shows as
(untagged).trs init appends a rules block
recommending manual trs <cmd> prefixes; the agent reads the rules
at session start but there’s no enforcement..devin/rules/trs.md (a directory-rule file with
YAML frontmatter trigger: always_on) when Devin Desktop is
detected; legacy .windsurfrules (plain file, no frontmatter)
otherwise. Devin reads both, so trs writes only one to avoid
double-loading; uninstall removes both.devin; aliases devin-desktop, windsurf,
cascade (the last two for back-compat).(untagged) in stats since there’s no programmatic
signal to tag commands with an agent.devin, by
Cognition), a distinct product from Devin Desktop. Unlike the
Desktop rules-only integration, the CLI exposes real programmatic
PreToolUse hooks, so trs wires a deterministic rewrite hook here.trs init devin-cli --global merges a hook
into ~/.config/devin/config.json under the hooks key, preserving
the user’s existing config (model, org_id, theme). Devin’s shell tool
is named exec (not Bash), so the hook matcher is exec and the
hook command is trs rewrite --caller devin-cli.~/.config/devin/config.json (global) or
.devin/config.json (project).devin-cli; aliases devin-terminal, dcli.devin-cli: the hook command carries
--caller devin-cli.hookSpecificOutput.updatedInput; commands execute rewritten as
trs …. (Devin’s docs only document decision + additionalContext,
but the rewrite works in practice.)--caller devin-cli only tags correctly when
devin-cli is a row in AGENTS (rewrite_gate.rs);
otherwise it silently falls back to claude. Regression-guarded by a
test in rewrite.rs..claude interplay: Devin reads .claude/settings.json hooks by
default (read_config_from.claude: true). With trs init claude
present, that transitive Claude hook fires and tags runs claude, the
same de-facto-coverage pattern as VS Code. Set
read_config_from.claude: false in ~/.config/devin/config.json so the
dedicated devin-cli hook wins and attribution is correct.PreToolUse envelope,
including the hookSpecificOutput.updatedInput rewrite that trs
relies on. Validated live 2026-06-09.trs init vscode writes .github/hooks/trs.json
(project) or ~/.copilot/hooks/trs.json (--global). The hook
command is trs rewrite --caller vscode.~/.claude/settings.json
hooks, users with trs init claude --global get de-facto coverage
that way, but runs are attributed as claude. The dedicated
trs init vscode gives correct vscode attribution and works
without Claude Code installed. If both surfaces fire, the
double-fire is harmless, trs rewrite is idempotent.command field, and unknown event names fail open.--caller flag requires trs ≥ 0.6.16, an older binary exits
with a clap usage error and every shell run gets blocked. Relevant
when .github/hooks/trs.json is committed to a shared repo:
teammates need trs ≥ 0.6.16, or the hook should use plain
trs rewrite until everyone upgrades.~/.copilot/instructions/trs.instructions.md, a
file trs owns (nothing is spliced into your own instructions), with
applyTo: "**": without it VS Code applies the file only when
attached by hand. Copilot CLI reads the same file.vscode (primary), vs-code, copilot,
vscode-copilot, code, copilot-cli, gh-copilot.~/.copilot/hooks/trs.json, receives the VS Code-compatible
PreToolUse payload (tool_name: "Bash"), and applies trs’s
updatedInput rewrite.trs init copilot-cli --global (same file as
trs init vscode --global). Repository hooks in .github/hooks/
load only in folders Copilot CLI trusts.COPILOT_CLI=1 in the hook’s
environment, so its runs show as copilot-cli in
trs stats --by-agent, not vscode.COPILOT_HOME: when set, Copilot CLI reads hooks from
$COPILOT_HOME/hooks/, not ~/.copilot/hooks/. Install the hook
there.~/.copilot/instructions/trs.instructions.md
as VS Code (or $COPILOT_HOME/instructions/). Validated live: Copilot
CLI applied a user-level *.instructions.md even in a session that
touched no file.preToolUse command hook that errors denies the
tool call. trs init embeds the absolute trs path in the hook
command when it was installed from a stable location (~/.cargo/bin,
~/.local/bin, Homebrew, /usr/local/bin, npm node_modules), so the
hook still fires when the agent’s PATH lacks trs; unusual install
locations keep the bare trs name and need it on PATH.Checking it: trs doctor warns when a hook is installed but no
run has come through one. To see whether Copilot CLI loads the hook:
copilot -p "Run: git status" --allow-tool 'shell(git status)' \
--log-level debug --log-dir /tmp/cplog
grep -i hook /tmp/cplog/*.log # look for "trs auto-rewrite"
Both follow each agent’s published hook contract and are tested against its payload shape, but not on real binaries, so treat them as unverified.
Risk: the hook rewrites the command and leaves approval to the agent. If the agent matches its deny rules against the rewritten command, a deny rule on the original won’t fire. That is what happened on Grok Build, which is why trs never rewrites there. Check your deny rules before relying on them with these two.
PreToolUse on RunCommand in .trae/hooks.json. The hook rewrites
the command, keeps description and timeout, and never sends a decision.pre_tool entry in ~/.vibe/hooks.toml, global only.
strict = false, so a trs failure can’t stop the bash tool.Output-saver only, with no trs init entry.
trs output-saver grok --install writes ~/.grok/AGENTS.md
(or $GROK_HOME/AGENTS.md), confirmed on 1.0.70. Grok also runs Claude Code’s
hooks by default; the trs hook detects it and leaves its commands alone, so
Grok’s deny rules keep working. Why.trs output-saver kiro --install writes
~/.kiro/steering/trs.md. Unverified on a real binary.git status, then check trs stats --by-agent.~/.openclaw/plugins/trs/
(openclaw.plugin.json manifest + index.js). The plugin’s
before_tool_call hook prepends trs to exec commands
(idempotent), and resolve_exec_env injects TRS_AGENT=openclaw
into the exec environment, cross-platform attribution, no shell
prefix.trs init openclaw also merges
plugins.entries.trs.enabled = true and the plugin dir into
plugins.load.paths in ~/.openclaw/openclaw.json (everything
else preserved; idempotent).openclaw gateway restart.plugins.entries.trs config entry can be removed manually.openclaw (primary), claw.git status, then check trs stats --by-agent.~/.hermes/plugins/trs-rewrite/ (__init__.py + plugin.yaml
manifest) for NousResearch’s hermes-agent. The pre_tool_call
hook prepends trs to terminal tool commands (idempotent,
fails open) and exports TRS_AGENT=hermes for attribution.trs init hermes adds trs-rewrite to
plugins.enabled in ~/.hermes/config.yaml. The YAML patch is
conservative, block-style lists are patched in place; exotic
layouts (inline arrays, plugins without enabled) get a manual
instruction instead.HERMES_HOME env var relocates the Hermes
home dir (default ~/.hermes) for both install and uninstall.trs-rewrite entry
in plugins.enabled can be removed manually.hermes (primary), hermes-agent.AGENTS.md as always-on instructions, so trs init zed writes the
same trs sentinel block Codex uses (shared template, shared
sentinel scrub on uninstall). Project scope only, --global
prints a note and writes nothing (Zed’s global personal-instructions
location is not yet verified).trs stats --by-agent attributes runs to the backend agent
(claude, codex, gemini, opencode), not to Zed.docs/roadmap/TASK_TODO.md.zed (primary), zed-ide.trs init --show # who has what installed
trs init --all --global # install for every detected agent
trs init claude --global # single agent
trs init claude --global --replace # migrate from rtk / token-optimizer
trs output-saver --install # output-saver block on every detected agent
trs output-saver --remove # clean uninstall
Before any write, trs init runs a pre-install collision check:
it scans the target config (following @imports for Claude/Gemini)
for existing competing compressor hooks and aborts by default.
--replace scrubs the previous compressor’s hook cleanly before
installing trs; --force installs alongside (risky,
double-compression).
See also:
docs/features/init.md, trs init
reference (flags, hooks, merge behavior).docs/features/output-saver.md,
trs output-saver reference (sentinels, idempotence, check-first).docs/development/agent-integrations.md:
internals: per-agent file layout, merge paths, known quirks.docs/support/other-token-savers.md:
alternatives trs coexists with.