ReasonLine
Understand the code. Understand the why.
Select code and get a short explanation of what you're doing and how it fits the rest of your codebase. ReasonLine pulls in the related code from elsewhere in your project, keeps only what matters, and checks its summary against your code before you read it. It works in VS Code and Cursor.
Quick start
- Get an OpenRouter key. Sign up at openrouter.ai, add some credit, and create a key at openrouter.ai/keys. A few dollars covers thousands of explanations.
- Add the key. Open the Command Palette (Cmd+Shift+P, or Ctrl+Shift+P on Windows and Linux), run ReasonLine: Set OpenRouter API Key, and paste it. If your project's
.env file already has an OPENROUTER_API_KEY, ReasonLine offers to use it.
- Select some code with the mouse and click ✨ Explain selection when it pops up. You can also right-click and choose Explain Selection, or press Cmd+Alt+E (Ctrl+Alt+E on Windows and Linux).
Your first explanation in a project takes longer while ReasonLine indexes it. After that, an explanation takes about five seconds.
What you get
- Your intent, not just the syntax. ReasonLine looks at your uncommitted changes near the selection. Add a debug log inside a function and it tells you you're debugging it.
- Related code from across your project. It finds the code your selection depends on, keeps only the pieces that are actually needed, and links to them.
- A check on every summary. Each claim in the summary is checked against your code, and a badge shows how well it's supported, so you know when to double-check.
- A quality rating. The selection is scored out of 100 for correctness, error handling, readability, maintainability and efficiency, at no extra cost.
- Suggestions you can trust. Ask for an improvement and ReasonLine drafts one, rates it against your original, and checks whether it changes behavior. You see the score change and a diff before you apply anything.
- Stays out of your way. The explanation appears as a card right on your selection, not in a new tab. Press Esc or move the cursor away to close it.
The explanation card
The card shows:
- what the code is for and what you're doing with it, plus the grounding badge
- warnings when they apply: a likely bug, unfinished code, or uncommitted changes nearby
- the summary, with file references you can click to open
- Copy, Open details, and what the explanation cost and how long it took
If you've moved on by the time it's ready, a notification offers to show it. Hover over the explained lines to bring it back.
Open details opens a side panel with three tabs:
- Explanation: the full analysis, the summary, and each piece of related code that was considered, with how relevant it was
- Rating: the overall score, a breakdown for each dimension, and quick stats such as lines, branches, nesting and TODOs
- Suggestion: a suggested improvement, generated when you open the tab
Each suggestion gets a label:
- ✓ Verified improvement: a better rating, and the same behavior for every input your code already handles.
- ⚠ Review before applying: a better rating, but some inputs now behave differently, for example returning
null instead of throwing. Each change is listed.
- ✕ Not recommended: no real improvement, or not a complete replacement. You can still view the draft.
Apply replaces your selection in one undoable edit. It won't apply if the file has changed since the explanation.
Cost
ReasonLine runs on your own OpenRouter account. There's no subscription.
|
Typical cost |
Time |
| Explanation, with rating |
$0.001–0.002 |
4–7 s |
| Suggestion |
$0.0005 more |
3–5 s |
| Indexing a project (once) |
roughly $0.01 per 50,000 lines; later saves re-index only what changed |
varies |
The card shows the exact cost and time of each explanation, including its suggestion once you've opened it.
Privacy
ReasonLine sends code to OpenRouter, which passes each request to the model's provider. By default that's TypeSafe for analysis, Anthropic for writing and OpenAI for search.
- When indexing: your project's source files, to build the search index. Files covered by
.gitignore or reasonline.index.exclude are never read.
- When explaining: the selection, the function or class around it, the file's imports, uncommitted changes near the selection, and up to eight pieces of related code.
The index is stored on your machine. Your key is kept in the editor's secret storage and is only sent to OpenRouter. In Restricted Mode (an untrusted workspace), ReasonLine won't look in .env files for a key.
Commands
| Command |
What it does |
| ReasonLine: Explain Selection |
Explain the selected code |
| ReasonLine: Set OpenRouter API Key |
Add or replace your key |
| ReasonLine: Rebuild Workspace Index |
Re-index the project if related code looks off |
Settings
| Setting |
Default |
What it does |
reasonline.selectionPrompt |
popup |
How Explain selection is offered: popup after a mouse selection, hover only when you hover over the selection, or off |
reasonline.writerModel |
anthropic/claude-haiku-5.5 |
Writes the summary and suggestions. Any chat model on OpenRouter works. |
reasonline.decisionModel |
typesafe/jev-1.13 |
Makes the judgment calls: analysis, relevance, rating and the grounding check. microsoft/microsoft-decision-1 is cheaper and about as accurate. |
reasonline.embeddingModel |
openai/text-embedding-3-small |
Builds the search index. Changing it re-indexes your project. |
reasonline.retrieval.candidates |
8 |
How many pieces of related code to consider. 0 turns this off. |
reasonline.retrieval.relevanceThreshold |
0.5 |
How sure ReasonLine must be that a piece of related code matters before using it, from 0 to 1 |
reasonline.index.maxChunks |
6000 |
Index size limit for very large projects. Files nearest the one you're editing are kept. |
reasonline.index.exclude |
build and vendor folders |
Extra files or folders to skip. .gitignore is always respected. |
Troubleshooting
- The ✨ prompt doesn't appear. It shows after you select more than one word with the mouse; keyboard selections don't trigger it. Use the shortcut instead, or check that
reasonline.selectionPrompt isn't off.
- "OpenRouter rejected the API key." Run ReasonLine: Set OpenRouter API Key again, and check that your OpenRouter account has credit.
- No related code. The file needs to be inside an open workspace folder. If results look out of date, run ReasonLine: Rebuild Workspace Index.
- Anything else. Logs are in View › Output, under ReasonLine.
Requirements
- VS Code 1.90 or later, or Cursor
- An OpenRouter account with credit
- Optional: git, so ReasonLine can see your uncommitted changes and respect
.gitignore
Known limitations
- ReasonLine relies on OpenRouter's Decisions API, which is still in alpha. If it changes, explanations may fail until ReasonLine is updated.
- Unsaved edits are noted but not compared. Save the file for your latest changes to count.
- Only the workspace folder that contains the file is searched for related code.
- Code is analysed as text, so a repository written to mislead AI tools could steer the verdicts.
License
ReasonLine is proprietary software, © 2026 Mauro Garcia. All rights reserved. You may install and use it, but not copy, modify, fork, reverse engineer or redistribute it. The full terms are in LICENSE.md, included with the extension. Open-source components it includes are listed in THIRD-PARTY-NOTICES.md.
| |