Ghostty¶
GPU-accelerated terminal emulator by mitchell-hashimoto. Zig core, Swift macOS shell. Low-level systems programming — not a typical LLM-friendly codebase.
Architecture details surfaced in the Zed talk¶
- Terminal screen state stored as a linked list of fixed-size virtual memory pages. Pages are pulled/allocated quickly from a pool.
- Within a page, entries are addressed by a 16-bit offset from the page base, so individual cells store 2-byte offsets instead of 8-byte pointers — a deliberate memory-density optimization for cache-friendliness.
- LLMs struggle with this model: they want to rewrite the data structures back into something textbook, destroying the performance properties.
UX feature under test (reason for the talk's example)¶
New in beta tip (June 2025): undo close on any terminal — split, tab, or window — via ⌘Z. Restores the closed element. Heavily co-written with Claude.
Relevance as a test-case for agentic engineering¶
- Swift (Mac shell) → Claude handles refactors "near-perfect."
- Zig (core) → Claude regularly hallucinates; Mitchell's workaround is to have it draft solutions in Python/C/Rust and hand-port back.
- No screenshot feedback loop, no easy automated build/run for the Mac app → agents can't self-verify.