K-LEAN is a cross-platform toolkit that enhances Claude Code with multi-LLM consensus, specialist agents, semantic knowledge search, and one-command install. It benefits developers and operations teams by automating code reviews, integrating with CLI, and providing persistent memory for AI agents. K-LEAN connects to Claude Code, Litellm, Nano-GPT, and OpenRouter.
git clone https://github.com/calinfaja/K-LEAN.gitK-LEAN is a cross-platform toolkit that integrates multiple large language models directly into Claude Code, enabling developers to validate code decisions through multi-LLM consensus. When 3-5 models agree on a finding, confidence increases significantly compared to single-model reviews. The skill includes 8 specialist agents (security auditor, Rust expert, C pro, ARM Cortex expert, debugger, performance engineer, code reviewer, orchestrator) that autonomously explore your codebase using tools like file reading, grep, and knowledge search. It also provides persistent knowledge management—capture learnings mid-session with /kln:learn, auto-extract insights at session end with /kln:remember, and search historical patterns and decisions across projects. K-LEAN connects to NanoGPT and OpenRouter for unified model access, runs on Windows, Linux, and macOS natively, and installs in one command via pipx.
["Install K-LEAN: Run the one-command install in your project directory using `curl -sSL https://klean.ai/install | bash` or follow the [official installation guide](https://klean.ai/docs/installation).","Configure LLMs: Set your primary and secondary LLMs in the `klean.config.yaml` file. For example, use `gpt-4` as the primary and `claude-3-opus` as the consensus validator for high-stakes tasks.","Define the Task: Use the `--task` flag to specify the automation goal, such as 'Review this code for security vulnerabilities' or 'Optimize this SQL query'. Include the `--path` flag to target a specific directory or file.","Set Consensus Threshold: Adjust the `--consensus-threshold` flag (e.g., 80 for general tasks, 90 for critical changes) to balance speed and accuracy. Higher thresholds require both LLMs to agree on changes.","Review and Apply: After execution, review the generated report and changes in the specified directory. Use `git diff` to inspect modifications before merging or committing. For complex tasks, iterate by refining the task description or adjusting the consensus threshold."]
Get security reviews and vulnerability audits before merging sensitive code
Break out of debugging loops by requesting contrarian problem-solving approaches
Build persistent institutional knowledge from code reviews and session learnings
Validate error handling and performance bottlenecks across 3-5 models in parallel
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/calinfaja/K-LEANCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use K-LEAN to automate a [TASK] in [PROJECT/PATH] with multi-LLM consensus. First, install K-LEAN in [DIRECTORY] using the one-command install. Then, configure it to use [PRIMARY_LLM] as the main model and [SECONDARY_LLM] as the consensus validator. Run the task with the command: `klean --task '[TASK_DESCRIPTION]' --path '[PROJECT/PATH]' --consensus-threshold [THRESHOLD]`. Provide a summary of the results, including any code changes, issues resolved, or recommendations made.
After installing K-LEAN in `/workspace/my_project` and configuring it with `gpt-4` as the primary LLM and `claude-3-opus` as the consensus validator, I executed the following command to automate a code review for a Python API migration: ```bash klean --task 'Review the API migration from Flask to FastAPI, ensuring backward compatibility and performance improvements' --path '/workspace/my_project/api' --consensus-threshold 85 ``` The tool processed 12 files, including `app.py`, `routes.py`, and `models.py`. It identified 3 critical issues: 1. **Endpoint Conflict**: A duplicate route in `routes.py` (`/api/v1/users`) was flagged by both LLMs, causing a 500 error in testing. The tool suggested renaming one endpoint to `/api/v1/users/legacy` and updating the frontend calls. 2. **Performance Bottleneck**: The `models.py` file had a slow ORM query in the `get_user_history` method. K-LEAN recommended adding an index on the `user_id` column and caching frequent queries. The primary LLM (gpt-4) initially missed this, but the consensus validator (claude-3-opus) caught it, achieving an 88% consensus. 3. **Deprecation Warning**: The `Flask` import in `app.py` was flagged as deprecated in favor of `FastAPI`. The tool suggested updating the import and adjusting the startup logic. The tool also provided 7 minor recommendations, such as adding type hints, optimizing error handling, and updating documentation. All changes were automatically applied to a new branch `feature/api-migration-review`, and a summary report was generated in `/workspace/my_project/reports/api_migration_review_2024-05-20.md`. The total review time was reduced from 2 hours (manual) to 12 minutes (automated).
Single API for 100+ LLM providers
AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan