rtk-ai/rtk

enhancement: ls filter removes file metadata (permissions, sizes, dates) needed by agents

Open

#1,162 opened on Apr 10, 2026

View on GitHub
 (1 comment) (1 reaction) (0 assignees)Rust (2,914 forks)batch import
area:clieffort-mediumenhancementfilter-qualityhelp wantedpriority:medium

Repository metrics

Stars
 (48,085 stars)
PR merge metrics
 (Avg merge 11d 1h) (45 merged PRs in 30d)

Description

Problem

`rtk ls` converts standard ls output into a compact tree view that strips file permissions, sizes, modification dates, and other metadata. AI agents often need this metadata to:

  1. Diagnose permission issues: Is the file executable? Who owns it?
  2. Identify stale files: When was this file last modified?
  3. Check file sizes: Is this a large binary or a small config?
  4. Understand symlinks: Is this a real file or a symlink?

Example

```bash $ ls -la -rw-r--r-- 1 user staff 1234 Jan 15 10:30 config.json lrwxr-xr-x 1 user staff 12 Jan 10 09:00 link -> /other/path drwxr-xr-x 8 user staff 256 Jan 14 14:22 src

$ rtk ls -la my-project/ +-- config.json +-- link +-- src/ (8 files) ```

All metadata is lost.

Proposed fix

  1. Add a --metadata or -l flag that preserves permissions, sizes, and dates in the tree output: ``` my-project/ +-- config.json (1.2K, Jan 15, -rw-r--r--) +-- link -> /other/path (Jan 10, lrwxr-xr-x) +-- src/ (8 files, 256B, Jan 14, drwxr-xr-x) ```

  2. Detect when -la or -l flags are used and include metadata automatically (the flags are passed through but the filter strips the raw output)

  3. Add an env var like `RTK_LS_METADATA=1` that agents can set to always include metadata

Relevant code

  • src/cmds/system/ls.rs: ls filtering implementation
  • src/discover/rules.rs line 92: ls rewrite rule

Contributor guide