Skip to content

rtk ls -1 path/ Always Return (empty) #2058

Closed

Description

@anggaaryas

My AI agent confused because when calling rtk ls -1 path/ it always show (empty). It should show list of files

Activity

  1. changed the title [-]`rtk ls -1 path/` Return `(empty)`[/-] [+]`rtk ls -1 path/` Always Return `(empty)`[/+] on May 23, 2026
  2. pszymkowiak commented on May 27, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 91%

    Summary

    The rtk ls -1 flag is broken — always returns empty output instead of listing files; PR #2061 is already open to fix it.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. CHHC-L commented on Jun 30, 2026

    @CHHC-L

    seems that we have fix pr #2061 but no one approves it ;(

  4. tatsuki-washimi commented on Jul 7, 2026

    @tatsuki-washimi

    rtk 0.37.2でも同様の事象を確認しました(ai-harnessリポジトリルートで検証):

    $ rtk ls docs
    (empty)
    

    実際には docs/ 以下に6ファイルが存在します(rtk proxy ls docs で確認済み)。

    回避策として、ls/find を hook の書き換え対象から除外しています([hooks] exclude_commands)。同じ事象は #2271 でも報告されているようです。

  5. kento-miyazaki commented on Jul 13, 2026

    @kento-miyazaki

    Reproduced on macOS (Darwin 25.5.0) with rtk 0.38.0 — adding diagnostics since the original report is sparse.

    Symptom: rtk ls <dir> always prints the literal placeholder (empty) (8 bytes, exit 0) regardless of directory contents. Not specific to -1; also reproduces with no flags, -la, and --ultra-compact.

    Diagnostics:

    • rtk ls -vvv <dir> shows the filter receiving full native output and dropping everything: Chars: 1003 → 8 (100% reduction) followed by (empty).
    • rtk proxy ls <dir> (unfiltered) returns the correct 12 entries, matching /bin/ls.
    • Other filters are fine (rtk find works), so this is isolated to the ls output filter.
    • rtk gain --history shows many ls ... -100% entries, i.e. the filter has been silently discarding all entries for a while.

    Impact: when used via the Claude Code hook (ls auto-rewritten to rtk ls), agents see existing directories as empty and misdiagnose.

    Workaround: add ls to [hooks] exclude_commands in config.toml (confirmed working), or use rtk proxy ls.

    Suspected BSD ls output parsing (multi-column format on macOS), but the binary is closed so I couldn't confirm. Happy to run more diagnostics if useful.

  6. KuSh commented on Sep 5, 2026

    @KuSh
    Collaborator

    This was fixed in v0.39.0: rtk ls no longer parses the localized/unrecognized listing into nothing, and falls back to raw output when it cannot parse. Running rtk ls -1 <dir>, rtk ls <dir> and rtk ls -la <dir> on the current build lists the real entries instead of (empty). Please reopen or comment if you still see it on the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions