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.
LLM Context is a tool that helps developers quickly inject relevant content from code/text projects into Large Language Model chat interfaces. It leverages .gitignore patterns for smart file selection and provides both a streamlined clipboard workflow using the command line and direct LLM integration through the Model Context Protocol (MCP).
Note: This project was developed in collaboration with Claude-3.5-Sonnet (and more recently Grok-3), using LLM Context itself to share code during development. All code in the repository is human-curated (by me 😇, @restlessronin).
Configuration files were converted from TOML to YAML in v 0.2.9. Existing users must manually convert any customizations in .llm-context/config.yaml files to the new .llm-context/config.yaml.
For an in-depth exploration of the reasoning behind LLM Context and its approach to AI-assisted development, check out our article: LLM Context: Harnessing Vanilla AI Chats for Development
Install LLM Context using uv:
## Basic installation
uv tool install llm-context
## Or with code outlining support (recommended for developers)
## uv tool install "llm-context[outline]"
To upgrade to the latest version:
## Basic upgrade
uv tool upgrade llm-context
## Or with code outlining support
## uv tool upgrade "llm-context[outline]"
Warning: LLM Context is under active development. Updates may overwrite configuration files prefixed with
lc-. We recommend all configuration files be version controlled for this reason.
Add to ‘claude_desktop_config.json’:
{
"mcpServers": {
"CyberChitta": {
"command": "uvx",
// Basic installation:
"args": ["--from", "llm-context", "lc-mcp"]
// With code outlining support (uncomment this line and comment the line above:
// "args": ["--from", "llm-context[outline]", "lc-mcp"]
}
}
}
Once configured, you can start working with your project in two simple ways:
Say: “I would like to work with my project” Claude will ask you for the project root path.
Or directly specify: “I would like to work with my project /path/to/your/project” Claude will automatically load the project context.
lc-init (only needed once).llm-context/config.yaml to customize ignore patternslc-sel-files.llm-context/curr_ctx.yamllc-contextlc-set-profile code-prompt first to include instructionslc-read-cliplistlc-init: Initialize project configurationlc-set-profile <n>: Switch profileslc-sel-files: Select files for inclusionlc-context: Generate and copy contextlc-prompt: Generate project instructions for LLMslc-read-cliplist: Process LLM file requestslc-changed: List files modified since last context generationlc-outlines: Generate outlines for code files (requires installing with [outline] extra)LLM Context provides advanced features for customizing how project content is captured and presented:
.gitignore patterns[outline] extra)lc-outlines commandSee our User Guide{:target=“_blank”} for detailed documentation of these features.
Check out our comprehensive list of alternatives - the sheer number of tools tackling this problem demonstrates its importance to the developer community.
LLM Context evolves from a lineage of AI-assisted development tools:
I am grateful for the open-source community’s innovations and the AI assistance that have shaped this project’s evolution.
I am grateful for the help of Claude-3.5-Sonnet in the development of this project.
This project is licensed under the Apache License, Version 2.0. See the LICENSE{:target=“_blank”} file for details.