r/coolgithubprojects • • 13m ago

edgeclaw-chat/edgeclaw: Self-contained terminal AI agent: one static binary, no runtime, no Node or Python,many concurrent tasks, full-screen TUI.

Post image

https://github.com/edgeclaw-chat/edgeclaw
What it actually does

Every message is a task. Not a chat bubble you wait on. Tasks have visible states, run in the background, and you keep typing while they work.

Compose tasks like shell pipelines. | passes one task's output to the next, & runs in the background, ; sequences them, @path#40-80 attaches a line range to the prompt:

"Summarize @design.md in three bullets." | "Turn that into a two-sentence announcement."

Fork instead of re-explaining. /task fork branches a task with its context intact.

Groups and sessions. Groups share conversation history; a session binds groups to a working directory, so reopening from the same directory picks up where you left off. /session save then /task resume <id> continues work that was interrupted mid-flight.

Memory and skills. Session memory is searchable across groups. /prompt and /skill run reusable templates; it already reads .claude, .agents, .opencode and .pi resource directories, so existing agent configs mostly work.

MCP servers. Streamable HTTP and stdio, configured in ~/.edgeclaw/mcp.json, tools show up as mcp__<server>__<tool>.

Scheduled jobs. Run a prompt on a cron schedule without keeping a terminal open.

Why C, and what it cost

The goal was curl | sh actually meaning one file. That forces you to build things yourself instead of pulling a package:

• ⁠the input box is a real language (|, &, ;, @path#40-80, quoted text), so it's a flex lexer and a bison grammar — 354 + 400 lines of .l/.y;
• ⁠TLS and HTTP are mbedtls plus a hand-rolled client, including the SSE stream the MCP client needs;
• ⁠state is SQLite, forward-only migrations, no rewriting a JSON blob every turn.

Security matters more than usual here, because the model can run shell commands. On Linux the sandbox is Landlock for path access plus a seccomp-BPF filter — Landlock doesn't mediate metadata mutators like FS_IOC_SETFLAGS, so those need seccomp. /sandbox list shows the resolved writable / read-only / denied sets. On macOS it's Seatbelt.

Numbers, measured on the published binary

• ⁠73.2 MiB as published (71.6 stripped), of which 59.2 MiB is tree-sitter parse tables for syntax highlighting. They're file-backed and demand-paged, so first-screen RSS is 4.7 MB, not 73.
• ⁠--version starts in 0.4 ms; TUI first paint in a PTY in 3-4 ms.
• ⁠RSS after a long session: ~92 MB (measured with 1793 tasks / 80k messages in the store). Most of that is the TUI's chat model plus glibc arenas, not the grammar tables — only ~9 MB is file-backed.
• ⁠187 cc_test targets, 173/173 green; 69.49% line coverage per Codecov.

1 Upvotes

0 comments sorted by