[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74280":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},74280,"llm-tldr","parcadei\u002Fllm-tldr","parcadei","95% token savings. 155x faster queries. 16 languages.  LLMs can't read your entire codebase. TLDR extracts structure, traces dependencies, and gives them exactly what they need.","",null,"Python",1170,113,8,18,0,4,17,57.87,"GNU Affero General Public License v3.0",false,"main",[],"2026-06-12 04:01:14","# TLDR: Code Analysis for AI Agents\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fllm-tldr)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fllm-tldr\u002F)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fllm-tldr)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fllm-tldr\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-AGPL--3.0-blue)](LICENSE)\n\n**Give LLMs exactly the code they need. Nothing more.**\n\n```bash\n# One-liner: Install, index, search\npip install llm-tldr && tldr warm . && tldr semantic \"what you're looking for\" .\n```\n\nYour codebase is 100K lines. Claude's context window is 200K tokens. Raw code won't fit—and even if it did, the LLM would drown in irrelevant details.\n\nTLDR extracts *structure* instead of dumping *text*. The result: **95% fewer tokens** while preserving everything needed to understand and edit code correctly.\n\n```bash\npip install llm-tldr\ntldr warm .                    # Index your project\ntldr context main --project .  # Get LLM-ready summary\n```\n\n---\n\n## How It Works\n\nTLDR builds 5 analysis layers, each answering different questions:\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│ Layer 5: Program Dependence  → \"What affects line 42?\"      │\n│ Layer 4: Data Flow           → \"Where does this value go?\"  │\n│ Layer 3: Control Flow        → \"How complex is this?\"       │\n│ Layer 2: Call Graph          → \"Who calls this function?\"   │\n│ Layer 1: AST                 → \"What functions exist?\"      │\n└─────────────────────────────────────────────────────────────┘\n```\n\n**Why layers?** Different tasks need different depth:\n- Browsing code? Layer 1 (structure) is enough\n- Refactoring? Layer 2 (call graph) shows what breaks\n- Debugging null? Layer 5 (slice) shows only relevant lines\n\nThe daemon keeps indexes in memory for **100ms queries** instead of 30-second CLI spawns.\n\n### Architecture\n\n```\n┌──────────────────────────────────────────────────────────────────┐\n│                         YOUR CODE                                │\n│  src\u002F*.py, lib\u002F*.ts, pkg\u002F*.go                                    │\n└───────────────────────────┬──────────────────────────────────────┘\n                            │ tree-sitter\n                            ▼\n┌──────────────────────────────────────────────────────────────────┐\n│                     5-LAYER ANALYSIS                             │\n│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐     │\n│  │   AST   │→│  Calls  │→│   CFG   │→│   DFG   │→│   PDG   │     │\n│  │   L1    │ │   L2    │ │   L3    │ │   L4    │ │   L5    │     │\n│  └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘     │\n└───────────────────────────┬──────────────────────────────────────┘\n                            │ bge-large-en-v1.5\n                            ▼\n┌──────────────────────────────────────────────────────────────────┐\n│                    SEMANTIC INDEX                                │\n│  1024-dim embeddings in FAISS  →  \"find JWT validation\"          │\n└───────────────────────────┬──────────────────────────────────────┘\n                            │\n                            ▼\n┌──────────────────────────────────────────────────────────────────┐\n│                       DAEMON                                     │\n│  In-memory indexes  •  100ms queries  •  Auto-lifecycle          │\n└──────────────────────────────────────────────────────────────────┘\n```\n\n### The Semantic Layer: Search by Behavior\n\nThe real power comes from combining all 5 layers into **searchable embeddings**.\n\nEvery function gets indexed with:\n- Signature + docstring (L1)\n- What it calls + who calls it (L2)\n- Complexity metrics (L3)\n- Data flow patterns (L4)\n- Dependencies (L5)\n- First ~10 lines of actual code\n\nThis gets encoded into **1024-dimensional vectors** using `bge-large-en-v1.5`. The result: search by *what code does*, not just what it says.\n\n```bash\n# \"validate JWT\" finds verify_access_token() even without that exact text\ntldr semantic \"validate JWT tokens and check expiration\" .\n```\n\n**Why this works:** Traditional search finds `authentication` in variable names and comments. Semantic search understands that `verify_access_token()` *performs* JWT validation because the call graph and data flow reveal its purpose.\n\n### Setting Up Semantic Search\n\n```bash\n# Build the semantic index (one-time, ~2 min for typical project)\ntldr warm \u002Fpath\u002Fto\u002Fproject\n\n# Search by behavior\ntldr semantic \"database connection pooling\" .\n```\n\nEmbedding dependencies (`sentence-transformers`, `faiss-cpu`) are included with `pip install llm-tldr`. The index is cached in `.tldr\u002Fcache\u002Fsemantic.faiss`.\n\n### Keeping the Index Fresh\n\nThe daemon tracks dirty files and auto-rebuilds after 20 changes, but you need to notify it when files change:\n\n```bash\n# Notify daemon of a changed file\ntldr daemon notify src\u002Fauth.py --project .\n```\n\n**Integration options:**\n\n1. **Git hook** (post-commit):\n   ```bash\n   git diff --name-only HEAD~1 | xargs -I{} tldr daemon notify {} --project .\n   ```\n\n2. **Editor hook** (on save):\n   ```bash\n   tldr daemon notify \"$FILE\" --project .\n   ```\n\n3. **Manual rebuild** (when needed):\n   ```bash\n   tldr warm .  # Full rebuild\n   ```\n\nThe daemon auto-rebuilds semantic embeddings in the background once the dirty threshold (default: 20 files) is reached.\n\n---\n\n## The Workflow\n\n### Before Reading Code\n```bash\ntldr tree src\u002F                      # See file structure\ntldr structure src\u002F --lang python   # See functions\u002Fclasses\n```\n\n### Before Editing\n```bash\ntldr extract src\u002Fauth.py            # Full file analysis\ntldr context login --project .      # LLM-ready summary (95% savings)\n```\n\n### Before Refactoring\n```bash\ntldr impact login .                 # Who calls this? (reverse call graph)\ntldr change-impact                  # Which tests need to run?\n```\n\n### Debugging\n```bash\ntldr slice src\u002Fauth.py login 42     # What affects line 42?\ntldr dfg src\u002Fauth.py login          # Trace data flow\n```\n\n### Finding Code by Behavior\n```bash\ntldr semantic \"validate JWT tokens\" .   # Natural language search\n```\n\n---\n\n## Quick Setup\n\n### 1. Install\n\n```bash\npip install llm-tldr\n```\n\n### 2. Index Your Project\n\n```bash\ntldr warm \u002Fpath\u002Fto\u002Fproject\n```\n\nThis builds all analysis layers and starts the daemon. Takes 30-60 seconds for a typical project, then queries are instant.\n\n### 3. Start Using\n\n```bash\ntldr context main --project .   # Get context for a function\ntldr impact helper_func .       # See who calls it\ntldr semantic \"error handling\"  # Find by behavior\n```\n\n---\n\n## Real Example: Why This Matters\n\n**Scenario:** Debug why `user` is null on line 42.\n\n**Without TLDR:**\n1. Read the 150-line function\n2. Trace every variable manually\n3. Miss the bug because it's hidden in control flow\n\n**With TLDR:**\n```bash\ntldr slice src\u002Fauth.py login 42\n```\n\n**Output:** Only 6 lines that affect line 42:\n```python\n3:   user = db.get_user(username)\n7:   if user is None:\n12:      raise NotFound\n28:  token = create_token(user)  # ← BUG: skipped null check\n35:  session.token = token\n42:  return session\n```\n\nThe bug is obvious. Line 28 uses `user` without going through the null check path.\n\n---\n\n## Command Reference\n\n### Exploration\n| Command | What It Does |\n|---------|--------------|\n| `tldr tree [path]` | File tree |\n| `tldr structure [path] --lang \u003Clang>` | Functions, classes, methods |\n| `tldr search \u003Cpattern> [path]` | Text pattern search |\n| `tldr extract \u003Cfile>` | Full file analysis |\n\n### Analysis\n| Command | What It Does |\n|---------|--------------|\n| `tldr context \u003Cfunc> --project \u003Cpath>` | LLM-ready summary (95% savings) |\n| `tldr cfg \u003Cfile> \u003Cfunction>` | Control flow graph |\n| `tldr dfg \u003Cfile> \u003Cfunction>` | Data flow graph |\n| `tldr slice \u003Cfile> \u003Cfunc> \u003Cline>` | Program slice |\n\n### Cross-File\n| Command | What It Does |\n|---------|--------------|\n| `tldr calls [path]` | Build call graph |\n| `tldr impact \u003Cfunc> [path]` | Find all callers (reverse call graph) |\n| `tldr dead [path]` | Find unreachable code |\n| `tldr arch [path]` | Detect architecture layers |\n| `tldr imports \u003Cfile>` | Parse imports |\n| `tldr importers \u003Cmodule> [path]` | Find files that import a module |\n\n### Semantic\n| Command | What It Does |\n|---------|--------------|\n| `tldr warm \u003Cpath>` | Build all indexes (including embeddings) |\n| `tldr semantic \u003Cquery> [path]` | Natural language code search |\n\n### Diagnostics\n| Command | What It Does |\n|---------|--------------|\n| `tldr diagnostics \u003Cfile>` | Type check + lint |\n| `tldr change-impact [files]` | Find tests affected by changes |\n| `tldr doctor` | Check\u002Finstall diagnostic tools |\n\n### Daemon\n| Command | What It Does |\n|---------|--------------|\n| `tldr daemon start` | Start background daemon |\n| `tldr daemon stop` | Stop daemon |\n| `tldr daemon status` | Check status |\n\n---\n\n## Supported Languages\n\nPython, TypeScript, JavaScript, Go, Rust, Java, C, C++, Ruby, PHP, C#, Kotlin, Scala, Swift, Lua, Elixir\n\nLanguage is auto-detected or specify with `--lang`.\n\n---\n\n## MCP Integration\n\nFor AI tools (Claude Desktop, Claude Code):\n\n**Claude Desktop** - Add to `~\u002FLibrary\u002FApplication Support\u002FClaude\u002Fclaude_desktop_config.json`:\n```json\n{\n  \"mcpServers\": {\n    \"tldr\": {\n      \"command\": \"tldr-mcp\",\n      \"args\": [\"--project\", \"\u002Fpath\u002Fto\u002Fyour\u002Fproject\"]\n    }\n  }\n}\n```\n\n**Claude Code** - Add to `.claude\u002Fsettings.json`:\n```json\n{\n  \"mcpServers\": {\n    \"tldr\": {\n      \"command\": \"tldr-mcp\",\n      \"args\": [\"--project\", \".\"]\n    }\n  }\n}\n```\n\n---\n\n## Configuration\n\n### `.tldrignore` - Exclude Files\n\nTLDR respects `.tldrignore` (gitignore syntax) for all commands including `tree`, `structure`, `search`, `calls`, and semantic indexing:\n\n```bash\n# Auto-create with sensible defaults\ntldr warm .  # Creates .tldrignore if missing\n```\n\n**Default exclusions:**\n- `node_modules\u002F`, `.venv\u002F`, `__pycache__\u002F`\n- `dist\u002F`, `build\u002F`, `*.egg-info\u002F`\n- Binary files (`*.so`, `*.dll`, `*.whl`)\n- Security files (`.env`, `*.pem`, `*.key`)\n\n**Customize** by editing `.tldrignore`:\n```gitignore\n# Add your patterns\nlarge_test_fixtures\u002F\nvendor\u002F\ndata\u002F*.csv\n```\n\n**CLI Flags:**\n```bash\n# Add patterns from command line (can be repeated)\ntldr --ignore \"packages\u002Fold\u002F\" --ignore \"*.generated.ts\" tree .\n\n# Bypass all ignore patterns\ntldr --no-ignore tree .\n```\n\n### Settings - Daemon Behavior\n\nCreate `.tldr\u002Fconfig.json` for daemon settings:\n\n```json\n{\n  \"semantic\": {\n    \"enabled\": true,\n    \"auto_reindex_threshold\": 20\n  }\n}\n```\n\n| Setting | Default | Description |\n|---------|---------|-------------|\n| `enabled` | `true` | Enable semantic search |\n| `auto_reindex_threshold` | `20` | Files changed before auto-rebuild |\n\n### Monorepo Support\n\nFor monorepos, create `.claude\u002Fworkspace.json` to scope indexing:\n\n```json\n{\n  \"active_packages\": [\"packages\u002Fcore\", \"packages\u002Fapi\"],\n  \"exclude_patterns\": [\"**\u002Ffixtures\u002F**\"]\n}\n```\n\n---\n\n## Performance\n\n| Metric | Raw Code | TLDR | Improvement |\n|--------|----------|------|-------------|\n| Tokens for function context | 21,000 | 175 | **99% savings** |\n| Tokens for codebase overview | 104,000 | 12,000 | **89% savings** |\n| Query latency (daemon) | 30s | 100ms | **300x faster** |\n\n---\n\n## Deep Dive\n\nFor the full architecture explanation, benchmarks, and advanced workflows:\n\n**[Full Documentation](.\u002Fdocs\u002FTLDR.md)**\n\n---\n\n## License\n\nAGPL-3.0 - See LICENSE file.\n","TLDR 是一个用于代码分析的工具，旨在为AI代理提供精确的代码摘要。它通过构建五层分析结构（包括抽象语法树、调用图、控制流、数据流和程序依赖）来提取代码的核心结构和依赖关系，从而实现高达95%的token节省，并将查询速度提升155倍。支持16种编程语言，适用于需要高效理解和编辑大型代码库的场景，如代码浏览、重构和调试等。使用Python编写，采用AGPL-3.0许可证开放源码。",2,"2026-06-11 03:49:47","high_star"]