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
+72-70Lines changed: 72 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,13 @@ 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 to understand the context
16
-
2. Writes an implementation plan and posts it as a GitHub comment
17
-
3. Waits for human approval (a 👍 reaction)
18
-
4. Implements the solution on a new branch
19
-
5. Opens a pull request and posts a summary comment
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
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.
20
22
21
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`.
22
24
@@ -26,45 +28,66 @@ Clayde runs as a Docker container in a continuous loop (default: every 5 minutes
26
28
27
29
Each issue moves through the following states:
28
30
29
-
```
30
-
(new issue) ──► planning ──► awaiting_approval ──► implementing ──► done
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 --> [*]
32
48
```
33
49
34
50
| State | Description |
35
51
|---|---|
36
-
|`planning`| Claude is researching and writing a plan |
37
-
|`awaiting_approval`| Plan posted as comment; waiting for 👍 from an approver |
38
-
|`implementing`| Claude is implementing the solution |
39
-
|`done`| PR opened; issue complete |
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 |
40
60
|`failed`| Error occurred; requires manual reset to retry |
41
61
|`interrupted`| Claude hit a usage/rate limit; retried automatically next cycle |
42
62
43
63
---
44
64
45
-
## Safety Gates
65
+
## Safety & Content Filtering
46
66
47
-
Two independent checks must pass before any work begins:
67
+
Clayde uses **content filtering** rather than gatekeeping which issues to work on. It will only act on content that is visible:
48
68
49
-
**1. Issue-level gate** (before planning)
50
-
The issue must be created by a whitelisted user, or have a 👍 reaction from a whitelisted user on the issue itself.
69
+
- An issue body or comment is **visible** if it was written by a whitelisted user, or has a 👍 reaction from a whitelisted user.
70
+
- If an issue has no visible content at all, it is skipped.
71
+
- Blocked issues (those with "blocked by #N" or "depends on #N" in the body) are also skipped.
51
72
52
-
**2. Plan approval gate** (before implementation)
53
-
The plan comment must have a 👍 reaction from any whitelisted user.
73
+
Two approval gates then guard forward progress:
54
74
55
-
Whitelisted users are configured via `CLAYDE_WHITELISTED_USERS` in `data/config.env`.
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.
56
77
57
-
This two-tier system ensures Clayde only acts on trusted issues and only implements plans that have been explicitly reviewed and approved.
78
+
Whitelisted users are configured via `CLAYDE_WHITELISTED_USERS` in `data/config.env`.
58
79
59
80
---
60
81
61
82
## Capabilities
62
83
63
84
-**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
64
86
-**Full issue lifecycle**: Plan → approval → implement → PR, with comments at each stage
87
+
-**PR review handling**: Reads and addresses reviewer feedback automatically
65
88
-**Rate-limit resilience**: Detects Claude usage limits and automatically retries
66
89
-**Safety gates**: Whitelist + approval checks prevent unauthorized work
67
-
-**Observability**: OpenTelemetry tracing with JSONL file export and optional OTLP export
90
+
-**Observability**: OpenTelemetry tracing with JSONL file export
68
91
-**Dual Claude backend**: Use the Anthropic API (pay-per-token) or the Claude Code CLI (subscription-based)
69
92
70
93
---
@@ -87,16 +110,34 @@ This two-tier system ensures Clayde only acts on trusted issues and only impleme
87
110
88
111
## Setup
89
112
90
-
### 1. Create the data directory
113
+
### 1. Create a dedicated bot GitHub account
114
+
115
+
Create a GitHub account for your bot (e.g. `my-bot`). This is the account that will be assigned issues and open pull requests.
116
+
117
+
### 2. Create a GitHub Personal Access Token for the bot
118
+
119
+
From the bot account, create a classic personal access token with the full **`repo`** scope.
120
+
121
+
### 3. Configure the instance
91
122
92
123
```bash
93
124
mkdir -p data/logs data/repos
94
125
cp config.env.template data/config.env
95
126
```
96
127
97
-
Edit `data/config.env` and fill in the required values (see Configuration below).
128
+
Edit `data/config.env`:
98
129
99
-
### 2. Choose a Claude backend
130
+
```
131
+
CLAYDE_GITHUB_TOKEN=github_pat_...
132
+
CLAYDE_GITHUB_USERNAME=my-bot
133
+
CLAYDE_GIT_EMAIL=my-bot@example.com
134
+
CLAYDE_ENABLED=true
135
+
CLAYDE_WHITELISTED_USERS=your-username,my-bot
136
+
```
137
+
138
+
See [Configuration](#configuration) for all available settings.
139
+
140
+
### 4. Choose a Claude backend
100
141
101
142
Clayde supports two backends for invoking Claude, selected by `CLAYDE_CLAUDE_BACKEND` in `data/config.env`:
102
143
@@ -127,13 +168,17 @@ Runs the Claude Code CLI as a subprocess. Uses your Claude Pro/Max subscription
127
168
128
169
The `docker-compose.yml` mounts `~/.claude/.credentials.json` from the host directly into the container. Token refreshes, logouts, and account switches on the host are immediately reflected.
129
170
130
-
### 3. Start the container
171
+
### 5. Start the container
131
172
132
173
```bash
133
174
docker compose up -d
134
175
```
135
176
136
-
Clayde will start its loop, checking for assigned issues every 5 minutes (configurable via `CLAYDE_LOOP_INTERVAL_S`).
177
+
Clayde will start its loop, checking for assigned issues every 5 minutes (configurable via `CLAYDE_INTERVAL`).
178
+
179
+
### 6. Assign issues to your bot
180
+
181
+
In any repository the bot has access to, assign issues to the bot account. Clayde will pick them up automatically on the next loop cycle.
137
182
138
183
---
139
184
@@ -149,50 +194,7 @@ Clayde will start its loop, checking for assigned issues every 5 minutes (config
0 commit comments