Edtex

A small editor for working with agents.

Edtex is a lightweight native macOS editor written in Swift, aimed primarily at PHP projects. It sits between a minimal text editor and PhpStorm: AI agents now do much of the work that used to happen in a full IDE, so Edtex focuses on navigating projects, reading code, and making manual edits.

The goal is to cover the PhpStorm basics in daily use without PhpStorm's weight. It is not about the licence cost but the bloat: a Java app keeps a JVM, background indexing and a plugin platform in memory, and PhpStorm in particular takes a lot of it for an editor whose heavy lifting the agents now do. Edtex is a native app that stays small.

Measured on 2026-10-28 with the same work projects open in both (among them a PHP and JavaScript application of 24,234 files, 800 MiB and 4.76 million lines of code, by onefetch), after PhpStorm had settled for ten minutes: PhpStorm 3,931 MB, Edtex 187 MB, about a twentieth (memory footprint as Activity Monitor shows it; PhpStorm's file watcher adds 7 MB, the shells in Edtex's terminals are not counted).

The name is a nod to edlin, only more capable. It may suggest TeX/LaTeX to some people, but I don't see that as a real issue: I use e as an alias anyway, so the name doesn't really matter.

Status: in daily use. Built: the editing loop, the terminal with tmux sync, the Claude Code avatar, the database view, the Changes view and handover between Macs. What is still planned is in Effort estimates.

Scope

Version 1

  • Projects: open project folders, recent projects, folder/file sidebar. Project > Open from Folders lists the project folders under ~/Projects that aren't open yet; other folders, and <group>/<project> layouts, with defaults write net.24unix.Edtex projectFolders -array '~/Projects/<source>/*/*' '~/Code/*'.
  • Editing: file tabs, saving, clear handling of unsaved changes.
  • Editor basics: line numbers, automatic indentation, bracket matching.
  • Syntax highlighting: PHP, HTML, CSS, JavaScript, JSON — including embedded languages inside .php files (HTML containing JS and CSS).
  • Navigation: find/replace, quick file opening.
  • Git blame: inline blame for the current line.
  • Links: URLs with a scheme are underlined; ⌘-click opens them, the context menu offers Open Link and Copy Link (View > Detect Links).
  • External changes: files are often changed on disk by agents while open. Reload clean files, refresh the file tree, and protect unsaved edits when the same file changes on disk.
  • Comfort: keyboard shortcuts, settings, session restoration.
  • Launcher: edtex . from the command line.
  • Terminal: terminal tabs next to the file tabs; every project has one, more can be opened and pinned. Paths in the output are underlined under the mouse; a click opens the file in Edtex, at its line for path:42 (relative paths are looked up in the shell's folder, the project folder, then the newest copy among its checkouts). URLs open in the browser.
  • Avatar: terminal tabs running Claude Code show its state (thinking, working, waiting, done) as an avatar picture; the active terminal shows it larger, with a speech bubble. When a session waits or has finished, Apple's on-device model writes the bubble from the session's transcript (with Apple Intelligence on; otherwise the bubble shows the hook's text). Edtex › Settings › Avatar replaces the default pictures and clips per state.
  • Attention: a notification when a Claude Code session needs you; the Dock icon counts the projects waiting, their window titles show a ●, and a click on the Dock icon brings up the session that has waited longest.
  • Changes: files changed since the last commit are marked in the file tree; the Changes sidebar lists what changed per Claude Code request or since the last commit, and a click shows the diff.
  • tmux sync: each project's own terminal tab lives in its tmux session (further terminal tabs are plain shells, so they don't mirror it); switching session in a tab moves to that project's window, switching in another terminal raises it; activating a project switches that other terminal's tmux.
  • Footer: path, cursor position and selection, line endings, encoding, indentation, git branch, read-only lock, and Blamely's AI/human attribution when Blamely is installed.
  • Database view (MariaDB, MySQL): per-project connections in the sidebar, each showing all databases or the ones picked, table tabs with editing applied in one transaction, console tabs; passwords in the Keychain.
  • Handover between Macs: Project > Hand Over and Project > Continue from move a project's work in progress, open tabs and Claude Code sessions to the other Mac (git through origin, transcripts over ssh). Set the other Macs once with defaults write net.24unix.Edtex handoverPeers -array studio. After Hand Over, the Mac you left keeps a WIP commit on its branch; Hand Over or Continue there cleans it up — don't push from it by hand (or undo it with git reset HEAD~1).

Out of scope (for now)

Autocomplete, language-server integration, debugging, refactoring, and Git management beyond blame — agents already handle most of that workflow.

Technical direction

  • UI: SwiftUI for the app shell, with an existing AppKit-compatible component for the text surface. A custom editing engine is ruled out; it would multiply the effort.
  • Editing component: CodeEditSourceEditor (MIT), taken over into Packages/CodeEditSourceEditor and fixed there.
  • Highlighting: tree-sitter grammars with language injection (built into CodeEditSourceEditor), so PHP templates highlight their embedded HTML/JS/CSS.
  • Licensing: dependencies under MIT or similar permissive licences (BSD, Apache) only; no GPL code.
  • File watching: FSEvents on the project root rather than per-file watchers. Agents commonly write a temp file and rename it over the original, which breaks watchers bound to a file descriptor.
  • File tree and quick open: respect .gitignore. PHP projects carry large vendor/ (and often node_modules/) trees that would otherwise slow indexing and flood the watcher.
  • Git blame: git blame --porcelain -L n,n --contents - for the cursor line only, 200 ms after the cursor stops, with the editor text on standard input; re-run on repository changes (HEAD, index, refs/). Uncommitted and unsaved lines are shown as "Not committed yet".
  • Terminal: SwiftTerm (MIT), taken over into Packages/SwiftTerm without its build plugin. Each tab runs the user's login shell in a pseudo-terminal; the view stays alive across tab switches. See docs/specs/2026-10-15-terminal-design.md.
  • Platform: macOS 26 and newer.
  • Distribution: not sandboxed — running git and opening arbitrary folders under the App Store sandbox is impractical.
  • Launcher: edtex is a small shell script wrapping open -a Edtex <path>.

Known limitations

  • PHP inside <script> (e.g. const config = <?= json_encode(…) ?>;) disables JavaScript highlighting for the whole block.
  • Very long lines are expensive: a 523 KB single-line minified JS file used about 900 MB and several seconds of CPU.

Open questions

  • Converting other encodings and line endings. Currently UTF-8 (with or without BOM) is editable, everything else opens read-only, and line endings are kept as they are.
  • Target file size that must stay smooth (e.g. large generated or minified files).
  • What exactly counts as the "usable first version" (see estimates).
  • CodeEditLanguages and CodeEditSymbols, which the editor component needs, have no licence file; ask their authors for one, e.g. by mail.

Building

xcodebuild -project Edtex.xcodeproj -scheme Edtex -configuration Release -derivedDataPath .build/xcode build
ditto .build/xcode/Build/Products/Release/Edtex.app /Applications/Edtex.app   # the daily copy
ln -sf "$PWD/bin/edtex" /opt/homebrew/bin/edtex   # then: edtex .

The project signs with a Developer ID; to build without it, add CODE_SIGN_IDENTITY=- CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM= to the xcodebuild line, or set your own team in Xcode.

edtex opens /Applications/Edtex.app, else ~/Applications/Edtex.app.

.build/xcode remembers absolute paths of the package artifacts. After moving the checkout, a build fails with "There is no XCFramework found at …/CodeLanguagesContainer.xcframework" under the old path; rm -rf .build/xcode and build again.

For tmux sync, add this hook to tmux.conf:

set-hook -g client-session-changed 'run-shell -b "/opt/homebrew/bin/edtex --follow #{?session_path,#{q:session_path},#{q:pane_current_path}} #{q:session_name} #{q:client_name}"'

The avatar needs edtex --claude-hook as a Claude Code hook for SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Notification, PermissionRequest, Stop, StopFailure and SessionEnd in ~/.claude/settings.json: {"hooks": [{"type": "command", "command": "/opt/homebrew/bin/edtex --claude-hook"}]} in each event's list.

Logic tests: swift test --package-path Packages/EdtexKit.

Effort estimates

The first estimate assumed one developer working full-time and came to 16–27 days. It was off by about a factor of ten: work started on 2026-10-13 at 19:37, and by the evening of 2026-10-14 the core editing loop, project handling and inline blame were built. Agents write and test code in hours; what doesn't shrink is using the editor daily and checking it by eye.

So the estimate now has two columns: agent work (sessions in which code is written, tested and reviewed) and manual testing (daily use, manual checklists, finding what the tests miss).

Area Agent work Manual testing State (2026-10-28)
Project folders, recent projects, file tree done done Built and checked
Tabs, editing, saving, unsaved-change handling, draggable tabs done done Built and checked
External file changes and conflict handling done daily use Built; keeping tabs of deleted files is proposed
Highlighting, line numbers, indentation, bracket matching done daily use From the editor component
Inline Git blame for the current line done done Built and checked
Find/replace and quick file opening done daily use In-file find from the component; Go to File (double Shift)
Integrated terminal and tmux sync done daily use Built
Footer (status bar) with Blamely figures done daily use Built
Avatar, notifications, Dock badge done daily use Summaries by the on-device model: checks pending
Database view done daily use Built
Changes view done daily use Built
Handover between Macs done daily use Built
Settings partly – Avatar tab built; planned: terminal font, minimap, handover peers, avatar size, transparency
Resuming the last session per Space not started – Planned
Launcher inside the app (Install Command Line Tool) not started – Planned

Testing time is the larger and less predictable column: each round of checks tends to find a few things that need another agent session of an hour or two.

S
Description
No description provided
Readme
82 MiB
0 Stars 1 Watchers 0 Forks
Languages
Swift 99.6%
Shell 0.3%