Repolode
cyberchitta

cyberchitta/llm-context.py

A Python CLI and MCP server that lets coding agents and chats pull the right code context via reusable, rule-based file selection.

Stars
308
Forks
26
Open issues
5
Last commit
19 days ago

What is it?

llm-context.py is a tool for getting the right source files into an LLM's context. Instead of copying files by hand or sending an entire repository, you describe the selection as a rule: a YAML file with optional markdown guidance that lists full files and supporting files to excerpt. The tool then packs the matching code into a single context, with a file listing that marks what is and isn't included.

Rules are composable and named by category, so you can switch between tasks such as code review or documentation by changing rules rather than file lists. Files you plan to edit are included in full, while supporting code is reduced to signatures and definitions through code outlining. A timestamp in each pack lets the tools report which files are missing or have changed since it was generated.

The context can be delivered three ways: printed to stdout for piping into a sub-agent such as claude -p, copied to the clipboard for pasting into a chat, or served over the Model Context Protocol so a model can request files itself. Running lc-init installs a skill into the project that teaches a coding agent to write and verify these rules.

Key features

  • 01Selects files through reusable YAML rules that can be composed and switched per task.
  • 02Includes full contents for files you edit and code outlines for supporting files.
  • 03Previews what a rule selects, including symbols used but not included.
  • 04Outputs to stdout for piping, the clipboard, or an MCP server.
  • 05Provides MCP tools for requesting missing or changed files during a session.
  • 06Installs an agent skill that writes and checks rules for the project.

Use cases

  • Giving a coding agent focused context for a specific feature or bug fix.
  • Piping curated code into a sub-agent run from the command line.
  • Pasting a scoped code snapshot into a chat model for review.
  • Keeping one repository's context rules for code review and documentation tasks.

Quick start

  1. 1

    Install the tool with uv

    uv tool install "llm-context>=0.6.0"
  2. 2

    Run lc-init in your project root to install the skill

    lc-init

Things to know

  • Full documentation lives in an agent skill file, so the README is only a landing page.

In collections

Topics

FAQ

What is llm-context.py?
A Python CLI and MCP server that lets coding agents and chats pull the right code context via reusable, rule-based file selection. llm-context.py is a tool for getting the right source files into an LLM's context. Instead of copying files by hand or sending an entire repository, you describe the selection as a rule: a YAML file with optional markdown guidance that lists full files and supporting files to excerpt. The tool then packs the matching code into a single context, with a file listing that marks what is and isn't included.
Is llm-context.py free to use? What license does it have?
llm-context.py is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is llm-context.py still maintained?
Actively maintained. The last commit to llm-context.py was on Oct 19, 2026.
What can I use llm-context.py for?
Giving a coding agent focused context for a specific feature or bug fix. Piping curated code into a sub-agent run from the command line. Pasting a scoped code snapshot into a chat model for review. Keeping one repository's context rules for code review and documentation tasks.
How do I install llm-context.py?
Install the tool with uv: uv tool install "llm-context>=0.6.0" Run lc-init in your project root to install the skill: lc-init
Where can I get llm-context.py?
The source code and installation instructions are on GitHub: https://github.com/cyberchitta/llm-context.py

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects