`rtk ls -1` returns empty output
I let Claude explain itself what went wrong...
Bug
rtk ls -1 <directory> returns empty output even when the directory contains files.
Reproduction
# Standard ls works
ls -1 .concept/plan/
# Shows 11 files
# RTK ls without flags works
rtk ls .concept/plan/
# Shows 11 files with sizes
# RTK ls -1 fails
rtk ls -1 .concept/plan/
# Returns empty
Expected
rtk ls -1 should return one filename per line, same as ls -1.
Impact
When Claude Code hooks rewrite ls -1 โ rtk ls -1, the command silently returns no output, causing Claude to incorrectly report directories as empty.
hey @NickSdot I experiment the issue myself too, it looks like plenty of flags break the internal format for the compact_ls parser. I am creating a PR to address this now.
[w] wshm ยท Automated triage by AI
๐ Automated Triage
| ๐ Category | bug |
| ๐ Priority | high |
| ๐ฏ Confidence | 95% |
Summary
The -1 flag causes rtk ls to return empty output instead of one-filename-per-line; a fix PR (#962) is already in progress.
This looks like a simple fix. Only repo maintainers can trigger auto-fix.
Triaged automatically by wshm ยท This is an automated analysis, not a human review.
Hasn't this been fixed yet? Running the rtk ls command also returns empty output
same for me. this skill is basically unusable without fixing this bug
Should be resolved in https://github.com/rtk-ai/rtk/pull/1692 aka 0.39.0
Confermo bug presente in rtk 0.35.0 (macOS arm64, Homebrew). Use case aggiuntivo: il bug si manifesta in chain di comandi quando il PreToolUse Claude Code hook riscrive entrambi.
# Repro minimale (in Claude Code, hook attivo):
ls -1 /some/dir; echo MID; ls -1 /another/dir
Il rewrite produce rtk ls -1 X; echo MID; rtk ls -1 Y, e entrambi gli rtk ls -1 ritornano (empty) (esadecimale 28656d707479290a). Effetto pratico: false positive di 'directory vuota' che fa skippare logica anti-doppione (caso reale: orchestratore daily-check che ha mancato di rilevare il report del giorno).
Workaround per ora: exclude_commands = ["ls"] in ~/Library/Application Support/rtk/config.toml.
Resto in attesa della release del fix. Thanks.
Fix shipped in v0.39.0 via #1692 (per @aeppling's note above). Closing as resolved.
If anyone still hits rtk ls -1 returning empty output on v0.39.0 or newer, please reopen with:
rtk --version- OS / shell
- exact command (including any hook rewrite if running inside Claude Code)
Thanks @msegoviadev for the PR, and @KingingWang / @sizhky / @francescotinti for the repros.