erg.
autonomous coding daemon

workflow-driven.

Autonomous daemon for Claude Code. Polls GitHub, Asana, or Linear for issues, starts containerized Claude sessions, and drives the full PR lifecycle — as automated as your workflow allows.

How it works

At its core, erg is a state machine engine paired with AI coding. Each issue becomes a work item that advances through a configurable flowchart of states — from AI-generated code to a merged PR. You define exactly how much automation applies: require human review, auto-merge after CI, loop back for fixes, or notify external systems at any step.

  1. Tag or label an issue

    Mark a task in GitHub, Asana, or Linear with the configured trigger label (e.g. plan or queued).

  2. Daemon picks it up

    erg starts a containerized Claude session. With planning enabled, no branch is created yet — Claude reads the codebase in read-only mode.

  3. Claude analyzes and posts a plan

    The ai.plan session explores the codebase and posts a structured implementation plan as an issue comment — no code written yet.

  4. You review and approve

    Reply with approval (e.g. "LGTM") to proceed, or leave feedback. Claude revises the plan and loops back until you approve.

  5. Claude writes the code

    Once approved, ai.code creates a branch, implements the changes, runs tests, and commits.

  6. State machine advances

    The workflow engine opens a PR, waits for CI, handles review feedback, and merges — automatically, according to your rules.

Installation

$ brew install zhubert/tap/erg

Or build from source: go build -o erg .

Quick start

Run erg configure inside your repo. It will walk you through choosing an issue provider (GitHub, Asana, or Linear), configuring credentials, and scaffolding a workflow — then start the daemon.

$ erg configure

File layout

Erg stores configuration, session data, and logs under ~/.erg/ by default. If ~/.erg/ does not exist, Erg respects the XDG Base Directory Specification:

Data type Default path XDG override
Config (config.json) ~/.erg/ $XDG_CONFIG_HOME/erg/
Session data ~/.erg/sessions/ $XDG_DATA_HOME/erg/sessions/
Logs & state ~/.erg/logs/ $XDG_STATE_HOME/erg/logs/
made by zack · mit license