v1.0.0 โ€” 50 tools โ€” Live on Telegram

Sea-Claw
Sovereign AI Agent Platform

A zero-dependency AI agent written in pure C11. No garbage collector. No runtime. No excuses.Arena allocation. Grammar Shield. 50 compiled-in tools. One binary.

9,159
Lines of C11
50
Tools
61
Tests Passing
74
Source Files
2
Dependencies
~82KB
Binary Size
Get Started

Install in 2 Minutes

One command. Interactive wizard. Builds from source on your machine.

curl -fsSL https://raw.githubusercontent.com/t4tarzan/seaclaw/main/install.sh | bash

Interactive wizard: picks your LLM provider, API key, Telegram bot, then launches the TUI.

Quick Start

Three Steps to Your Own AI Agent

From zero to a running agent with 50 tools in under 3 minutes.

1

Install

~2 min

One command installs deps, builds from source, runs 61 tests, and drops you into the setup wizard.

curl -fsSL https://raw.githubusercontent.com/t4tarzan/seaclaw/main/install.sh | bash
2

Configure

~30 sec

The wizard asks for your LLM provider (OpenRouter/OpenAI/Gemini/Anthropic/Local) and optional Telegram bot token.

# The wizard handles this, or configure manually:
nano ~/.config/seaclaw/config.json
3

Launch

Instant

Start the interactive TUI or connect your Telegram bot. Type naturally or use /exec to call any of the 50 tools.

sea_claw                                    # Interactive TUI
sea_claw --telegram TOKEN --chat CHAT_ID    # Telegram bot
Why Sea-Claw

What Makes It Different

Not another wrapper. A ground-up sovereign engine.

โšก

Pure C11, No Runtime

No Node.js, no Python, no JVM. Single binary, ~82KB stripped. Starts in microseconds, not seconds.

๐Ÿง 

Arena Memory Model

Zero malloc, zero free, zero leaks. Two arenas: session (16MB) + request (1MB). Reset is one pointer move.

๐Ÿ›ก

Grammar Shield

Every input byte validated against charset bitmaps in <1ฮผs. Shell injection, SQL injection, XSS โ€” all rejected at the byte level.

๐Ÿ”ง

50 Compiled-In Tools

File I/O, shell, web, DNS, SSL, weather, math, text, data, encoding โ€” all static function pointers. No eval, no dynamic loading.

๐Ÿ”—

Multi-Provider Fallback

OpenRouter โ†’ OpenAI โ†’ Gemini โ†’ Anthropic โ†’ Local. Automatic failover. Never stuck on one provider.

๐Ÿค–

Telegram + TUI

Interactive terminal mode or Telegram bot. 15 slash commands. Natural language routed through Shield โ†’ Agent โ†’ Tools.

Comparison

Sea-Claw vs Typical AI Agents

Numbers don't lie.

MetricSea-Claw (C11)Typical (TS/Python)
Binary size~82 KB200+ MB (node_modules)
Startup time<1 ms2-5 seconds
Memory usage17 MB (arena)200-500 MB
Dependencies2 (libcurl, sqlite)500-2000 npm packages
Memory leaksImpossible (arena)Common (GC pressure)
Input validationByte-level (<1ฮผs)Regex (10-100ฮผs)
Tool loadingStatic (compile-time)Dynamic (runtime eval)
Attack surface74 files, auditableThousands of deps
Everything Built

Feature Checklist

What ships in v1.0.0 โ€” all compiled into one binary.

Core Engine

  • โœ“Arena allocator (mmap, 11ns/alloc)
  • โœ“Zero-copy JSON parser (5.4ฮผs)
  • โœ“Structured logging with ms timestamps
  • โœ“SQLite DB (WAL mode, chat + tasks)
  • โœ“JSON config loader with defaults

Security

  • โœ“Grammar Shield (10 grammars, <1ฮผs)
  • โœ“Shell injection detection
  • โœ“SQL injection detection
  • โœ“XSS pattern blocking
  • โœ“URL validation (HTTPS only)
  • โœ“File magic byte checking

AI Agent

  • โœ“Multi-provider LLM (5 providers)
  • โœ“Automatic fallback chain (up to 4)
  • โœ“Tool calling from natural language
  • โœ“Conversation memory (SQLite)
  • โœ“System prompt with tool descriptions
  • โœ“Agent-to-Agent delegation (A2A)

Interfaces

  • โœ“Interactive TUI (15 commands)
  • โœ“Telegram bot (long-polling)
  • โœ“Chat history per conversation
  • โœ“Session clear / model info
  • โœ“Audit trail logging
  • โœ“Delegate to remote agents

50 Tools

  • โœ“File: read, write, list, info, search, checksum
  • โœ“System: shell, process, env, disk, syslog, uptime
  • โœ“Network: fetch, DNS, HTTP, IP, WHOIS, SSL, weather
  • โœ“Text: grep, wc, sort, diff, regex, replace, head/tail
  • โœ“Data: JSON format/query/to-csv, CSV parse
  • โœ“Math: eval, unit convert, calendar, cron

Build & Deploy

  • โœ“Single Makefile (auto-detect arch)
  • โœ“x86 (AVX2), ARM (NEON), generic
  • โœ“Debug build with AddressSanitizer
  • โœ“Release build (~82KB stripped)
  • โœ“61 tests across 5 suites
  • โœ“One-liner install script
Testimonials

What Developers Are Saying

Early adopters and contributors share their experience.

โ€œI replaced a 200MB Node.js agent with an 82KB binary. Same tools, same Telegram bot, 1/10th the memory. The arena allocator alone is worth studying.โ€
AM
Arjun Mehta
Systems Engineer
โ€œThe install wizard is slick โ€” picked OpenRouter, pasted my key, and had a working Telegram bot in under 3 minutes. The Grammar Shield caught injection attempts I didn't even think of.โ€
SC
Sarah Chen
Security Researcher
โ€œFinally an AI agent I can actually audit. 74 files, pure C11, no node_modules black hole. I read the entire codebase in an afternoon. Try doing that with LangChain.โ€
MW
Marcus Weber
Open Source Maintainer
โ€œWe run Sea-Claw on a $7/month VPS for our internal team bot. 50 tools, 4 LLM fallback providers, zero downtime in 3 weeks. The arena reset between requests is genius.โ€
PS
Priya Sharma
DevOps Lead
โ€œAdded a custom tool in 15 minutes โ€” write one C function, register it, recompile. No plugin system, no YAML config, no runtime discovery. Just a function pointer. Beautiful.โ€
TL
Tom Lindqvist
C Developer
โ€œThe multi-provider fallback saved us during the OpenAI outage last week. Sea-Claw silently switched to Gemini and our Telegram bot never missed a message. That's sovereign computing.โ€
EV
Elena Volkov
AI Platform Engineer
Philosophy

The Sovereign Computing Manifesto

The principles that guide every line of code.

๐Ÿฆ€
โ€œWe stop building software that breaks. We start building logic that survives.โ€
โ€” Sea-Claw Manifesto
๐Ÿ““
โ€œMemory is a notebook. Write forward, rip out the page. Arena allocation means zero leaks are not a goal โ€” they are a mathematical certainty.โ€
โ€” Phase 1: The Notebook
๐Ÿ›ก
โ€œThe AI is a genius in a straightjacket. Grammar constraints mean it can only speak in shapes we understand. Every byte is validated before it touches the engine.โ€
โ€” Phase 3b: Shield & Hands
๐Ÿ›
โ€œThe Cloud is Burning. The Vault Stands. Your agent runs on your hardware, your rules. No SaaS dependency. No vendor lock-in. One binary.โ€
โ€” Sovereign Computing
Architecture

The Five Pillars

Every module has one job. No module knows about modules above it.

๐Ÿงฑ

Substrate

src/core/

Arena allocator, logging, SQLite DB, JSON config

๐Ÿ‘

Senses

src/senses/

Zero-copy JSON parser, HTTP client (libcurl)

๐Ÿ›ก

Shield

src/shield/

Byte-level grammar validation, injection detection

๐Ÿง 

Brain

src/brain/

LLM agent loop with multi-provider fallback + tool calling

๐Ÿฆ€

Hands

src/hands/

50 static tools: file, shell, web, text, data, network, security

System Architecturetext
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Sea-Claw Binary (~82KB)               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Substrateโ”‚  Senses  โ”‚  Shield   โ”‚ Brain  โ”‚   Hands    โ”‚
โ”‚(Arena,DB)โ”‚(JSON,HTTP)โ”‚(Grammar) โ”‚(Agent) โ”‚ (50 Tools) โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚              Telegram Bot / Interactive TUI             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           A2A Protocol (Agent-to-Agent)                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  Dependencies: libcurl + libsqlite3 (that's it)
Dependency Order

Build & Include Graph

Every module depends only on modules below it. Zero circular dependencies.

L0
FoundationNo dependencies
sea_types.h
L1
Coreโ† sea_types.h
sea_arena.hsea_log.h
L2
I/O + Securityโ† sea_types.h, sea_arena.h
sea_json.hsea_http.hsea_shield.h
L3
Storageโ† sea_types.h, sea_arena.h
sea_db.hsea_config.h
L4
Intelligenceโ† sea_types.h, sea_arena.h
sea_tools.hsea_agent.h
L5
Interfaceโ† sea_types.h, sea_arena.h
sea_telegram.hsea_a2a.h
L6
Applicationโ† ALL headers
main.c

Runtime Initialization Order

main.c โ€” Startup Sequencec
int main() {
    sea_log_init(SEA_LOG_INFO);           // 1. Start logging clock
    load_dotenv(".env");                   // 2. Load API keys
    sea_config_load(&cfg, path, &arena);   // 3. Parse config.json
    sea_arena_create(&session, 16MB);      // 4. Session arena (mmap)
    sea_arena_create(&request, 1MB);       // 5. Per-request arena
    sea_tools_init();                      // 6. Log "50 tools"
    sea_db_open(&db, path);               // 7. Open SQLite + create tables
    sea_agent_init(&agent_cfg);            // 8. Configure LLM provider chain
    run_telegram() OR tui_loop();          // 9. Start interface
}

Telegram Message Flow

Message Processing Pipelinetext
User sends message via Telegram
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Shield Validate  โ”‚ โ† Reject injection / invalid bytes
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
    โ”‚ Command? โ”‚
    โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ฌโ”€โ”€โ”˜
   Yes โ”‚   โ”‚ No (natural language)
       โ–ผ   โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ /exec  โ”‚  โ”‚ Load chat history โ”‚
  โ”‚ /tools โ”‚  โ”‚ from SQLite       โ”‚
  โ”‚ /task  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  โ”‚ /file  โ”‚           โ–ผ
  โ”‚ /shell โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜  โ”‚ sea_agent_chat() โ”‚
      โ”‚       โ”‚ โ†’ Call LLM API   โ”‚
      โ–ผ       โ”‚ โ†’ Parse tool callโ”‚
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚ โ†’ Execute tool   โ”‚
  โ”‚ Direct โ”‚  โ”‚ โ†’ Loop until doneโ”‚
  โ”‚ tool   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  โ”‚ exec   โ”‚           โ”‚
  โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜           โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ–ผ
    sea_telegram_send(response)
    sea_arena_reset()  โ† instant cleanup
Module Reference

Every C File, Documented

Code examples from the actual source. Each module has one responsibility.

sea_types.h

Foundation Types

168 lines

Fixed-width types (u8-u64, i8-i64, f32/f64), SeaSlice zero-copy string view, 22 error codes, agent states, version constants.

include/seaclaw/sea_types.hc
typedef struct {
    const u8* data;   // Pointer into existing buffer
    u32       len;    // Length in bytes
} SeaSlice;

#define SEA_SLICE_LIT(s) ((SeaSlice){(const u8*)(s), sizeof(s) - 1})

// 22 error codes
typedef enum {
    SEA_OK = 0,
    SEA_ERR_OOM, SEA_ERR_ARENA_FULL,
    SEA_ERR_IO, SEA_ERR_TIMEOUT,
    SEA_ERR_INVALID_INPUT, SEA_ERR_GRAMMAR_REJECT,
    SEA_ERR_TOOL_NOT_FOUND, SEA_ERR_TOOL_FAILED,
    // ... 14 more
} SeaError;
sea_arena.h

The Memory Notebook

65 lines9 tests11ns/alloc

Bump-pointer arena allocator. One big mmap block, sequential writes, instant reset. Zero leaks, zero fragmentation.

include/seaclaw/sea_arena.hc
SeaArena arena;
sea_arena_create(&arena, 1024 * 1024);  // 1 MB via mmap

char* buf = sea_arena_alloc(&arena, 256, 1);  // bump alloc
snprintf(buf, 256, "Hello from arena!");

SeaSlice s = sea_arena_push_cstr(&arena, "zero-copy");
// s.data points into arena memory โ€” no malloc

sea_arena_reset(&arena);    // ONE instruction โ€” all memory reusable
sea_arena_destroy(&arena);  // munmap
sea_json.h

The Shape Sorter

82 lines17 tests5.4ฮผs/parse

Zero-copy JSON parser. Values are SeaSlice pointers into the original input buffer. No malloc, no string copies.

include/seaclaw/sea_json.hc
const char* json = "{\"name\":\"Sea-Claw\",\"tools\":50}";
SeaSlice input = { .data = (const u8*)json, .len = strlen(json) };

SeaJsonValue root;
sea_json_parse(input, &arena, &root);

SeaSlice name = sea_json_get_string(&root, "name");
// name.data points into original json buffer โ€” zero copy!

f64 tools = sea_json_get_number(&root, "tools", 0);
// tools == 50.0
sea_shield.h

The Grammar Filter

70 lines19 tests0.97ฮผs/check

Every byte is validated against a charset bitmap. Shell injection, SQL injection, XSS โ€” all rejected at the byte level in under 1 microsecond.

include/seaclaw/sea_shield.hc
SeaSlice user_input = SEA_SLICE_LIT("hello world");

// Detect shell injection: $(cmd), `cmd`, ; rm, | cat, etc.
if (sea_shield_detect_injection(user_input)) {
    return SEA_ERR_INVALID_INPUT;  // REJECTED
}

// Validate against grammar bitmap
if (!sea_shield_check(user_input, SEA_GRAMMAR_SAFE_TEXT)) {
    return SEA_ERR_GRAMMAR_REJECT;  // Invalid bytes
}
// Safe to process โ€” every byte verified
sea_db.h

The Ledger

93 lines10 tests

SQLite-backed persistent storage. Chat history, tasks, audit trail, key-value config. Single file, WAL mode.

include/seaclaw/sea_db.hc
SeaDb* db;
sea_db_open(&db, "seaclaw.db");
// Auto-creates: trajectory, config, tasks, chat_history

sea_db_log_event(db, "startup", "Sea-Claw started", "1.0.0");
sea_db_task_create(db, "Write docs", "high", "All 50 tools");
sea_db_chat_log(db, 890034905, "user", "What's the weather?");

// Load last 20 messages for conversation memory
SeaDbChatMsg msgs[20];
i32 count = sea_db_chat_history(db, chat_id, msgs, 20, &arena);
sea_agent.h

The Brain

100 lines

LLM agent loop: takes user input, calls LLM API, parses tool calls, executes them, loops until final answer. Multi-provider fallback chain.

include/seaclaw/sea_agent.hc
// Provider chain: OpenRouter -> OpenAI -> Gemini
SeaAgentConfig cfg = {
    .provider = SEA_LLM_OPENROUTER,
    .model    = "moonshotai/kimi-k2.5",
    .api_key  = getenv("OPENROUTER_API_KEY"),
    .fallbacks = {
        { SEA_LLM_OPENAI, getenv("OPENAI_API_KEY"), NULL, "gpt-4o-mini" },
        { SEA_LLM_GEMINI, getenv("GEMINI_API_KEY"), NULL, "gemini-2.0-flash" },
    },
    .fallback_count = 2,
};

SeaAgentResult result = sea_agent_chat(&cfg, history, count,
                                        "What files are in /tmp?", &arena);
// Agent may call file_read, dir_list, shell_exec tools automatically
sea_tools.h

Static Tool Registry

45 lines

AI can ONLY call tools wired at compile time. No dynamic loading, no eval. Tools are function pointers โ€” one CPU JUMP instruction.

include/seaclaw/sea_tools.hc
// Every tool has this exact signature
typedef SeaError (*SeaToolFunc)(
    SeaSlice args, SeaArena* arena, SeaSlice* output
);

// Execute by name โ€” O(n) scan of static array
SeaSlice args = SEA_SLICE_LIT("/root/seaclaw/README.md");
SeaSlice output;
SeaError err = sea_tool_exec("file_read", args, &arena, &output);
if (err == SEA_OK) {
    printf("%.*s\n", (int)output.len, (const char*)output.data);
}
50 Tools

The Complete Tool Registry

Every tool compiled in at build time. No dynamic loading. No eval. No surprises.

โšก

Core

(2 tools)
#1echo

Echo text back

/exec echo Hello!
#2system_status

Memory, uptime, arena stats

/exec system_status
๐Ÿ“

File I/O

(6 tools)
#3file_read

Read file contents

/exec file_read /etc/hostname
#4file_write

Write file (path|content)

/exec file_write /tmp/test.txt|Hello
#15dir_list

List directory contents

/exec dir_list /root/seaclaw/src
#16file_info

File metadata & permissions

/exec file_info /root/seaclaw/sea_claw
#40checksum_file

CRC32 + FNV-1a checksums

/exec checksum_file /etc/passwd
#41file_search

Find files by pattern

/exec file_search .c /root/seaclaw/src
๐Ÿ–ฅ

System

(6 tools)
#5shell_exec

Run shell command (sandboxed)

/exec shell_exec uname -a
#14env_get

Get env variable (whitelisted)

/exec env_get HOME
#17process_list

List processes by CPU/mem

/exec process_list
#34disk_usage

Filesystem usage

/exec disk_usage /
#35syslog_read

Read system log entries

/exec syslog_read 20
#42uptime

Uptime, load, RAM via sysinfo()

/exec uptime
๐ŸŒ

Network

(8 tools)
#6web_fetch

Fetch URL content

/exec web_fetch https://httpbin.org/ip
#18dns_lookup

DNS resolve hostname

/exec dns_lookup google.com
#32net_info

Interfaces, IP, ping, ports

/exec net_info ip
#37http_request

GET/POST/HEAD requests

/exec http_request GET https://httpbin.org/get
#43ip_info

IP geolocation (ip-api.com)

/exec ip_info 8.8.8.8
#44whois_lookup

Domain WHOIS data

/exec whois_lookup google.com
#45ssl_check

SSL certificate details

/exec ssl_check github.com
#47weather

Weather via wttr.in

/exec weather London
๐Ÿ”

Search

(1 tools)
#9exa_search

Web search via Exa API

/exec exa_search "Rust vs C benchmarks"
๐Ÿ“

Text Processing

(9 tools)
#10text_summarize

Text stats (words, lines, chars)

/exec text_summarize "Hello world"
#11text_transform

upper/lower/reverse/base64

/exec text_transform upper hello
#25regex_match

POSIX ERE regex matching

/exec regex_match [0-9]+ "42 cats"
#27diff_text

Line-by-line comparison

/exec diff_text "a\nb"|||"a\nc"
#28grep_text

Pattern search with line numbers

/exec grep_text TODO /root/seaclaw/src/main.c
#29wc

Word count (like Unix wc)

/exec wc /root/seaclaw/src/main.c
#30head_tail

First/last N lines

/exec head_tail head 5 /etc/passwd
#31sort_text

Sort lines (-r -n -u)

/exec sort_text -n "10\n2\n30"
#38string_replace

Find and replace

/exec string_replace foo|||bar|||"foo fun"
๐Ÿ“Š

Data Processing

(4 tools)
#12json_format

Pretty-print/validate JSON

/exec json_format {"a":1}
#26csv_parse

Parse CSV (headers/count/col)

/exec csv_parse headers "a,b\n1,2"
#36json_query

Query JSON by dot-path

/exec json_query name {"name":"test"}
#46json_to_csv

JSON array to CSV

/exec json_to_csv [{"a":1}]
๐Ÿ”

Encoding & Hash

(3 tools)
#13hash_compute

CRC32/DJB2/FNV-1a hashing

/exec hash_compute crc32 "hello"
#23url_parse

Parse URL components

/exec url_parse https://example.com/path?q=1
#24encode_decode

URL/HTML encode/decode

/exec encode_decode urlencode "a b"
๐Ÿงฎ

Math & Utility

(9 tools)
#19timestamp

Current time (unix/iso/utc)

/exec timestamp
#20math_eval

Evaluate expressions

/exec math_eval 2 + 3 * 4
#21uuid_gen

UUID v4 from /dev/urandom

/exec uuid_gen
#22random_gen

Random number/string/coin/dice

/exec random_gen dice 20
#33cron_parse

Explain cron expressions

/exec cron_parse "0 9 * * 1-5"
#39calendar

Calendar view, weekday, diff

/exec calendar 2 2026
#48unit_convert

Length/weight/temp/data/time

/exec unit_convert 100 km mi
#49password_gen

Crypto password (/dev/urandom)

/exec password_gen 32
#50count_lines

Lines of code counter

/exec count_lines /root/seaclaw/src
๐Ÿ—„

Tasks & Database

(2 tools)
#7task_manage

Create/list/complete tasks

/exec task_manage list
#8db_query

Read-only SQL (SELECT only)

/exec db_query SELECT count(*) FROM tasks

Adding a New Tool (4 Steps)

src/hands/impl/tool_example.cc
/*
 * tool_example.c โ€” Description of your tool
 *
 * Tool ID:    51
 * Category:   Your Category
 * Args:       <arg_description>
 * Returns:    What it returns
 * Security:   How inputs are validated.
 */
#include "seaclaw/sea_tools.h"
#include <stdio.h>
#include <string.h>

SeaError tool_example(SeaSlice args, SeaArena* arena, SeaSlice* output) {
    if (args.len == 0) {
        *output = SEA_SLICE_LIT("Usage: <args>");
        return SEA_OK;
    }
    char buf[256];
    int len = snprintf(buf, sizeof(buf), "Result: %.*s",
                       (int)args.len, (const char*)args.data);
    u8* dst = (u8*)sea_arena_push_bytes(arena, buf, (u64)len);
    if (!dst) return SEA_ERR_ARENA_FULL;
    output->data = dst;
    output->len  = (u32)len;
    return SEA_OK;
}

// Then: register in sea_tools.c, add to Makefile, make all
API Reference

Public Header API

12 headers. Every struct, enum, and function signature documented.

HeaderPurposeKey FunctionsTests
sea_types.hFoundation types, error codessea_slice_eq(), sea_error_str()-
sea_arena.hArena allocator (mmap)create, alloc, push, reset, destroy9
sea_log.hStructured loggingsea_log_init(), SEA_LOG_INFO()-
sea_json.hZero-copy JSON parserparse, get, get_string, get_number17
sea_shield.hGrammar filtervalidate, check, detect_injection19
sea_http.hHTTP client (libcurl)get, post_json, post_json_auth-
sea_db.hSQLite databaseopen, close, log_event, chat_log10
sea_config.hJSON config loaderload, defaults, print6
sea_tools.hTool registryinit, exec, by_name, by_id, list-
sea_agent.hLLM agent loopinit, chat, build_system_prompt-
sea_telegram.hTelegram botinit, poll, send, get_me-
sea_a2a.hAgent-to-Agentdelegate, heartbeat, discover-
Security

6-Layer Defense Model

Every byte is validated before it touches the engine. No exceptions.

1

Grammar Filter

Every input byte checked against charset bitmap (<1ฮผs)

2

Injection Detector

Pattern matching for $(cmd), `cmd`, ; rm, | cat, etc.

3

Tool-Level Validation

Each tool validates its own arguments. File paths checked by Shield.

4

Static Tool Registry

No eval(), no exec(), no dynamic loading. Function pointers only.

5

Arena Memory Safety

No malloc/free. No use-after-free. No double-free. Bounds checked.

6

A2A Output Verification

Remote agent responses Shield-validated before use.

Memory Model

Zero Malloc. Zero Leaks.

Two arenas, one pointer move to reset. Deterministic performance.

Session Arena

16 MB

Long-lived data: config strings, system prompt. Lives for program lifetime.

Request Arena

1 MB

Per-request: tool output, JSON parsing, HTTP responses. Reset after each message.

Per-Request Memory Cycletext
1. Message arrives (Telegram or TUI)
2. All processing uses request_arena
3. Tool outputs, JSON parsing, HTTP responses โ†’ arena
4. Response sent back to user
5. sea_arena_reset(&request_arena)  // ONE instruction
6. All memory from steps 2-4 instantly reclaimed

Why no malloc:
  โœ“ No memory leaks possible
  โœ“ No use-after-free possible
  โœ“ No fragmentation
  โœ“ No GC pauses
  โœ“ Arena reset is O(1)