Skip to main content

Overview

NullClaw is built on a vtable-driven pluggable architecture where every subsystem implements a common interface pattern. This design enables zero-overhead abstraction with full runtime swappability — change any component via configuration, no code changes required.

Core Design Principles

1. Vtable Interface System

Every subsystem uses Zig’s type-erased interface pattern (vtable-based polymorphism):
This pattern provides:
  • Zero runtime overhead: Direct function pointers, no dynamic dispatch
  • Compile-time safety: Type checking at build time
  • Runtime flexibility: Swap implementations via config
  • No allocator overhead: Static vtables, minimal indirection

2. No Dependencies

NullClaw depends only on:
  • libc (standard C library)
  • sqlite (optional, for memory backends)
No VM, no runtime, no framework. The entire binary is 678 KB in release mode.

3. Static Binary

The entire runtime compiles to a single static binary:
  • Boots in <2 ms on Apple Silicon
  • Runs on $5 hardware (any ARM/x86/RISC-V board)
  • Deploys with scp — no installation, no package manager

Subsystem Table

Every subsystem implements a vtable interface:

Data Flow

Message Flow (Channel → Agent)

  1. Channel receives message (Telegram webhook, Discord WebSocket, CLI stdin, etc.)
  2. Channel vtable normalizes to ChannelMessage struct
  3. Gateway/Daemon routes to agent session
  4. Agent loop appends to conversation context
  5. Provider vtable sends to LLM API
  6. Response parsing extracts text/tool calls
  7. Tool dispatch executes via Tool vtable
  8. Memory storage persists via Memory vtable
  9. Outbound delivery via Channel.send()

Security Layers

Every request passes through:
  1. Pairing check (gateway authentication)
  2. Channel allowlist (sender validation)
  3. Workspace scoping (filesystem boundaries)
  4. Sandbox isolation (OS-level containment)
  5. Audit logging (signed event trail)
All subsystems are fail-safe by default: deny-by-default access, explicit opt-in for elevated permissions, structured error propagation.

Extension Points

Adding a New Provider

Adding a New Channel

Performance Characteristics

NullClaw’s vtable pattern has zero runtime overhead compared to direct function calls — the vtable is resolved at init time, then all calls are direct jumps.

Next Steps

Providers

Learn about AI model provider integration

Channels

Explore messaging platform channels

Tools

Understand tool execution system

Memory

Deep dive into memory backends