CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Architecture
This 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:
- Clones a git repository to a temporary directory
- Runs repomix on the cloned repository to generate consolidated output
- Returns the repomix output as a single LLM fragment
- Cleans up the temporary directory
Core Components:
llm_fragments_repomix.py: Main plugin file with the fragment loader implementationpyproject.toml: Python packaging configuration with entry points for LLM
Development Commands
Build and Install:
pip install -e .
Testing:
pytest tests/ # Run all tests
pytest tests/test_fragments_repomix.py # Run specific test file
Package Building:
python -m build
Dependencies
- Runtime: LLM framework, git command, repomix command
- Development: pytest (optional)
- External: Requires
repomixto be installed globally via npm
Usage Pattern
The plugin is used with LLM's fragment system:
llm -f repomix:https://git.sr.ht/~amolith/willow "Tell me about this project"
Supports https://, ssh://, and git@ repository URLs.
Arguments
You can pass arguments to repomix using colon-separated syntax:
# Basic compression
llm -f repomix:https://git.sr.ht/~amolith/willow:compress "Tell me about this project"
# Include specific file patterns
llm -f repomix:https://git.sr.ht/~amolith/willow:include=*.py,*.md "Analyze the Python and documentation files"
# Multiple arguments
llm -f repomix:https://git.sr.ht/~amolith/willow:compress:include=*.py:ignore=tests/ "Analyze Python files but skip tests"
Supported arguments:
compress- Compress output to reduce token countinclude=pattern- Include files matching pattern (comma-separated)ignore=pattern- Ignore files matching pattern (comma-separated)style=type- Output style (xml, markdown, plain)remove-comments- Remove comments from coderemove-empty-lines- Remove empty linesoutput-show-line-numbers- Add line numbers to outputno-file-summary- Disable file summary sectionno-directory-structure- Disable directory structure section
For a complete list of supported arguments, refer to the Repomix documentation.