You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-49Lines changed: 24 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,53 +12,28 @@ Clayde is a persistent autonomous AI software agent that lives on a dedicated VM
12
12
13
13
Clayde is assigned GitHub issues in software repositories. For each issue it:
14
14
15
-
1.Researches the codebase and writes a **preliminary plan**, posting it as a GitHub comment
16
-
2.Waits for human approval (a 👍 reaction) before continuing
17
-
3.For **large issues**: writes a **detailed implementation plan** and posts it as another comment, then waits for approval again before touching any code. For **small issues**: skips directly to implementation after preliminary approval.
18
-
4.Implements the solution on a new branch, opens a pull request, and posts a summary comment
19
-
5.Addresses any review comments left on the PR
15
+
1.Checks for new whitelist-visible activity since its last access
16
+
2.Invokes Claude with the full issue context — Claude decides what to do next: ask clarifying questions, post a plan, implement the solution, or address review comments
17
+
3.Posts a summary commentafter each work cycle
18
+
4.Opens a pull request (Claude creates the PR directly with a description and, for diffs spanning more than 3 files, a recommended reading order) and assigns the issue author as reviewer
19
+
5.Monitors the PR and addresses review comments when they appear
20
20
21
-
At any point while waiting for approval, new comments on the issue will trigger a plan update — Clayde revises the plan and posts a summary of what changed.
22
-
23
-
Clayde runs as a Docker container in a continuous loop (default: every 5 minutes), driven by a state machine persisted in `data/state.json`.
21
+
Clayde runs as a Docker container in a continuous loop (default: every 5 minutes). Rather than a rigid state machine, it uses **timestamp-based activity detection**: each issue records the last time it was processed, and only new visible activity since that timestamp triggers a new Claude invocation.
pr_open --> addressing_review: review comments received
43
-
addressing_review --> pr_open
44
-
pr_open --> done: PR approved
45
-
implementing --> failed: error
46
-
done --> [*]
47
-
failed --> [*]
48
-
```
25
+
## How It Works
49
26
50
-
| State | Description |
51
-
|---|---|
52
-
|`preliminary_planning`| Claude explores the codebase and writes a short overview with clarifying questions |
53
-
|`awaiting_preliminary_approval`| Preliminary plan posted; waiting for 👍 from an approver. New comments trigger a plan update. Small issues skip to `implementing` on approval; large issues proceed to `planning`. |
54
-
|`planning`| Claude writes a detailed implementation plan |
55
-
|`awaiting_plan_approval`| Full plan posted; waiting for 👍 from an approver. New comments trigger a plan update. |
56
-
|`implementing`| Claude implements the solution on a new branch |
57
-
|`pr_open`| PR opened; monitoring for review comments |
58
-
|`addressing_review`| Claude is addressing PR review comments |
59
-
|`done`| PR approved; issue complete |
60
-
|`failed`| Error occurred; requires manual reset to retry |
61
-
|`interrupted`| Claude hit a usage/rate limit; retried automatically next cycle |
27
+
Clayde's loop is event-driven and stateless by design:
28
+
29
+
1.**Fetch assigned issues** from GitHub.
30
+
2.**For each issue**: check whether there is new whitelist-visible activity (comments or PR reviews) since `last_seen_at`. If the issue has never been seen, or a previous run was interrupted, it is always processed.
31
+
3.**Invoke Claude once** with the full context: issue body, all visible comments, and any open PR reviews. Claude decides the next action — no hard phases.
32
+
4.**Detect PR**: after each run, check for an open PR on the working branch and persist its URL.
33
+
5.**Update `last_seen_at`** to the current time so Clayde's own reply comments don't re-trigger a cycle.
34
+
6.**Crash recovery**: `in_progress` is set before invoking Claude and cleared after. If the process crashes mid-run, the next cycle retries automatically.
35
+
7.**Pure PR approvals** (no comments) update `last_seen_at` without invoking Claude.
36
+
8.**Closed issues** are pruned from state automatically.
62
37
63
38
---
64
39
@@ -70,10 +45,7 @@ Clayde uses **content filtering** rather than gatekeeping which issues to work o
70
45
- If an issue has no visible content at all, it is skipped.
71
46
- Blocked issues (those with "blocked by #N" or "depends on #N" in the body) are also skipped.
72
47
73
-
Two approval gates then guard forward progress:
74
-
75
-
1.**Preliminary plan approval** — a 👍 from a whitelisted user on the preliminary plan comment is required before the full plan is written.
76
-
2.**Plan approval** — a 👍 from a whitelisted user on the full plan comment is required before implementation begins.
48
+
There are no hard approval gates — Claude engages with the issue as soon as there is visible content, and the human can steer the conversation by replying in the issue thread.
77
49
78
50
Whitelisted users are configured via `CLAYDE_WHITELISTED_USERS` in `data/config.env`.
79
51
@@ -82,11 +54,14 @@ Whitelisted users are configured via `CLAYDE_WHITELISTED_USERS` in `data/config.
82
54
## Capabilities
83
55
84
56
-**Multi-repo support**: Clones and works on any GitHub repository it has access to
85
-
-**Two-phase planning**: Preliminary exploration followed by a detailed plan, each gated by human approval
86
-
-**Full issue lifecycle**: Plan → approval → implement → PR, with comments at each stage
57
+
-**Event-driven loop**: Only invokes Claude when there is new visible activity — no wasted cycles
58
+
-**Natural conversation**: Claude engages directly in the issue comment thread, asking questions and posting plans as needed
59
+
-**Full issue lifecycle**: Engage → implement → PR → review, all driven by new activity
60
+
-**PR creation by Claude**: Claude writes the PR description and a recommended reading order for larger diffs
87
61
-**PR review handling**: Reads and addresses reviewer feedback automatically
88
62
-**Rate-limit resilience**: Detects Claude usage limits and automatically retries
89
-
-**Safety gates**: Whitelist + approval checks prevent unauthorized work
63
+
-**Crash recovery**: `in_progress` flag ensures interrupted runs are retried next cycle
64
+
-**Safety filtering**: Whitelist-based content filtering prevents acting on unauthorized content
90
65
-**Observability**: OpenTelemetry tracing with JSONL file export
91
66
-**Dual Claude backend**: Use the Anthropic API (pay-per-token) or the Claude Code CLI (subscription-based)
0 commit comments