v1.1.0 — Multi-Provider AI Support

Your code,
finally explained

Paste any code. Pick how you want it explained. Get an answer in seconds. Free, open source, runs on your desktop.

↓ Download for Free View on GitHub
CodeLens — AI Code Explainer
Overview Line-by-Line Beginner Advanced Security Audit Refactor
1def authenticate(user, pwd):
2 # check credentials
3 query = f"SELECT * FROM users
4 WHERE user='{user}'"
5 result = db.execute(query)
6 if result: return True
7 return False
// OVERVIEW

This function handles user authentication by building a SQL query with the provided username and checking if a matching record exists in the database.

⚠ Critical issue detected — the query is built using string formatting, which makes it vulnerable to SQL injection. An attacker could pass admin' OR '1'='1 as the username and bypass authentication entirely.

// explanation modes

Six ways to
understand code

Not every situation calls for the same explanation. Pick what you actually need.

🔍
Overview
What does this code actually do? Get the big picture — purpose, main flow, and key components — without getting buried in details.
🟢
Beginner
No jargon, no assumptions. Real-world analogies, plain language, and a step-by-step walkthrough that makes the logic click.
🔬
Line-by-Line
Every meaningful line explained in order. When you need surgical precision — debugging, onboarding, or learning something new.
Advanced
Big-O analysis, design patterns, architectural decisions, and performance notes. Peer-level technical depth for experienced developers.
🔐
Security Audit
Reads your code like an attacker would. Flags SQL injection, bad auth patterns, exposed secrets, unsanitized inputs — and tells you exactly how to fix each one.
♻️
Refactor
Where's the duplication? What's doing too much? What'll hurt you in 6 months? Get actionable suggestions for cleaner, more maintainable code.

Keep asking questions

After the explanation, you can chat with the AI. It remembers your code and what it just told you — so questions actually make sense.

Ask things like "Why is a dictionary used here instead of a list?" or "What would line 12 look like refactored?" — without pasting anything again.

// FOLLOW-UP CHAT
U
Why is line 3 vulnerable exactly?
AI
Because the username is inserted directly into the SQL string without any sanitization. If someone passes admin' -- as the username, the query logic breaks and they bypass the password check entirely. Use parameterized queries instead.
U
Show me the fixed version
// ai providers

Use the AI
you already have

CodeLens works with three providers. Your API key, stored securely on your machine. Switch anytime.

Google Gemini
Free Tier
gemini-2.0-flash
1,500 requests/day. No credit card needed. Get a key at aistudio.google.com.
Anthropic Claude
Paid
claude-sonnet-4
Exceptional reasoning. Best for complex codebases and nuanced explanations.
OpenAI
Paid
gpt-4o
Widely used, powerful, reliable. Works if you already have an OpenAI key.
// get it

Works on every platform

Windows ↓ .exe macOS ↓ .dmg 🐧 Linux ↓ AppImage
# Clone and run from source
git clone https://github.com/SIRI-bit-tech/codelens
cd codelens
pip install -r requirements.txt
python main.py

Or grab the pre-built installer from GitHub Releases →

Stop tabbing. Start understanding.

Free, open source, no account needed.

Download for Free ★ Star on GitHub