Skip to main content

Overview

Lists directory contents in a token-optimized format with automatic noise filtering and file statistics. Reduces output by 60-70% compared to raw ls -la.

Syntax

Arguments

string[]
Directories to list. Defaults to current directory if not specified.

Options

flag
Show hidden directories like .git and node_modules (normally filtered)
flag
Detailed listing (always enabled by RTK)
flag
Recursive listing
flag
Human-readable sizes (always enabled by RTK)

Automatic Filtering

RTK automatically excludes common noise directories unless -a is specified:
  • node_modules, .git, target
  • __pycache__, .next, dist, build
  • .cache, .turbo, .vercel
  • .pytest_cache, .mypy_cache, .tox
  • .venv, venv, coverage

Output Format

Features:
  • Directories shown with / suffix
  • Human-readable file sizes (K, M)
  • Summary line with file count by extension
  • No permissions, timestamps, or ownership clutter

Token Savings

65% reduction - removes metadata while preserving essential information

Exit Codes

  • 0 - Success
  • 1 - Directory not found or permission denied
  • rtk tree - Recursive tree view
  • rtk find - Search for files
  • rtk read - View file contents