I've been writing Swift since 2015 and building macOS apps for most of my career. I always wanted to build a terminal — not because the world needed another one, but because a terminal emulator touches everything I find interesting: low-level input handling, GPU rendering, process management, and shell integration.
For years, it stayed on my someday list. Then two things happened at the same time.
In late 2024, Ghostty launched and open-sourced libghostty — a production-grade terminal rendering engine built on Metal. Suddenly, I didn't need to write a GPU renderer from scratch. The hardest part of building a terminal was solved.
Around the same time, AI coding agents went from novelty to daily workflow. Claude Code, Codex, Aider, Gemini CLI — I was running these tools for hours every day. And I kept hitting the same frustration:
- Start a long task in Claude Code
- Switch to another tab
- Come back 10 minutes later
- "Wait... did it finish? Is it waiting for me? Did it error out?"
Every terminal I used — iTerm2, Ghostty, Warp, Kitty — they all show you text. That's it. They have zero awareness of what's actually running inside them.
So I built Cocxy Terminal. A native macOS terminal built on libghostty that actually understands what your AI agents are doing.
It's open source, MIT licensed, zero telemetry, and not a business. I built it for my own workflow and decided to share it. If it helps you, great. If not, no hard feelings.
How It Works: 4-Layer Agent Detection
Cocxy watches your terminal through 4 independent detection layers. The key part: no agent cooperation needed. You don't install plugins in Claude or configure Codex. Cocxy figures it out on its own.
Layer 0 — Hook Integration
Direct event stream from Claude Code's hook system. Real-time notifications for tool calls, completions, and errors.
Layer 1 — OSC Sequences
Terminal escape sequences that agents emit for titles, directory changes, and prompt markers.
Layer 2 — Pattern Matching
Configurable regex patterns that detect agent-specific output (thinking indicators, tool calls, progress markers).
Layer 3 — Timing Heuristics
Statistical analysis of output patterns — long pauses followed by bursts indicate an agent is processing.
Each layer works independently. If one misses something, another catches it. The result: you see agent state (working, waiting, done, error) in the sidebar, tab bar, and notification system — without switching tabs.
What Else Is in There
Beyond agent detection, I built everything I wanted in my daily terminal:
GPU Rendering — Built on libghostty, the same Metal engine behind Ghostty. Smooth scrolling, crisp text, zero lag.
65 CLI Commands — Full scriptability via Unix socket:
cocxy hooks install # Configure Claude Code integration
cocxy notify "Deploy complete" # Trigger notification
cocxy window list # List all windows
cocxy session save my-workspace # Save/restore sessions
cocxy remote connect prod-web # SSH multiplexing
cocxy capture-pane # Capture terminal content
cocxy dashboard toggle # Agent dashboard
Built-in Panels — Agent dashboard, event timeline, smart routing between sessions, embedded browser with DevTools, native macOS notifications with custom sounds.
Remote Workspaces — SSH multiplexing, port tunnels, SFTP browser, connection profiles. No extensions needed.
Zero Telemetry — No analytics. No PostHog. No Sentry. No crash reporting. Nothing leaves your machine. Verify it yourself — the code is all there.
The Stack
- Swift + AppKit — native macOS, no Electron
- libghostty — Metal-accelerated terminal rendering
- Zero third-party dependencies — no npm, no Node, no external Swift packages
- 3,053 tests across the codebase
| Metric | Value |
|---|---|
| CLI Commands | 65 |
| Tests | 3,053 |
| External Dependencies | 0 |
| Telemetry | 0 |
| License | MIT |
Try It
Homebrew:
brew tap salp2403/tap
brew install cocxy
Or download the DMG from cocxy.dev
Build from source:
git clone https://github.com/salp2403/cocxy-terminal
cd cocxy-terminal
swift build
Links
- Website: cocxy.dev
- GitHub: github.com/salp2403/cocxy-terminal
- Docs: Getting Started
This is a solo project. No company, no funding, no team. Just a developer who needed a better terminal for working with AI agents and decided to share it.
If it solves a problem for you, I'd appreciate a star on GitHub or any feedback. If you find a bug or want to contribute, issues and PRs are open. And if it's not for you, that's totally fine too.
Thanks for reading.
Top comments (0)