Skip to content
/

thClaws

thclaws · thClaws/thClaws · ★ 1.0k · last commit 2026-05-26

One native Rust binary that is a complete sovereign AI agent workspace — GUI, CLI, webapp, scheduler, knowledge base, and multi-agent orchestration — without cloud dependencies.

Best whenOpen standards (AGENTS.md, SKILL.md, CLAUDE.md) with sovereign local execution: the agent workspace should not phone home, and your API keys should live in t…
Skip ifStoring API keys in config files, Cloud-only operation
vs seeds
agent-osto claude-flow in ambition (full agent OS, multi-agent, multi-model) but implemented as a native Rust binary instead of …
Primitive shape 28 total
Commands 20 Hooks 8
00

Summary

thClaws — Summary

thClaws is a native-Rust AI agent workspace built by ThaiGPT Co., Ltd. that runs entirely on-device as a single binary across macOS, Windows, and Linux. It provides four interaction surfaces from the same execution engine: a desktop GUI (Tauri-based with Terminal, Chat, Files, and optional Team tabs), a CLI REPL, a non-interactive one-shot mode, and a self-served webapp for SSH-tunneled remote access. thClaws is multi-provider (Anthropic, OpenAI, Gemini, Qwen, DeepSeek, Ollama, 20+ providers), multi-modal (PDF/DOCX/PPTX/XLSX + image rendering), and ships with a comprehensive knowledge base system (KMS), a three-tier agent orchestration model (Task tool subagents, user-driven side-channel agents, Agent Teams in tmux panes), an eight-event lifecycle hook system, a skill+plugin system, and a built-in /dream feature that uses a side-channel agent to consolidate the KMS from session history. It is the only framework in this batch that implements a native daemon (launchd/systemd-user) for scheduled agents that survive reboots, and one of the few that explicitly adopts open-standard portable formats (AGENTS.md, SKILL.md, CLAUDE.md, .mcp.json).

differs_from_seeds: thClaws most closely resembles claude-flow (own runtime, multi-agent orchestration, multiple surfaces, rich feature set) but is written in Rust and ships as a single native binary instead of an npm package. Unlike claude-flow's 305-tool MCP server, thClaws has no bundled MCP server — it is an MCP client. Unlike all seeds, thClaws ships a Tauri desktop GUI alongside the CLI. The three-tier agent orchestration (Task / side-channel / Agent Teams), the /dream KMS consolidation, the native daemon scheduling, and the full 24-chapter user manual position thClaws as a full agent operating system rather than a development tool plugin.

01

Overview

thClaws — Overview

Origin

thClaws is developed by ThaiGPT Co., Ltd. and published under a dual MIT/Apache-2.0 license. The client is free and open source; enterprise edition, hosting, and support are commercial offerings via agentic-press.com. Named with a Thai-language reference (ThaiGPT's home country), it includes a full user manual in both English and Thai (ภาษาไทย).

Philosophy

From the README:

"Native Rust, multi-provider, runs on your own machine. Sovereign by design."

Key philosophical positions:

"Any knowledge worker, not just engineers. Chat tab for researchers, PMs, ops, legal, marketing, finance — natural-language prompts, file access, knowledge-base lookup, drafting. Terminal tab for engineers who want the raw REPL. Same engine, same sessions, same config — different preferred surface."

"Open standards, not a walled garden. Built on the conventions the agent-tooling industry is converging on, not bespoke formats you have to learn only for us. AGENTS.md for project instructions — the vendor-neutral standard adopted by Google, OpenAI, Factory, Sourcegraph, and Cursor. SKILL.md with YAML frontmatter for packaged workflows."

"API keys are never stored in config files — only in the OS keychain (default) or .env."

Distinctive Design Points

  1. Single binary — one Rust binary powers CLI, GUI, and web server
  2. Sovereign — offline capable via Ollama, no cloud dependency
  3. Open standardsAGENTS.md, SKILL.md, CLAUDE.md, .mcp.json all honored
  4. KMS (Knowledge Management System) — no-embeddings grep+read wiki inspired by Andrej Karpathy's LLM-wiki pattern
  5. /dream — background side-channel agent that mines sessions and consolidates KMS
  6. Plan mode — agent proposes ordered steps for user approval before execution
  7. Native daemonlaunchd/systemd-user for reboot-surviving scheduled agents
02

Architecture

thClaws — Architecture

Distribution

  • Type: Native binary (Rust, single executable)
  • Platforms: macOS (Apple Silicon + Intel), Windows (x86_64 + ARM64), Linux (x86_64 + ARM64)
  • License: MIT OR Apache-2.0 (dual)
  • Install: Pre-built binaries from GitHub Releases or thclaws.ai/downloads; build from source with cargo build --release

Build Requirements

  • Rust 1.85+
  • Node.js 20+, pnpm 9+ (for frontend build)
  • Frontend: React + Vite, bundled as a single HTML file

Four Execution Surfaces

Surface Command UI
Desktop GUI thclaws Tauri native window (Terminal + Chat + Files + Team tabs)
CLI REPL thclaws --cli Interactive terminal prompt
Non-interactive thclaws -p "prompt" Stdout; -v adds token usage to stderr
Webapp thclaws --serve --port 7878 WebSocket/HTTP; remote via SSH tunnel

Directory Layout (Rust crate)

crates/core/src/
├── agent.rs          # Core agent loop
├── agent_runtime.rs  # Agent runtime management
├── agent_defs.rs     # Agent definition types
├── hooks.rs          # 8-event lifecycle hook system
├── skills.rs         # Skill discovery and loading
├── schedule.rs       # Cron/interval/watchdir scheduler
├── kms.rs            # Knowledge management system
├── mcp.rs            # MCP client (stdio + HTTP Streamable + OAuth 2.1)
├── plugins.rs        # Plugin system
├── team.rs           # Agent Teams (tmux panes + shared mailbox)
├── subagent.rs       # Task tool subagents
├── side_channel.rs   # User-driven concurrent side-channel agents
├── memory.rs         # Persistent memory (user/feedback/project/reference)
├── session.rs        # JSONL session files
├── compaction.rs     # Context compaction
├── schedule.rs       # Cron/interval/watchdir scheduler + daemon
├── permissions.rs    # Safety rules + approval flows
└── frontend/         # Tauri webview (React app)

Config Files (priority order)

  1. CLI flags
  2. .thclaws/settings.json (project)
  3. ~/.config/thclaws/settings.json (user)
  4. ~/.claude/settings.json (fallback)
  5. Compiled-in defaults

Open Standard Files Honored

  • CLAUDE.md / AGENTS.md — injected into system prompt (walked up from cwd)
  • .thclaws/skills/ / .claude/skills/ — skill catalog
  • .thclaws/agents/ / .claude/agents/ — subagent definitions
  • .mcp.json / .thclaws/mcp.json — MCP server configuration
  • .thclaws-plugin/plugin.json / .claude-plugin/plugin.json — plugin manifest
03

Components

thClaws — Components

Slash Commands (REPL + GUI)

Command Purpose
/help List all commands
/model <name> Switch model mid-session
/provider <name> Switch provider mid-session
/models List available models
/kms List attached knowledge bases
/skill install <url> Install skill from git URL or .zip
/mcp add <name> <url> Add MCP server
/agent <name> <prompt> Spawn user-driven side-channel agent
/agents List active background agents
/dream Run KMS consolidation in background
/schedule add --cron "..." "task" Add scheduled agent
/schedule run Run scheduled job manually
/plan Enter plan mode (propose steps → approve)
/loop Fixed-interval iteration
/goal --auto Ralph-style autonomous until-done loop
/plugin install <url> Install plugin bundle
/resume last / --resume <id> Resume a session
! <command> Shell escape (no agent round-trip)

Hooks (8 events)

From hooks.rs:

pre_tool_use
post_tool_use
post_tool_use_failure
permission_denied
session_start
session_end
pre_compact
post_compact

Each hook is a shell command in settings.json. Fire-and-forget with SIGKILL on timeout. Environment variables injected: THCLAWS_TOOL_NAME, THCLAWS_TOOL_INPUT, THCLAWS_TOOL_OUTPUT (truncated at 8KB).

Skills System

  • Format: directory with SKILL.md (YAML frontmatter + markdown) + optional scripts/
  • Discovery: 5 locations (user Claude Code, user thClaws, plugin-contributed, project Claude Code, project thClaws — last wins)
  • Trigger: automatic when task matches whenToUse field, or explicit /<skill-name>
  • Install: /skill install <git-url-or-zip>

KMS (Knowledge Management System)

  • Storage: .thclaws/kms/<name>/pages/ — markdown pages with index.md table of contents
  • Tools: KmsRead, KmsSearch, KmsWrite, KmsAppend, KmsDelete
  • Search: grep + read (no embeddings — Karpathy LLM-wiki pattern)
  • Auto-consolidation: /dream command

Subagents — Three Tiers

  1. Task tool subagents — model-driven, block parent, recurse up to 3 levels
  2. /agent side-channels — user-driven, parallel, fresh tokio task, cancel token, own history
  3. Agent Teams — multiple thClaws processes, shared mailbox, task queue, tmux panes, optional git worktrees

MCP Client

  • Protocols: stdio, HTTP Streamable
  • Authentication: OAuth 2.1 + PKCE for protected servers
  • Add: /mcp add or .mcp.json in project

Plugin System

Skills + commands + agent definitions + MCP servers bundled under a single manifest (plugin.json). Compatible with .claude-plugin/ format.

Scheduler

Three composable layers:

  1. Manual /schedule run
  2. In-process scheduler (lives as long as REPL)
  3. Native daemon (launchd on macOS / systemd-user on Linux) — survives reboots

Memory

Persistent memory store — facts classified as user / feedback / project / reference, stored as markdown files. Agent-readable and agent-writable.

Sessions

JSONL files under .thclaws/sessions/. Resume with --resume last or --resume <id>.

Document Tools

Native PDF, DOCX, PPTX, XLSX read + edit + create + image rendering — no file conversion subprocess.

05

Prompts

thClaws — Prompts

Prompt Architecture

thClaws assembles the system prompt from:

  1. AGENTS.md / CLAUDE.md files walked up from cwd
  2. KMS table of contents (injected every turn via hot cache)
  3. Skill content (lazy-loaded when task matches whenToUse)
  4. Memory store (user/feedback/project/reference facts)

Verbatim Excerpt 1 — Skills System (from hooks.rs docstring)

//! Configured in `~/.config/thclaws/settings.json` (user) or
//! `.thclaws/settings.json` (project):
//!
//! ```json
//! {
//!   "hooks": {
//!     "pre_tool_use":  "echo \"tool: $THCLAWS_TOOL_NAME\" >> /tmp/thclaws.log",
//!     "post_tool_use": "echo \"done: $THCLAWS_TOOL_NAME\" >> /tmp/thclaws.log",
//!     "session_start": "notify-send 'thClaws started'",
//!     "session_end":   "notify-send 'thClaws ended'",
//!     "timeout_secs":  5
//!   }
//! }
//! ```
//!
//! Hook commands run via `/bin/sh -c`. Hooks are fire-and-forget — the
//! agent loop does NOT wait for the hook to complete before proceeding.
//! A reaper task is spawned per child to call `wait()` so child processes
//! don't leak as zombies.

Technique: The hook configuration is the "prompt" for agent lifecycle events — shell scripts that run on specific events with injected environment variables. The THCLAWS_TOOL_NAME etc. pattern is analogous to Claude Code's PostToolUse hooks.

Verbatim Excerpt 2 — Skills SKILL.md format (from skills.rs docstring)

//! A skill is a directory containing:
//! - `SKILL.md` — YAML frontmatter (name, description, whenToUse) + markdown
//!   instructions that the model follows using its existing tools.
//! - `scripts/` (optional) — pre-built scripts (.py, .sh, .js, etc.) that
//!   the SKILL.md references. The model calls them via Bash, not writes them.
//!
//! Discovery locations (in order; later wins on name collision):
//! 1. `~/.claude/skills/` (user Claude Code)
//! 2. `~/.config/thclaws/skills/` (user thClaws)
//! 3. plugin-contributed skill dirs
//! 4. `.claude/skills/` (project Claude Code)
//! 5. `.thclaws/skills/` (project thClaws — highest priority)
//!
//! The `Skill` tool returns the SKILL.md content with `{skill_dir}` replaced
//! by the absolute path to the skill directory, so script paths resolve.

Technique: The {skill_dir} variable substitution is a prompting technique that converts relative paths in SKILL.md into absolute paths at runtime — ensuring the model can call scripts without knowing where the skill is installed.

KMS Table of Contents (injected every turn)

The KMS hot cache inserts a table of contents of all wiki pages into the system prompt on every turn. This is a passive context injection pattern: the model always knows what knowledge is available without the user referencing it explicitly.

/dream Consolidation Prompt

The /dream command runs a side-channel agent that reads the 10 most recent sessions, dedupes KMS pages, surfaces new insights, and writes a dated audit-trail page. The prompt for this agent is generated programmatically (not stored as a SKILL.md file visible in the repo's public surface).

09

Uniqueness

thClaws — Uniqueness

differs_from_seeds

thClaws is closest to claude-flow in ambition (full agent OS, multi-agent, multi-model, rich feature set) but diverges in nearly every implementation choice. claude-flow is an npm package that bundles a 305-tool MCP server and stores state in SQLite; thClaws is a single native Rust binary that acts as an MCP client with no bundled server, stores sessions in JSONL files and KMS in plain markdown. The three-tier orchestration (Task / side-channel / Agent Teams) is more sophisticated than any seed — even claude-flow's hive-mind only has two levels. The native daemon scheduling (launchd/systemd-user) for reboot-surviving agents is absent from all 11 seeds. The /dream autonomous KMS consolidation is a unique feature not found in any seed. The open-standards portability (AGENTS.md, SKILL.md, CLAUDE.md, .mcp.json all honored) means thClaws works as a drop-in for any project already using Claude Code's conventions. Unlike kiro (the only seed with a desktop UI), thClaws is fully open-source with no proprietary IDE fork.

Most Distinctive Features

  1. Native Rust single binary — no npm, no Python, no Docker required
  2. Three-tier agent orchestration — Task subagents + side-channels + Agent Teams (tmux + git worktrees)
  3. Native daemon scheduling — launchd/systemd-user for reboot-surviving agents
  4. /dream — autonomous KMS consolidation from session history
  5. No-embeddings KMS — grep+read wiki (Karpathy pattern) rather than vector DB
  6. OS keychain secrets — API keys never in config files
  7. Open standards — reads Claude Code, Codex, Cursor project conventions without adapter

Observable Failure Modes

  • Thai-origin codebase: Development team is Thai; some documentation may be primarily maintained in Thai context first (user manual has Thai version)
  • 0.0.x release maturity: The README describes pre-production status despite the extensive feature list
  • GUI Linux dependency: Linux GUI requires Wayland + webkit2gtk; headless servers need CLI mode or manual dep install
  • Commercial Enterprise Edition: Some features (deploy, hosting integration) require Agentic Press commercial offerings
  • No TDD enforcement: No built-in test-first gates or auto-test runners
  • Team coordination complexity: Agent Teams require tmux + manual worktree management — high setup friction
04

Workflow

thClaws — Workflow

Standard Development Workflow

Phase Description Artifact
1. Session start thclaws or thclaws --cli Shell/GUI opens; AGENTS.md injected
2. Model/provider config /provider anthropic && /model claude-sonnet-4-6 Provider configured
3. Task entry Natural language prompt in REPL or Chat tab Agent loop starts
4. Plan mode (optional) /plan — agent proposes ordered steps Plan with step list
5. User approval Approve / Cancel / Skip / Retry per step (GUI sidebar or REPL) Approved plan
6. Tool execution Agent calls Bash, Read, Write, Edit, etc. Tool results
7. Permission gate Each mutating tool requires approval (unless auto-approve) Decision logged
8. Session save JSONL auto-saved to .thclaws/sessions/ Session file
9. KMS update Agent writes notes; /dream consolidates Updated KMS pages
10. Session resume thclaws --resume last Context restored

Long-Running Workflows

Mode Command Behavior
Scheduled job /schedule add --cron "0 9 * * MON-FRI" "..." Runs at cron time
Interval loop /loop Repeats at fixed interval
Goal-driven loop /goal --auto Runs until audit prompt confirms "done"
Daemon thclaws setup service Native launchd/systemd-user; survives reboot

Agent Team Workflow

  1. Lead agent starts in first tmux pane, optional git worktree
  2. Spawns teammate agents (each in own pane + worktree)
  3. Communicate via shared mailbox + task queue
  4. Lead merges branches when all done

Approval Gates

  • Per-tool approval: every mutating tool call requires explicit user approval (configurable to auto-approve per tool type)
  • Plan mode approval: per-step Approve / Cancel / Skip / Retry before execution
  • Destructive shell: flagged before execution
  • Side-channel labeling: permission requests label which agent is asking (main vs subagent vs side-channel)
06

Memory Context

thClaws — Memory & Context

Memory Architecture

thClaws has a multi-tier memory system:

Tier Storage Scope Description
Session (JSONL) .thclaws/sessions/ Session Full conversation history, resumable
Persistent memory .thclaws/memory/ Global/user Facts classified as user/feedback/project/reference (markdown files)
KMS (wiki) .thclaws/kms/<name>/pages/ Project Markdown pages with [[links]], indexed by index.md
AGENTS.md/CLAUDE.md Project root (walked up) Project System prompt additions for current project

KMS Hot Cache

The KMS table of contents is injected into every system prompt turn automatically. This means the model always knows what knowledge pages exist — it can call KmsRead to fetch any page's content on demand.

/dream — Autonomous KMS Consolidation

The /dream command spawns a background side-channel agent that:

  1. Reads the 10 most recent sessions
  2. Mines insights and facts from conversations
  3. Deduplicates existing KMS pages
  4. Writes new knowledge pages
  5. Creates a dated audit-trail page with git diff-friendly output

This is the "dreaming" metaphor — the agent learns from experience while you're not using it.

Context Compaction

Built-in compaction when context grows large. The README mentions compaction.rs as a dedicated module. Sessions are compacted and the JSONL file is updated in-place.

Cross-Session Handoff

Yes — --resume last or --resume <id> restores the full JSONL session including conversation history and tool call results.

Memory Types

  • user — facts about the user
  • feedback — notes from the user about agent behavior
  • project — project-specific technical facts
  • reference — reference material the agent has learned

All stored as markdown files in .thclaws/memory/ — git-friendly, grep-friendly, never opaque.

State Files

  • .thclaws/sessions/ — JSONL conversation files
  • .thclaws/memory/ — persistent memory (markdown)
  • .thclaws/kms/ — knowledge base pages
  • .thclaws/settings.json — project configuration
07

Orchestration

thClaws — Orchestration

Three-Tier Agent Orchestration

Tier 1: Task Tool Subagents (model-driven)

  • Spawned by the model via the Task tool
  • Each gets its own tool registry
  • Blocks the parent's turn
  • Recurse up to 3 levels deep
  • Spawn mechanism: own runtime (Rust async task)

Tier 2: /agent Side-Channel (user-driven)

  • Spawned explicitly by the user: /agent <name> <prompt>
  • Runs on a fresh tokio task, parallel with main
  • Never enters main's conversation history
  • Has its own cancel token
  • Use case: "I know exactly what I want a specialist to do"

Tier 3: Agent Teams (multi-process)

  • Multiple thClaws processes coordinating through a shared mailbox and task queue
  • Each in its own tmux pane and optional git worktree
  • Lead agent merges branches when all teammates finish

Execution Mode

  • Primary: interactive-loop (user prompts, agent responds)
  • Long-running: continuous-ralph via /goal --auto (runs until goal is satisfied)
  • Scheduled: scheduled via /schedule add --cron "..." with native daemon support
  • One-shot: thclaws -p "prompt"

Isolation Mechanism

  • Process-level: Each subagent/side-channel runs in its own tokio task
  • Git worktree: Agent Teams use per-agent worktrees for parallel development
  • Filesystem sandbox: File tools scoped to working directory by default

Multi-Model

Yes — model can be switched mid-session with /model or /provider. Subagent definitions can specify a different model.

Providers: Anthropic (native + Claude Agent SDK), OpenAI (Chat Completions + Responses/Codex), Google Gemini/Gemma, Alibaba DashScope (Qwen), DeepSeek, Z.ai (GLM), NVIDIA NIM, NSTDA Thai LLM (OpenThaiGPT, Typhoon, Pathumma, THaLLE), OpenRouter, Agentic Press, Azure AI Foundry, Ollama (local + cloud), LMStudio, generic OpenAI-compatible (oai/*).

Orchestration Pattern

hierarchical — Task tool subagents form a 3-level deep tree; side-channel agents are parallel peers; Agent Teams are peer processes.

Plan Mode

/plan enters plan mode:

  • Agent proposes an ordered list of steps
  • User reviews: Approve / Cancel / Skip / Retry per step
  • Each step runs sequentially with its own retry budget
  • Failures stop the chain

Same UX in GUI (sidebar) and REPL (/plan command).

Hooks (8 lifecycle events)

pre_tool_use
post_tool_use
post_tool_use_failure
permission_denied
session_start
session_end
pre_compact
post_compact

Shell scripts triggered by events — can auto-run linters, send notifications, log to audit files.

Consensus Mechanism

None formally. Agent Teams coordinate via shared mailbox/task queue, not consensus algorithms.

08

Ui Cli Surface

thClaws — UI / CLI Surface

CLI Binary

Yesthclaws binary.

Mode Command Description
Desktop GUI thclaws Tauri native window
CLI REPL thclaws --cli Interactive terminal
One-shot thclaws -p "prompt" Non-interactive, stdout output
Webapp thclaws --serve --port 7878 HTTP/WebSocket server
Resume thclaws --resume last or --resume <id> Continue prior session

Desktop GUI (Tauri)

Native window with four tabs:

  1. Terminal — REPL prompt with slash commands + ANSI tool output
  2. Chat — conversational interface with markdown rendering
  3. Files — CodeMirror + TipTap file editor with file tree browser
  4. Team (optional) — Agent Teams coordination panel

Tech stack: Tauri (Rust backend) + React + Vite frontend (bundled as single HTML file).

Webapp Mode

thclaws --serve --port 7878 exposes the same engine over WebSocket/HTTP. Accessible remotely via SSH tunnel (ssh -L 7878:localhost:7878 user@remote). No public port required. Described as "Claude Code anywhere."

No Web Dashboard (separate)

The webapp mode IS the dashboard. There's no separate admin panel or observability dashboard.

IDE Integration

None. No VSCode extension, no cursor plugin. The AGENTS.md / CLAUDE.md standard files are compatible with other tools that read them.

Observability

  • Session JSONL files are the audit trail (grep-friendly)
  • Hook system can log to any file via shell scripts
  • No built-in metrics dashboard

Shell Escape

Prefix any REPL line with ! to run a shell command without agent involvement:

! git status
! ls -la

Key Secret Management

API keys stored in OS keychain (macOS Keychain / Windows Credential Manager / Linux Secret Service) by default. .env fallback for CI. Never in config files.

Related frameworks

same archetype · same primary tool · same memory type

claude-mem (thedotmack) ★ 78k

Background worker service captures every tool call as an observation, AI-compresses sessions, and auto-injects relevant past…

pi (badlogic/earendil) ★ 55k

A minimal, hackable, multi-provider terminal coding agent that adapts to your workflows via npm-installable TypeScript Extensions…

Agent Skills (Addy Osmani) ★ 46k

Encodes senior-engineer software development lifecycle as 23 auto-routed skills and 7 slash commands for any AI coding agent.

wshobson/agents Plugin Marketplace ★ 36k

Single Markdown source for 83 domain-specialized plugins that auto-generates idiomatic artifacts for five AI coding harnesses.

TabbyML/Tabby ★ 34k

Self-hosted AI coding assistant server (alternative to GitHub Copilot) with admin dashboard, RAG-based completions, and multi-IDE…

Compound Engineering ★ 17k

Make each unit of engineering work compound into easier future work via brainstorm→plan→execute→review→learn cycles.