You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: rtk wrapper for ssh remote commands #1607
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 matching rtk filter 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 rtk installed, prefix the inner command with rtk (i.e. send rtk systemctl status X instead of systemctl 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.
FYI — there is already a built-in ssh filter in the registry (rtk verify --filter ssh reports 3/3 passing on 0.37.2), but it currently does not fire on the Claude Code hook path because rtk rewrite returns exit 1 for every ssh shape. Filed as #1654 with reproduction. The FR here is real, just flagging in case fixing the existing filter wiring is cheaper than shipping a new wrapper.
Closing as a duplicate of #333, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.
Activity
pszymkowiak commentedon Apr 29, 2026
🔍 Automated Triage
featuremediumSummary
Feature request to add rtk wrapper/filter for SSH remote commands (systemctl, journalctl, etc.), partially overlaps with #2073 which already tracks ssh coverage
Triaged automatically by wshm · This is an automated analysis, not a human review.
pitimon commentedon Apr 30, 2026
FYI — there is already a built-in
sshfilter in the registry (rtk verify --filter sshreports 3/3 passing on 0.37.2), but it currently does not fire on the Claude Code hook path becausertk rewritereturns exit 1 for every ssh shape. Filed as #1654 with reproduction. The FR here is real, just flagging in case fixing the existing filter wiring is cheaper than shipping a new wrapper.KuSh commentedon Sep 5, 2026
Closing as a duplicate of #333, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.