Your code. Your machine. Your rules. One relentless AI partner.
There's a quiet problem in the developer-tools space that nobody wants to say out loud: most AI coding assistants treat you like a passenger. You type a prompt, cross your fingers, and hope the output doesn't hallucinate your production database schema. Your context vanishes mid-conversation. Your API keys sit in plaintext config files. And when you need to do anything real β run a command, search your codebase, coordinate parallel tasks β you're copy-pasting between three different windows.
Moon Code was built because that experience is unacceptable.
What Is Moon Code?
Moon Code is a desktop coding agent IDE for macOS that fuses a full-featured Electron application with a streaming, reactive AI agent β running directly in your workspace. It doesn't generate code at you. It works beside you: executing commands, editing files, searching your codebase, spawning parallel subagents, managing encrypted secrets, and rendering live UI directly in the chat.
Think of it as the IDE that thinks with you, acts on your behalf, and never loses the thread.
The Problem Moon Code Solves
Every developer who's used an AI coding tool has hit the same walls:
π§ Context Amnesia
You're 40 messages deep in a complex refactor, and the model starts forgetting the architecture decisions you made 10 minutes ago. Moon Code's automatic history compaction intelligently summarizes older messages when the context window fills β preserving file paths, decisions, and unresolved tasks. Your conversation keeps flowing. The AI never loses the plot.
π Security Theater
Most tools store your API keys in plaintext JSON files anyone on your machine can read. Moon Code encrypts every key and secret via macOS Keychain using Electron's safeStorage API. Your credentials are decrypted only at the moment they're needed, then gone.
π The "Trust Me" Problem
An AI agent that silently runs rm -rf in your project root is not a partner β it's a liability. Moon Code's permission system requires explicit approval for every tool call. You choose "Allow Once" or "Always Allow" per session. Every operation is workspace-contained. Path traversal attacks are blocked. You stay in control.
π Cost Blindness
When a single conversation can burn $15 in API calls and you don't find out until the monthly invoice, something is broken. Moon Code shows real-time token usage, context window fullness, and estimated session cost β calculated from an integrated pricing table covering 25+ model variants. You always know what you're spending.
What Makes Moon Code Different
π§ A Real Agent, Not a Chatbot
Moon Code's agent loop doesn't stop at generating text. In a single conversation turn, it can autonomously chain dozens of tool calls:
| Capability | What It Does |
|---|---|
| Run commands | Execute any bash command with timeout and permission gating |
| Read, write, and edit files | Full file operations with workspace containment |
| Search your codebase | Blazing-fast glob and regex search with binary detection and .gitignore respect |
| Spawn subagents | Parallel child agents with their own tool access for multi-tasking |
| Connect external tools | Full MCP (Model Context Protocol) client β plug in GitHub, databases, Puppeteer, anything |
| Render live UI | Structured JSONL output compiles into interactive tables, code blocks, and lists inline |
This isn't autocomplete. This is an autonomous development partner that can research, implement, test, and iterate β while you watch, guide, and approve.
π§© Skills: Teachable Working Practices
The most powerful feature you'll barely notice at first. Skills are reusable instruction sets that teach the agent how you work. Drop a SKILL.md file into your project's .moon/skills/ directory:
---
name: pr-review
description: "Our team's code review workflow"
user-invocable: true
---
# pr-review
1. Run the linter first
2. Check for type errors
3. Flag any functions over 50 lines
4. Verify test coverage for changed files
The agent discovers it automatically. Skills are progressively disclosed β the agent only sees names and descriptions upfront, and loads full instructions on demand. No prompt bloat. No wasted context.
Install skills from disk, URLs, or the built-in marketplace. Share them across projects. Build a library of your team's best practices that the AI actually follows.
π MCP: Infinite Tool Extensibility
Moon Code is a full Model Context Protocol client supporting both stdio and HTTP transports. Connect any MCP server β filesystem, GitHub, databases, Puppeteer, sequential thinking, or your own custom tools β and every tool it exposes is automatically injected into the agent's toolkit.
Built-in one-click presets for the most common servers. Secrets encrypted via macOS Keychain. Collision detection handles duplicate tool names automatically.
π Multi-Model Freedom
No vendor lock-in. Period.
Create unlimited model profiles across OpenAI, Anthropic, OpenRouter, Zhipu GLM, Cloudflare Workers AI, or any OpenAI-compatible provider. Override context windows and output token limits per profile. Switch models mid-conversation with a single slash command.
The integrated model table knows pricing and capabilities for 25+ variants β GPT-4o, GPT-4.1, o3/o4-mini, Claude 3/3.5/4 families, DeepSeek, Gemini 2, Llama 3.x, Qwen, and more.
πΎ Session Persistence That Just Works
Every conversation turn auto-saves with full message history, workspace context, and token usage. Browse saved sessions from the sidebar, grouped by workspace. Resume any session at any point, even after restarts. Your work is never lost.
The Experience
Moon Code feels native because it is native. A macOS-first Electron app with a hidden title bar, glassmorphism blur effects, and a dark theme designed for long coding sessions.
The chat interface streams responses character-by-character. Tool calls appear as collapsible activity cards β you see exactly what the agent is doing, when, and why. The rich input toolbar shows your current model, active skills, MCP connections, and context window usage at a glance.
Slash commands give you instant control:
| Command | Action |
|---|---|
/clear |
Fresh conversation |
/compact |
Force history compaction |
/usage |
Token counts + estimated cost |
/model claude-4 |
Switch models instantly |
/skills |
Manage your skill library |
/mcp |
Configure MCP servers |
/pr-review |
Invoke any skill directly |
Architecture You Can Trust
Moon Code isn't a hastily-assembled wrapper. It's a Feature-Sliced Design architecture with clean separation of concerns:
- Electron Main Process: All I/O, secrets, tool execution, and agent orchestration β organized by domain slices
- React Renderer: Modular panels with zero sideways imports β each feature is self-contained
- Shared Modules: Framework-agnostic types, model tables, and validation schemas
- Comprehensive Test Suite: Config persistence, session atomicity, MCP lifecycle, workspace containment, streaming, subagent execution, history compaction, and more
Security isn't an afterthought:
- OS-level encryption for all credentials
- Workspace path containment on every file operation
- Binary detection in search to prevent data leakage
- No symlink following (prevents traversal attacks)
- Tool output caps to prevent context overflow
- Permission gating on every destructive operation
Who Is Moon Code For?
Solo developers who want an AI partner that respects their workflow, protects their credentials, and doesn't lose context mid-project.
Small teams who want to encode their best practices as shareable skills and connect their existing toolchain via MCP.
Power users who need multi-model freedom, real-time cost tracking, and the ability to spawn parallel subagents for complex tasks.
Security-conscious engineers who refuse to send their API keys to a cloud service or trust an agent with unrestricted file access.
Get Started
Moon Code is available as a ready-to-use desktop app for all three major platforms:
| Platform | Format | Download |
|---|---|---|
| π macOS |
.dmg (ARM64 + Intel) |
Download for Mac |
| πͺ Windows |
.exe installer |
Download for Windows |
| π§ Linux |
.AppImage / .deb
|
Download for Linux |
π Browse all releases on GitHub β
Download, install, set up your first model profile, point it at your workspace, and start coding with an AI that actually earns the word "partner."
macOS note: Moon Code is currently unsigned. After installing, run
xattr -cr "/Applications/Moon Code.app"once in Terminal to clear the Gatekeeper quarantine β or use the included Fix Permissions.command helper in the DMG.
For Contributors
git clone https://github.com/anikrauth/moon-code.git
npm install
npm run dev
The Bottom Line
The AI coding landscape is flooded with tools that promise magic and deliver friction. Context that evaporates. Keys stored in plaintext. Agents that run wild without permission. Costs you can't see until it's too late.
Moon Code is the antithesis of all of that.
Your code stays local. Your secrets stay encrypted. Every action requires your approval. Every token is counted. Every dollar is visible.
It's not the flashiest pitch. But it's the one that matters when you're shipping real software.
π Moon Code β The terminal-native coding IDE that thinks with you.
GitHub Β· Built with Electron 43 Β· React 19 Β· Vercel AI SDK 7 Β· TypeScript 6
Top comments (0)