CLAUDE.md

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:

  1. Clones a git repository to a temporary directory
  2. Runs repomix on the cloned repository to generate consolidated output
  3. Returns the repomix output as a single LLM fragment
  4. Cleans up the temporary directory

Core Components:

  • llm_fragments_repomix.py: Main plugin file with the fragment loader implementation
  • pyproject.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 repomix to 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 count
  • include=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 code
  • remove-empty-lines - Remove empty lines
  • output-show-line-numbers - Add line numbers to output
  • no-file-summary - Disable file summary section
  • no-directory-structure - Disable directory structure section

For a complete list of supported arguments, refer to the Repomix documentation.