Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Claude Code mods (plugins with a hooks module), served as a local folder marketp
| mod | version | what it does |
| --- | --- | --- |
| [harness](harness/) | 0.5.0 | The integrated harness: the user's Claude rules enforced at the tool call, session tooling and workflow automation (formerly house-rules) |
| [auto-claude](auto-claude/) | 1.4.0 | Unattended run of a repository through to live: plans the long-term goal, milestones and deploy; its own loop builds and judges each milestone in a worktree; ships each (push, PR, required CI, merge), deploys and smoke-checks it; a watchdog repairs or routes around stalls; replans until the final check passes. Absorbed goal-mode in 1.0.0; since 1.1.0 the session never rests: the next milestone is built, stacked, while a PR waits on CI; since 1.3.0 a line can wait on a training run or cache build (`:: after:`, `wait_until`) without ending the run; since 1.4.0 `--always-on` stands by after the final check and wakes for new cycles from Linear, the live smoke check, the default branch's CI and labelled GitHub issues |
| [auto-claude](auto-claude/) | 1.4.1 | Unattended run of a repository through to live: plans the long-term goal, milestones and deploy; its own loop builds and judges each milestone in a worktree; ships each (push, PR, required CI, merge), deploys and smoke-checks it; a watchdog repairs or routes around stalls; replans until the final check passes. Absorbed goal-mode in 1.0.0; since 1.1.0 the session never rests: the next milestone is built, stacked, while a PR waits on CI; since 1.3.0 a line can wait on a training run or cache build (`:: after:`, `wait_until`) without ending the run; since 1.4.0 `--always-on` stands by after the final check and wakes for new cycles from Linear, the live smoke check, the default branch's CI and labelled GitHub issues |
| [model-tier](model-tier/) | 0.11.0 | Routes each main-loop turn to fable, opus, sonnet or haiku and a reasoning effort by task complexity, with a `set_tier` tool the model calls to correct either |
| [refactor](refactor/) | 0.1.3 | Enforces the architecture a repo declares in `.claude/architecture.json` at Edit/Write (layer direction, forbidden imports), notes code smells with the refactoring.guru technique to apply, `/arch audit` for violations and import cycles |

Expand Down
2 changes: 1 addition & 1 deletion auto-claude/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auto-claude",
"version": "1.4.0",
"version": "1.4.1",
"description": "Finishes a repository's work unattended and live: Claude plans the long-term end state, its milestones and how it deploys; the built-in loop builds each milestone in its own worktree and judges it; auto-claude ships it (push, PR, CI, merge when green), deploys and smoke-checks it, and a watchdog keeps the run moving until the final check passes. With --always-on it does not end there: it stands by with no model turn and wakes for a new cycle when Linear, the live smoke check, the default branch's CI or a labelled GitHub issue gives it work (1.4.0). Absorbs goal-mode's loop (1.0.0).",
"author": {
"name": "unohee"
Expand Down
12 changes: 12 additions & 0 deletions auto-claude/hooks/auto.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,18 @@ describe('a run, local CI', () => {
expect(text).toContain('no "Deploy:')
})

test('a reload while the session sits in a removed worktree keeps ticking the run', async ($, on) => {
const w = world(on)
await planned($, w)
await meet($, w)
const beat = () => (JSON.parse(w.files.get('/repo/.claude/auto-claude.on') ?? '{}') as { at?: number }).at ?? 0
w.gone.add('/repo/worktrees/goal-01-landed')
await $.session.start({ cwd: '/repo/worktrees/goal-01-landed', surface: 'terminal', isInteractive: true })
const before = beat()
await w.clock.advance(TICK)
expect(beat()).toBeGreaterThan(before)
})

test('start from a session whose directory was a removed worktree finds the repository above it', async ($, on) => {
const w = world(on)
await $.session.start({ cwd: '/repo', surface: 'terminal', isInteractive: true })
Expand Down
14 changes: 12 additions & 2 deletions auto-claude/hooks/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,17 @@ async function show($: EngineInterface, r: AutoRecord | undefined) {
// used to read as "Not inside a git repository".
async function sessionRoot($: EngineInterface): Promise<{ root?: string; cwd: string; used: string }> {
const cwd = await $.session.cwd()
const dir = await existingDir($, cwd)
return { root: await repoRoot($, dir), cwd, used: dir }
}

// The session's directory, or the nearest one above it that still exists: a
// session left in a milestone worktree the driver removed after its merge has a
// directory git cannot start in.
async function existingDir($: EngineInterface, cwd: string): Promise<string> {
let dir = cwd
while (dir !== '/' && !(await $.fs.exists(dir).catch(() => true))) dir = dir.slice(0, dir.lastIndexOf('/')) || '/'
return { root: await repoRoot($, dir), cwd, used: dir }
return dir
}

const notInRepo = (s: { cwd: string; used: string }) =>
Expand Down Expand Up @@ -1339,7 +1347,9 @@ export const register: Register = (on, options) => {
setOnFinish(() => {
$.clock.after(100, () => void tick($, caps, pollMs))
})
const root = await repoRoot($, e.cwd).catch(() => undefined)
// A reload while the session sits in a removed worktree used to leave no root:
// every tick returned at once, and the run stood still without a word.
const root = await repoRoot($, await existingDir($, e.cwd)).catch(() => undefined)
activeRoot = root
const r = root === undefined ? undefined : await readRecord($, root)
if (r?.on === true && r.phase === 'run' && r.sessionId === (await $.session.id())) await recoverLoop($, r).catch(() => undefined)
Expand Down
Loading