仓库指标
- Star
- (48,085 star)
- PR 合并指标
- (平均合并 11天 1小时) (30 天内合并 45 个 PR)
描述
Real-world numbers from rtk discover --all --since 30:
| Pattern | Calls (30d) |
|---|---|
ssh <host> '<cmd>' |
58 |
Common patterns include checking remote service status (systemctl status), tailing logs (journalctl, tail -n N), inspecting disk usage (df -h), and listing processes (ps aux). The remote command's output flows back unchanged and ends up in the LLM context — often verbose (multi-screen journalctl output, multi-line systemctl status blocks).
Two implementation directions worth considering:
- Post-receive output filtering: detect well-known remote commands by parsing
ssh ... '<cmd>'and apply the matchingrtkfilter to the output stream after it returns locally. Works without any setup on the remote. - Remote-side rtk prefix: when the remote machine is known to have
rtkinstalled, prefix the inner command withrtk(i.e. sendrtk systemctl status Xinstead ofsystemctl status X). Requires a hint mechanism (env var or config file) listing rtk-capable hosts.
Direction (1) is the lower-friction option since it works for any host. Direction (2) gives full RTK filtering quality but adds setup.
Suggested initial scope (direction 1):
For ssh <host> 'systemctl status <unit>':
- Keep
Loaded,Active,Main PID,Memory,Tasks, last 3 log lines - Drop CGroup tree, environment dump, repeated whitespace
For ssh <host> 'journalctl ...':
- Apply standard log dedup (collapse identical-with-timestamp lines)
- Truncate to last N entries by default
For other commands: pass through with a hint to use rtk on the remote where possible.
Methodology: counts come from rtk discover --all --since 30 against the local Claude Code transcript directory.