{
  "markdown": "# code-parser\n\n> Index Dart, Python, and TypeScript codebases to cut LLM token consumption by **70–97%**.\n\ncode-parser extracts every class, interface, mixin, enum, and method — with exact line ranges — so Claude reads only the code that matters instead of loading entire files.\n\n## Installation\n\n```bash\ngit pull https://github.com/M97Chahboun/code-parser-plugin.git\n```\nthen \n```bash\nclaude --plugin-dir ./code-parser-plugin/\n```\n\n## Requires\n\n### Install with Cargo\n\n```bash\ncargo install code-parser\n```\n\n### Install with curl\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/m97chahboun/code-parser/master/install.sh | bash\n```\n\n### Build from source\n\n**Requirements:**\n\n- Rust 1.75+ (1.77+ recommended)\n- Cargo (bundled with Rust via rustup)\n\n```bash\ngit clone https://github.com/m97chahboun/code-parser\ncd code-parser\ncargo build --release\n# binary at: ./target/release/code-parser\n```\n\n## Commands\n\n| Command | Arguments | Purpose |\n|---|---|---|\n| `/cp-index` | `[path]` | Index a file or directory — shows all classes, methods, line ranges |\n| `/cp-find` | `<name> [path]` | Locate any class or method — returns file + exact lines |\n| `/cp-read` | `<file> <start> <end>` | Read specific lines (also accepts `ClassName` or `Class.method`) |\n| `/cp-edit` | `<file> <Class.method> <instruction>` | Surgical edit via index — reads only relevant lines |\n| `/cp-audit` | `[path]` | Full architecture report — god classes, sizes, structure overview |\n| `/cp-stats` | `[path]` | Estimated token savings for the session |\n\n## Agents\n\n| Agent | Use |\n|---|---|\n| `@code-navigator` | General codebase tasks — understands, edits, explains code efficiently |\n| `@code-reviewer` | PR and diff review — reads only changed methods, not whole files |\n\n## Skill\n\nThe bundled `code-parser` skill teaches Claude to **automatically** index before reading any `.dart`, `.py`, `.ts`, or `.tsx` file — no command needed.\n\n## How it works\n\n```\nNaive approach:    read full file  → ~15,000 tokens for a 2,000-line file\nWith code-parser:  index + targeted reads → ~700 tokens for the same task\n                                             ↑ 95% reduction\n```\n\n### Two-phase workflow\n\n**Phase 1 — Index (cheap)**  \nRun `code-parser` once. Get every class/method name and line range. ~400 tokens.\n\n**Phase 2 — Targeted reads (surgical)**  \nUse `sed -n 'start,endp' file` to fetch only the relevant method bodies. ~100–300 tokens per method.\n\n## Example session\n\n```\n> /cp-index ./lib\n  Indexed 24 files · 38 classes · 187 methods\n\n> /cp-find UserService\n  📁 lib/services/user_service.dart\n  class UserService  lines 8–47\n    fetchUser    lines 15–22\n    deleteUser   lines 24–31\n\n> /cp-read lib/services/user_service.dart 15 22\n  [shows 8 lines of code]\n  (saved ~2,600 tokens vs reading the full file)\n\n> /cp-stats\n  🎯 Estimated saving: ~94%\n```\n\n## Supported languages\n\n| Language | Extensions | Detects |\n|---|---|---|\n| Dart | `.dart` | class, abstract class, mixin, extension, enum |\n| Python | `.py` | class (all decorator types) |\n| TypeScript | `.ts`, `.tsx` | class, abstract class, interface, enum |\n\n## License\n\nMIT\n",
  "bytes": 3115,
  "sha": "cabbc8006fd6211963d81591270733dde26425c5da03512e8db4d8221af381b6",
  "repo_slug": "m97chahboun/code-parser-plugin",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_m97chahboun_code_parser_plugin_code_pars_c0c665a3/readme"
}