Agentic tool loop
Read, list, glob, grep, run commands, and edit — with independent read-only lookups running in parallel and diagnostics fed back after every edit.
Luna Code is an agentic assistant powered by OpenRouter. Point it at any model with just an API key and a model id — no other setup. Built for fast codebase navigation and cheap, cache-optimized long sessions.
ext install derekshreds.lunacode
Luna Code reads, greps, globs, runs builds and tests, checks language-server diagnostics, and edits code — looping until the task is done.
Read, list, glob, grep, run commands, and edit — with independent read-only lookups running in parallel and diagnostics fed back after every edit.
Delegate open-ended research to a disposable sub-agent with its own context. Only the digest returns — keeping the main thread small and cache-friendly.
A live meter shows session cost, last-turn tokens, and cache-hit rate — plus 30/60/90-day charts and a per-model spend breakdown.
A byte-stable prompt prefix and rolling cache_control breakpoints
maximize provider prompt caching, so long sessions stay cheap and fast.
Every agent turn snapshots the files it changed. One click on the ↩ revert chip restores the last turn — with a stack of 10.
A LUNA.md at your workspace root loads into every session. The agent
records durable conventions and gotchas there — nested files supported.
Connect stdio Model Context Protocol servers; their tools appear to the agent as
mcp__server__tool, with approval gating in Standard mode.
Every conversation is saved per-workspace. Browse, reload, export as Markdown, or delete prior sessions from the header.
Run the agent in a separate git worktree, review the diff, then merge or discard — your working tree stays untouched until you say so.
Your API key lives in VS Code's encrypted SecretStorage. Requests route only to providers that don't store or train on your prompts.
Switch per session — from careful review to fully autonomous.
The agent proposes each file edit and shell command; you approve before it runs. Inline side-by-side diffs make review fast.
Runs edits and commands without prompting so it can finish long tasks — with always-deny commands hard-blocked and a session budget guardrail.
Investigates the code and proposes a concrete plan, but never edits files or runs mutating commands. Mutating tools are hidden entirely.
No accounts, no config files, no per-provider wiring.
Add Luna Code to VS Code and open it from the Activity Bar — or pop it into an editor tab or the Secondary Side Bar.
Run Set OpenRouter API Key and paste your sk-or-v1-… key.
It's stored in encrypted SecretStorage.
Choose any model from the picker, type a request, and hit Enter. Luna Code handles the rest.
Luna Code is engineered for the two things that make agentic coding painful: runaway cost and data exposure.
data_collection: "deny",
so traffic only reaches providers that don't store or train on your prompts. An optional
stricter Zero-Data-Retention mode is available.Install Luna Code and start an agentic session in under a minute.