ZenCODE: an open-source coding agent in Swift with Xcode and SwiftPM tools

Hi everyone,

I'd like to share ZenCODE, an open-source (MIT) coding agent I've been building in Swift 6. It runs in the terminal or as an Agent Client Protocol (ACP) agent inside editors, and it ships as a single native zen executable for macOS, Linux, and Windows via WSL (it also runs on a Raspberry Pi).

What may be interesting for Swift developers

  • Xcode integration. ZenCODE connects to Xcode 27 over ACP as a coding agent. The optional xcode-tools package bridges Xcode's own MCP server (xcrun mcpbridge), so the agent can use BuildProject, RunAllTests / RunSomeTests, GetBuildLog, RenderPreview, and DocumentationSearch on the open project instead of calling xcodebuild directly.
  • SwiftPM tools. The swift-tools package runs swift build and swift test with arguments passed as argv, without shell interpretation, so the agent can build and test a package before it reports back.
  • Extensible in Swift. Optional tools are standalone SwiftPM packages written against a small FeatureKit / ToolCore API and compiled on your machine. The built-in Builder agent (/feature) can generate a new feature package for you, which then becomes a durable tool.
  • Sub-agents. /plan, /goal, and /review split work across specialised sub-agents, each bound to the model you pick for that capability. While they run, they coordinate in a shared chat that you can join from the terminal (@coordinator, @all).

Models

Any OpenAI-compatible endpoint, a browser sign-in with an existing ChatGPT or Claude subscription, or a local DS4 model running in-process.

Status

The latest release is v3.1.0. The install scripts build from source with Swift 6.4 (macOS 26 on Apple silicon, or Linux/WSL, where the script can install the toolchain with Swiftly). Prebuilt archives are also available for macOS arm64 and Linux x86_64 / arm64; the Linux ones need the Swift 6.4 runtime. The test suite uses Swift Testing.

Repository, docs, and a short demo GIF: GitHub - gerardogrisolini/ZenCODE: Native-Swift coding agent for the terminal and ACP. One binary, no Node runtime — customizable tools, parallel agentic workflows with capability-based model bindings. macOS, Linux, and WSL, down to a Raspberry Pi. · GitHub

Feedback is very welcome, especially from people who work in Xcode or on Linux every day, and from anyone who would like to write a feature package.

Disclosure: I'm the author of ZenCODE.

2 Likes

every cool, thanks for sharing

Quick update for anyone who tried ZenCODE after this post: several releases have landed since v3.1.0, and v5.0.0 is out today.

Native macOS app (4.0). zen --ui opens a SwiftUI app (macOS 26) with the same sessions, agents, tools and settings as the terminal: one window per workspace, a sidebar with the files each turn changed and their diffs, and a live tab for each sub-agent. It is built from source on first launch, so it needs the Swift toolchain.

Public Swift API (4.0). The terminal, ACP and the app now share one chat-session core, and it is public: an app that imports ZenCODECore can host a session with ChatSessionHost and observe a ChatSessionSnapshot, under semantic versioning. Details: ZenCODE/Docs/embedding.md at v5.0.0 · gerardogrisolini/ZenCODE · GitHub

Telegram (4.0). /telegram on hands the current session (terminal, Xcode or another ACP client, or the app) to a linked Telegram chat, where you can also approve tools; /telegram off takes it back.

Xcode (4.1). Every tool call shows its target and elapsed time, also in Xcode, where the title of a completed call ends with it (Read file · 1.25s).

Git worktrees (5.0). zen --worktree NAME runs the session on branch NAME in a separate worktree that shares the project's memory and saved sessions; when the chat ends it offers to merge the branch and remove the worktree.

Heads-up if you installed an earlier version: 5.0 is a breaking release. Setup is now only zen --setup (the /setup command is gone), and an ACP client that relied on ZENCODE_AGENT_MODE must pass --acp.

Release notes: Release ZenCODE v5.0.0 · gerardogrisolini/ZenCODE · GitHub

Feedback is still very welcome, especially on the Xcode integration and the embedding API.

2 Likes

very elegant I like the tui and gui decouple