1 Clotho Agent
Claude edited this page 2026-02-20 01:39:42 +00:00

Clotho Agent (AU)

Clotho is an autonomous AI agent running on agent201 in Australia (Darbs' network). It picks up issues from forge.lthn.ai, clones repos, runs Claude/Gemini, and reports results.

Machine

Property Value
Hostname agent201
IP 192.168.0.201 (WireGuard)
SSH ssh clotho (from snider-linux)
Network WireGuard VPN to gateway (10.69.69.87)
Latency ~335ms to UK servers
PHP 8.3.6
Go 1.24
Node 22.22.0
Composer installed
Task installed
Docker running

Architecture

                forge.lthn.ai (Germany)
                      |
        poll-forge.sh (every 5 min)
         polls for issues labeled "clotho"
                      |
                      v
            ~/ai-work/queue/ticket-*.json
                      |
        agent-runner.sh (every 5 min)
         picks oldest ticket, clones repo, runs AI
                      |
                      v
            Claude/Gemini executes in repo dir
                      |
                      v
            Comments result on issue, moves ticket to done/

Key Scripts

Script Schedule Purpose
poll-forge.sh */5 * * * * (offset 30s) Polls forge.lthn.ai for issues labeled "clotho" or "clotho-gemini"
agent-runner.sh */5 * * * * Processes one ticket at a time, runs Claude or Gemini

Ticket Format

{
  "repo_owner": "core",
  "repo_name": "php-framework",
  "issue_number": 1,
  "issue_title": "audit: review module boot system",
  "target_branch": "dev",
  "forge_url": "https://forge.lthn.ai",
  "model": "sonnet",
  "runner": "claude"
}

Runners

Label Runner Model
clotho claude sonnet
clotho-gemini gemini gemini-3-pro-preview

Credentials

Credential Source Purpose
FORGE_TOKEN_PROD ~/.env or Proton Pass (Clotho vault) forge.lthn.ai API access
GEMINI_API_KEY ~/.env Gemini runner
SSH key ~/.ssh/id_ed25519 Git clone from forge.lthn.ai:2223
Forgejo MCP token ~/.claude/settings.json darbs.lthn.ai MCP server

Directory Layout

~/ai-work/
  queue/          # Incoming tickets (JSON)
  active/         # Currently processing (1 at a time)
  done/           # Completed tickets
  queue-hold/     # Parked tickets (e.g., Go audit tickets)
  logs/           # Per-ticket execution logs
  jobs/           # Cloned repo working directories
  agent-runner.sh
  poll-forge.sh
  .env
  .runner.lock

PHP Repos on forge.lthn.ai

Clotho's primary focus is the CorePHP framework modules under core/:

Repo Type Description
core/php-framework foundation Events, modules, lifecycle, frontages
core/php-tenant module Multi-tenancy, workspaces, users
core/php-admin module Admin panel, Livewire, Flux UI
core/php-api module REST API, webhooks
core/php-content module CMS, pages, blog
core/php-commerce module Billing, Stripe
core/php-mcp module MCP server framework
core/php-agentic module AI agent orchestration
core/php-developer module Developer tools
core/php-devops module DevOps tooling
core/php-template module Templates
core/php-uptelligence module Analytics
core/php go-cli Go package: PHP CLI commands

All repos have CLAUDE.md files guiding the agent. Work branches from dev.

Dispatching Work

To dispatch work to Clotho:

  1. Create an issue on any core/php-* repo on forge.lthn.ai
  2. Add the clotho label (or clotho-gemini for Gemini runner)
  3. The poller picks it up within 5 minutes
  4. The runner clones, executes, and comments results

DNS Configuration

Clotho routes *.lthn.ai, *.lthn.io, *.leth.in DNS queries through gateway CoreDNS (10.69.69.87) via the WireGuard tunnel. Config at /etc/systemd/network/50-gateway-dns.network.

Local Forgejo (clotho.lthn.io)

A local Forgejo instance runs on agent201 with 49 mirrors from forge.lthn.ai. This is a read-only cache — the agent-runner works directly from forge.lthn.ai, not from the local mirrors.

Clotho Protocol (AgentCI)

The Clotho Protocol in go-scm/agentci/ provides optional dual-run verification:

  • Standard mode: Single agent run (default)
  • Dual mode: Primary run + secondary "signed" verification with a different model
  • Dual mode activates for critical repos (core, *security*) when strategy is clotho-verified

See go-scm/agentci/clotho.go for the Spinner implementation.