cyberchitta/llm-context.py

Share code with LLMs via Model Context Protocol or clipboard. Rule-based customization enables easy switching between different tasks (like code review and documentation). Includes smart code outlining.

What it solves

Getting the right amount of code context into an LLM is often a manual, friction-heavy process. Users typically either send too much data, hitting token limits, or too little, causing the LLM to miss critical information and require multiple follow-up requests for missing files.

How it works

The tool allows coding agents to curate their own context through a system of composable rules. An agent uses the lc-init command to install a "skill" that teaches it how to identify necessary files, write selection rules in YAML, and verify those rules using a code graph to find missing symbols. The tool can then pack this context—consisting of full files, structural excerpts (signatures and definitions), and filtered file listings—and deliver it via the clipboard, a pipe to another agent, or an MCP (Model Context Protocol) server.

Who it’s for

Developers using AI coding agents (like Claude Code) or LLM chats who need a precise, automated way to manage the codebase context provided to the model.

Highlights

  • Agent-led curation: Agents can author and verify their own context rules without manual user intervention.
  • Composable rules: Uses a rule system (categorized by prefixes like prm-, flt-, exc-) to define how files are selected and excerpted.
  • Context packing: Combines full file contents with structural excerpts to maximize token efficiency.
  • MCP Support: Integrates via Model Context Protocol to allow models to pull missing or changed files dynamically.
  • Code graph verification: lc-preview helps agents identify symbols defined in files that were accidentally omitted from the selection.

関連

  • Dispatch
  • Dispatch
  • プロジェクト
  • プロジェクト
  • プロジェクト