ContextCraft
An IntelliJ plugin that intelligently copies source files with their related dependencies for providing comprehensive context to LLMs.
ContextCraft
The Plugin That Makes AI Understand Your Code Better
An IntelliJ plugin that enhances AI-assisted development by intelligently copying source files and their related dependencies. Perfect for providing comprehensive context to LLMs for better code suggestions, documentation, and test generation.
Features
- One-Click Copy - Copy source files with related dependencies instantly
- Three Relatedness Levels - Strict, Medium, or Broad for precise control
- Smart Package Detection - Automatic relationship mapping
- Configurable Depth - Set how deep to track references
- Multi-Language Support - Java, Kotlin, Scala, Groovy
- Interface Tracking - Include implementations automatically
- External Dependencies - Decompiled library classes support
- Java Stdlib Filtering - Exclude standard library noise
- Smart Pruning - Remove irrelevant content
- Persistent Settings - Remember your preferences
- Context Menu Integration - Available in Editor and Project views
Installation
From Plugin Marketplace
- Download the latest
.zipfrom Releases - In IntelliJ: Settings > Plugins
- Click gear icon > Install Plugin from Disk...
- Select the downloaded ZIP file
- Restart IntelliJ IDEA
Build from Source
# Clone repository
git clone https://github.com/balakumardev/ContextCraft
# Build plugin
./gradlew buildPlugin
# Install from build/distributions/
Usage
- Right-click on any source file (Project view or Editor)
- Select "Copy File with Related Files"
- Configure options in the dialog:
- Relatedness Level - Strict, Medium, or Broad
- Depth - How many levels of references to include
- Interface Implementations - Toggle on/off
- Package Filtering - Include/exclude packages
- Java Stdlib Exclusion - Filter out standard library
- Paste content into your preferred LLM
- Get context-aware responses
Relatedness Levels
| Level | Description | Best For |
|---|---|---|
| Strict | Only direct imports | Quick queries, simple files |
| Medium | Direct imports + one level deep | Most use cases |
| Broad | Full dependency tree | Complex refactoring, architecture questions |
Requirements
- IntelliJ IDEA 2023.1 or later
- Java 17 or later
- Kotlin plugin installed
Tech Stack
- Language: Kotlin
- Platform: IntelliJ Platform Plugin
- Build: Gradle
- Compatibility: All JetBrains IDEs
Roadmap
- [ ] Format templates for different LLMs
- [ ] Direct LLM API integration
- [ ] Multiple file selection support
- [ ] Custom file type support
- [ ] Improved Kotlin support
- [ ] Context-aware code summarization
Related Projects
Looking for the GoLand version? Check out ContextCraft for GoLand
Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
GNU General Public License v3.0 - see LICENSE for details.
Support
If you find this plugin useful:
- Star the repo on GitHub
- Share with your network
- Report issues or suggest improvements
Contact
Bala Kumar - mail@balakumar.dev