Skip to content

About

Native macOS SwiftUI + pure-Go coding agent studio with built-in Live Web Preview, Git worktrees, PTY terminal, and Antigravity (agy) / Claude Code / Codex / OpenAI-compatible support.

Topics

Resources

Stars

4.1k stars

Watchers

30 watching

Forks

Latest commit

 

History

153 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Morph Code

Morph Code — Native macOS SwiftUI + Pure Go Coding Agent Studio

Morph Code is a fast, local-first native macOS coding agent studio powered by a single-binary pure-Go daemon (morphcode).

No Electron. No Node.js runtime required. Instant SQLite startup, native SwiftUI rendering, built-in Live Web Preview, Git diff & worktree workflows, interactive PTY terminal, and first-class support for Antigravity (agy), Claude Code, OpenAI Codex, DeepSeek, and any OpenAI / Anthropic-compatible custom provider (OpenRouter, Ollama, Groq, xAI, LM Studio, and more).


Why Morph Code?

Most modern desktop coding-agent clients wrap a web app inside Electron and a Node.js backend. When you run multiple parallel agent threads across large repositories all day, Chromium memory overhead and web-wrapper latency add up fast.

Morph Code is built natively from the ground up in SwiftUI + AppKit and pure Go:

Area Morph Code Electron Clients (e.g. T3 Code)
UI Stack Native macOS SwiftUI + AppKit (120Hz ProMotion) Electron / Chromium renderer
Backend Daemon Single zero-CGO pure-Go binary (~22 MB RSS) Node.js runtime & dependency tree
Live Web Preview Built-in native WKWebView + viewports + Element Picker + Console/Network Chromium WebView / external browser
Execution Engine Built-in pure-Go Morph Harness + official agy / claude / codex CLIs External CLI wrapper
Model Providers Antigravity (agy), Claude, Codex, DeepSeek, OpenRouter, Ollama, Groq, xAI, any custom endpoint CLI-bound providers
Local Storage & Search Embedded SQLite WAL + FTS5 instant rendering Web / Node state layer
Parallel Orchestration Configurable Orchestrator + per-provider Worker harnesses & worktrees Thread-level CLI execution

Highlights

  • Bring Your Own CLI or API Keys
    • Works out of the box with your locally installed agy (Antigravity ACP), claude (Claude Code), and codex (codex app-server) CLIs using your own local authentication.
    • Or run directly through Morph Code's built-in pure-Go agent harness (Morph Harness) using ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY, or custom OpenAI/Anthropic-compatible endpoints (OpenRouter, Ollama, Groq, xAI, etc.).
  • Parallel Multi-Thread & Worktree Workspace
    • Run independent coding threads across multiple local repositories and isolated Git worktrees in parallel.
    • Queue follow-ups, steer active turns mid-run, fork threads, rewind/revert file changes via automatic per-turn Git checkpoints, and auto-compact long contexts.
  • Built-In Developer Inspector
    • Live Web Preview (⌘⇧P): native WKWebView preview right beside your agent with Desktop/Tablet/Mobile viewports, theme toggle, Dev Server launcher, Element Picker, screenshot-to-composer, and Console/Network drawer.
    • Git Changes (⌘⇧G): inline hunk diffs, stage/unstage, hunk discard, commits, branch switching, worktrees, and GitHub PR checks/logs (gh).
    • PTY Terminal (⌘⇧T): full interactive shell inside each project or worktree with split panes and agent command history.
  • Safety, Permissions & Extensibility
    • Per-thread Default Permissions, Plan, or Full Access modes, inline tool approval cards, reusable command allowlists, Allow / Ask / Deny permission rules, lifecycle hooks (PreToolUse, PostToolUse, Notification, Stop), and network sandbox controls.
    • Local MCP servers (stdio / http), global & project AGENTS.md, reusable /skill prompts, project scripts, RRULE scheduled runs, and local Claude Code / Codex CLI session import (⌘⇧I).

Architecture

morph-code/
├─ assets/
│  └─ hero.png                     # README hero banner
├─ apple/
│  ├─ project.yml                  # XcodeGen specification (MorphCode macOS target)
│  ├─ Packages/MorphCore/          # Swift 6 core package (SQLite + FTS5, models, sync, syntax highlighter)
│  ├─ Apps/
│  │  ├─ Shared/                   # Native SwiftUI workspace, sidebar, inspector, terminal, web preview
│  │  └─ MorphMac/                 # macOS app entry point, menu bar extra, local daemon lifecycle
│  └─ scripts/bundle-morphcode.sh  # Builds and embeds pure-Go morphcode inside Morph Code.app
└─ morphcode/
   ├─ cmd/morphcode/               # CLI & local daemon (`serve`, `bridge`, `start`, `stop`, `status`, `doctor`)
   └─ internal/
      ├─ agent/                    # Built-in pure-Go coding agent loop, tools, compaction, MCP client
      ├─ checkpoint/               # Automatic per-turn workspace checkpoints and revert
      ├─ gitops/                   # Git status, diff, worktrees, commits, GitHub PR ops
      ├─ harness/                  # Official Agy ACP, Claude CLI, Codex app-server, and built-in Morph Harness adapters
      ├─ model/                    # Shared workspace & streaming event schema
      ├─ router/                   # Single-user local API key & custom provider configuration
      ├─ schedule/                 # Persistent RRULE scheduler
      ├─ server/                   # Local HTTP + SSE API (`/v1/code/*`), PTY terminal sessions
      └─ store/                    # Pure-Go SQLite WAL persistence

Quick Start (Build from Source)

Requirements

  • macOS 15.0+ and Xcode 16.4+
  • Go 1.25+
  • XcodeGen (brew install xcodegen)
  • Optional: official agy (Antigravity CLI), claude, and/or codex CLI installed locally, or API keys configured in Settings → Providers & Models.

1. Run morphcode Daemon Tests & Build

cd morphcode
go test -race ./...
CGO_ENABLED=0 go build -o bin/morphcode ./cmd/morphcode
./bin/morphcode doctor

2. Build & Run the macOS App

cd apple
xcodegen generate
open MorphCode.xcodeproj

Or build from the command line (automatically compiles and embeds morphcode inside Morph Code.app/Contents/Helpers/morphcode):

cd apple
xcodegen generate
xcodebuild \
  -project MorphCode.xcodeproj \
  -scheme MorphCode \
  -destination 'platform=macOS' \
  CODE_SIGNING_ALLOWED=NO \
  build

3. Run Swift Core Tests

cd apple/Packages/MorphCore
swift test

Standalone morphcode CLI

You can also run the Go daemon standalone on macOS or Linux:

cd morphcode
go build -o bin/morphcode ./cmd/morphcode

# Check installed CLIs and configured provider keys
./bin/morphcode doctor

# Start the local daemon in the background (default: http://127.0.0.1:4415)
./bin/morphcode start
./bin/morphcode status
./bin/morphcode stop

Configuration and state live locally under ~/.morph-code (override with MORPHCODE_DATA_DIR). Local API keys and custom providers are stored in ~/.morph-code/providers.json with 0600 permissions, or read from standard environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY).


Legacy v3

Looking for the previous Next.js / Electron v3 codebase (formerly Claudable)? It remains preserved on the legacy/v3 branch and v3.2.1 tag.

License

MIT — see LICENSE.

About

Native macOS SwiftUI + pure-Go coding agent studio with built-in Live Web Preview, Git worktrees, PTY terminal, and Antigravity (agy) / Claude Code / Codex / OpenAI-compatible support.

Topics

Resources

Stars

4.1k stars

Watchers

30 watching

Forks

Releases

Packages

Used by

Contributors

Languages