Agentic coding, on any model

The AI coding agent for VS Code that runs on any model you want.

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
  • Any OpenRouter model
  • Private by default
  • MIT licensed
1-linesetup — key + model
300+models via OpenRouter
3 modesStandard · Auto · Plan
0 dataretention option
Everything in one panel

An agent that actually knows your codebase

Luna Code reads, greps, globs, runs builds and tests, checks language-server diagnostics, and edits code — looping until the task is done.

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.

Explore sub-agent

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.

Usage & cost analytics

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.

Cache-hit optimized

A byte-stable prompt prefix and rolling cache_control breakpoints maximize provider prompt caching, so long sessions stay cheap and fast.

Turn checkpoints

Every agent turn snapshots the files it changed. One click on the ↩ revert chip restores the last turn — with a stack of 10.

Project memory

A LUNA.md at your workspace root loads into every session. The agent records durable conventions and gotchas there — nested files supported.

MCP servers

Connect stdio Model Context Protocol servers; their tools appear to the agent as mcp__server__tool, with approval gating in Standard mode.

Session history

Every conversation is saved per-workspace. Browse, reload, export as Markdown, or delete prior sessions from the header.

Worktree sandbox

Run the agent in a separate git worktree, review the diff, then merge or discard — your working tree stays untouched until you say so.

Secure & private

Your API key lives in VS Code's encrypted SecretStorage. Requests route only to providers that don't store or train on your prompts.

You stay in control

Three modes for how much rope the agent gets

Switch per session — from careful review to fully autonomous.

Standard

Approve every step

The agent proposes each file edit and shell command; you approve before it runs. Inline side-by-side diffs make review fast.

Plan

Read-only planning

Investigates the code and proposes a concrete plan, but never edits files or runs mutating commands. Mutating tools are hidden entirely.

Up and running in a minute

Setup is one API key and a model

No accounts, no config files, no per-provider wiring.

  1. 1

    Install from the Marketplace

    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.

  2. 2

    Paste your OpenRouter key

    Run Set OpenRouter API Key and paste your sk-or-v1-… key. It's stored in encrypted SecretStorage.

  3. 3

    Pick a model & go

    Choose any model from the picker, type a request, and hit Enter. Luna Code handles the rest.

Private & economical

Cheap long sessions, without leaking your code

Luna Code is engineered for the two things that make agentic coding painful: runaway cost and data exposure.

  • Private by default. Every request sends 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.
  • Price-aware context. Cache-aware compaction keeps history append-only until a budget sized from the model's window and price is hit — then summarizes the oldest turns.
  • Secure key storage. Your key lives in VS Code's encrypted SecretStorage, never in settings or files.
  • Resilient streaming. Automatic retry with backoff on 429/5xx, a hung-stream watchdog, and optional fallback models.

Bring your own model. Keep your code yours.

Install Luna Code and start an agentic session in under a minute.