Skip to main content
rule CX Codex

tldr-cli — Claude Code rule for code analysis and setup

tldr-cli is a Claude Code rule that directs the agent to use a CLI for exploring code structure and dependencies. It applies during debugging, function searches, and change-impact checks.

MIT ★ 3,951 updated 2026-01-26

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/tldr-cli.md
Open on GitHub

What tldr-cli does

tldr-cli tells the agent how to inspect a codebase with commands such as tree, search, and context. It also covers control-flow and data-flow graphs, program slicing, and tracing callers across files.

Other commands inspect imports, detect unused code and architectural layers, and identify tests affected by changed files. Most commands return JSON; context produces text for an LLM. The tldr executable must be on PATH. Its diagnostics command runs pyright and ruff, and the listed language support covers Python, TypeScript, Go, and Rust.

What it helps with

  • locate functions and files in a project
  • trace callers and imports before refactoring
  • find unused code and circular dependencies
  • select tests affected by changed files
  • check types and lint issues before running tests

Example prompts for the agent

  • Show the project structure and find process_data under src/.
  • Trace every function that calls process_data before I change it.
  • Find tests affected by edits to src/foo.py and check the file for type errors.

How to install tldr-cli

Manually: put the files in place

.claude/rules/tldr-cli.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about tldr-cli

How do I install tldr-cli in Claude Code?

Add the rule file .claude/rules/tldr-cli.md to the project.

What does tldr-cli do?

It guides the agent through using the tldr CLI to inspect project structure, calls, imports, and the effects of code changes. The rule also covers dead-code checks and test selection.

What does tldr-cli need to work?

The tldr executable must be available on PATH. The diagnostics command uses pyright and ruff.

Source text

tldr-cli.md · MIT
# TLDR CLI - Code Analysis Tool

You have `tldr` available on PATH for token-efficient code analysis.

## Commands

```bash
# Core analysis
tldr tree [path]                    # File tree
tldr structure [path] --lang <lang> # Code structure (codemaps)
tldr search <pattern> [path]        # Search files
tldr extract <file>                 # Full file info
tldr context <entry> --project .    # LLM-ready context

# Flow analysis
tldr cfg <file> <function>          # Control flow graph
tldr dfg <file> <function>          # Data flow graph
tldr slice <file> <func> <line>     # Program slice
tldr calls [path]                   # Cross-file call graph

# Codebase analysis
tldr impact <func> [path]           # Who calls this function? (reverse call graph)
tldr dead [path]                    # Find unreachable/dead code
tldr arch [path]                    # Detect architectural layers

# Import analysis
tldr imports <file>                 # Parse imports from a file
tldr importers <module> [path]      # Find all files that import a module

# Quality & testing (NEW)
tldr diagnostics <file|path>        # Type check + lint (pyright/ruff)
tldr change-impact [files...]       # Find tests affected by changes
```

## When to Use

- **Before reading files**: Run `tldr structure .` to see what exists
- **Finding code**: Use `tldr search "pattern"` instead of grep for structured results
- **Understanding functions**: Use `tldr cfg` for complexity, `tldr dfg` for data flow
- **Debugging**: Use `tldr slice file.py func 42` to find what affects line 42
- **Context for tasks**: Use `tldr context entry_point` to get relevant code
- **Impact analysis**: Use `tldr impact func_name` before refactoring to see what would break
- **Dead code**: Use `tldr dead src/` to find unused functions for cleanup
- **Architecture**: Use `tldr arch src/` to understand layer structure
- **Import tracking**: Use `tldr imports file.py` to see what a file imports
- **Reverse imports**: Use `tldr importers module_name src/` to find who imports a module
- **Before tests**: Use `tldr diagnostics .` to catch type errors before running tests
- **Selective testing**: Use `tldr change-impact` to run only affected tests

## Languages

Supports: `python`, `typescript`, `go`, `rust`

## Example Workflow

```bash
# 1. See project structure
tldr tree src/ --ext .py

# 2. Find relevant code
tldr search "process_data" src/

# 3. Get context for a function
tldr context process_data --project src/ --depth 2

# 4. Understand control flow
tldr cfg src/processor.py process_data

# 5. Before refactoring - check impact
tldr impact process_data src/ --depth 3

# 6. Find dead code to clean up
tldr dead src/ --entry main cli
```

## Codebase Analysis Commands

### Impact Analysis
```bash
tldr impact <function> [path] --depth N --file <filter>
```
Shows reverse call graph - all functions that call the target. Useful before refactoring.

### Dead Code Detection
```bash
tldr dead [path] --entry <patterns>
```
Finds functions never called (excluding entry points like main, test_, etc.)

### Architecture Detection
```bash
tldr arch [path]
```
Analyzes call patterns to detect:
- Entry layer (controllers/handlers)
- Middle layer (services)
- Leaf layer (utilities)
- Circular dependencies

### Import Analysis
```bash
tldr imports <file> [--lang python]
```
Parses all import statements from a file. Returns JSON with module names, imported names, aliases.

### Reverse Import Lookup
```bash
tldr importers <module> [path] [--lang python]
```
Finds all files that import a given module. Complements `tldr impact` which tracks function *calls* - this tracks *imports*.

### Diagnostics (Type Check + Lint)
```bash
tldr diagnostics <file>              # Single file
tldr diagnostics . --project         # Whole project
tldr diagnostics src/ --format text  # Human-readable output
tldr diagnostics src/ --no-lint      # Type check only
```
Runs pyright (types) + ruff (lint) and returns structured errors. Use before tests to catch type errors early.

### Change Impact (Selective Testing)
```bash
tldr change-impact                   # Auto-detect (session/git)
tldr change-impact src/foo.py        # Explicit files
tldr change-impact --session         # Session-modified files
tldr change-impact --git             # Git diff files
tldr change-impact --run             # Actually run affected tests
```
Finds which tests to run based on changed code. Uses call graph + import analysis.

## Output

All commands output JSON (except `context` which outputs LLM-ready text, `diagnostics --format text` for human output).

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar IDE rules

IDE rules catalog →
tldr-prompt official github This skill turns GitHub Copilot files, MCP docs, and Copilot pages into short tldr-style references. Use it when a customization file needs a quick, actionable explanation. CX Codex +1 8,800installs create-tldr-page official github create-tldr-page builds a tldr page out of a command's docs: one-line summary, upstream link and 5–8 example invocations. CX Codex +1 8,800installs tldr pwguler tldr — a skill for Claude Code and Codex that reports completed tasks as concise outcomes instead of tool transcripts. Triggers after builds, verification runs, file changes, or catch-up queries. CX Codex +1 977installs audio-tldr AugustusW The audio-tldr Claude Code skill transcribes audio and video, then produces key points, a summary, or a translation. It runs when asked to recap a recording, pull out its main ideas, or translate it. CX Codex +1 ★ 45repo stars context-mode Mert Koseoğlu context-mode routes heavy tool outputs and web pages into an MCP sandbox so raw data does not clutter the agent context window. CX Codex +1 ★ 34,370repo stars context-mode Mert Koseoğlu This rule routes data work through context-mode MCP tools and keeps raw files out of the conversation. Use it for analysis, search, and transformations. CX Codex +1 ★ 34,370repo stars json-structured-prompting calesthio json-structured-prompting defines a JSON architecture for complex image prompts with multiple subjects, explicit positioning, and variable templates. CX Codex +1 ★ 78,316repo stars i2i-prompting calesthio i2i-prompting — a rule for writing image-to-image editing prompts with FLUX.2. Use it for targeted changes, style transfers, text edits, and staged transformations. CX Codex +1 ★ 78,316repo stars

From the same set161

The whole set →
atlas atlas executes acceptance and end-to-end test scenarios across web applications. It inspects your project framework, runs user journeys, and outputs failure artifacts. CX Codex ★ 3,951repo stars judge judge is a Claude Code subagent that reviews refactoring and code transformations, checking behavior changes, code quality, and safety risks. CX Codex ★ 3,951repo stars profiler profiler identifies bottlenecks in your code: slow functions, memory leaks, concurrency bugs. Profiles Python and Node.js, spots N+1 queries and blocking operations. CX Codex ★ 3,951repo stars dynamic-recall dynamic-recall directs Claude Code to query and store session learnings, architectural decisions, and error fixes using hybrid semantic search. CX Codex +1 ★ 3,951repo stars scout scout — a subagent for systematic codebase research. Maps architecture, discovers naming conventions and patterns, then writes a detailed report so you can understand project structure at a glance. CX Codex ★ 3,951repo stars herald Herald handles project releases by analyzing commit history, bumping version numbers in configuration files, and drafting changelogs. CX Codex ★ 3,951repo stars surveyor surveyor reviews migrations and upgrades for leftover old APIs, mixed states, dependency drift, and rollback gaps. Use it after changing a framework, library, or infrastructure. CX Codex ★ 3,951repo stars liaison liaison is a Claude Code subagent that reviews integrations and API implementations. It joins tasks focused on an external service or data exchange. CX Codex ★ 3,951repo stars

Project sponsors

Companies that keep this analytics open