1# CLAUDE.md
2
3This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
5## Architecture
6
7This is a Python plugin for the LLM CLI tool that adds a fragment loader for repository contents using Repomix. The plugin registers a single fragment loader that:
8
91. Clones a git repository to a temporary directory
102. Runs repomix on the cloned repository to generate consolidated output
113. Returns the repomix output as a single LLM fragment
124. Cleans up the temporary directory
13
14**Core Components:**
15- `llm_fragments_repomix.py`: Main plugin file with the fragment loader implementation
16- `pyproject.toml`: Python packaging configuration with entry points for LLM
17
18## Development Commands
19
20**Build and Install:**
21```bash
22pip install -e .
23```
24
25**Testing:**
26```bash
27pytest tests/ # Run all tests
28pytest tests/test_fragments_repomix.py # Run specific test file
29```
30
31**Package Building:**
32```bash
33python -m build
34```
35
36## Dependencies
37
38- **Runtime:** LLM framework, git command, repomix command
39- **Development:** pytest (optional)
40- **External:** Requires `repomix` to be installed globally via npm
41
42## Usage Pattern
43
44The plugin is used with LLM's fragment system:
45```bash
46llm -f repomix:https://git.sr.ht/~amolith/willow "Tell me about this project"
47```
48
49Supports https://, ssh://, and git@ repository URLs.
50
51### Arguments
52
53You can pass arguments to repomix using colon-separated syntax:
54
55```bash
56# Basic compression
57llm -f repomix:https://git.sr.ht/~amolith/willow:compress "Tell me about this project"
58
59# Include specific file patterns
60llm -f repomix:https://git.sr.ht/~amolith/willow:include=*.py,*.md "Analyze the Python and documentation files"
61
62# Multiple arguments
63llm -f repomix:https://git.sr.ht/~amolith/willow:compress:include=*.py:ignore=tests/ "Analyze Python files but skip tests"
64```
65
66Supported arguments:
67- `compress` - Compress output to reduce token count
68- `include=pattern` - Include files matching pattern (comma-separated)
69- `ignore=pattern` - Ignore files matching pattern (comma-separated)
70- `style=type` - Output style (xml, markdown, plain)
71- `remove-comments` - Remove comments from code
72- `remove-empty-lines` - Remove empty lines
73- `output-show-line-numbers` - Add line numbers to output
74- `no-file-summary` - Disable file summary section
75- `no-directory-structure` - Disable directory structure section
76
77For a complete list of supported arguments, refer to the [Repomix documentation](https://github.com/yamadashy/repomix).