16 Commits

Author SHA1 Message Date
ecfbd0bb37 feat: worktree-based run isolation for parallel loops
Each /agent-loop:run now creates a git worktree for the feature branch
before generating stories. This provides full isolation:

- Multiple loops can run in parallel on different specs in the same project
- Main working directory stays on main, always available
- Each worktree has its own .loop/ state, tmux session, and branch
- Completed runs are archived to main's .loop/archive/ with runs.log

Changes:
- setup.sh: add --init-worktree mode for initializing worktree .loop/
- archive.sh: add archive_from_worktree() for cross-directory archiving
- loop.sh: replace branch checkout with validation (worktree is pre-checked-out)
- agents/planner.md: accept absolute path prefix for worktree .loop/ writes
- skills/run/SKILL.md: full rewrite — worktree creation in Phase 2, launch in
  Phase 3, archive on completion, .active-worktree tracking file
- skills/stories/SKILL.md: worktree-aware, defer to /run for full flow

Bump to 0.12.0.
2026-04-02 11:21:17 -04:00
b516492a91 fix: install Stop hook once at loop startup, not per-iteration
Per-iteration install/remove had a race condition: settings.local.json
was written immediately before CC started, and CC could read the old
file (without the hook) on the first iteration.

Now the hook is installed once when loop.sh starts and removed on exit.
The AGENT_LOOP_ACTIVE env var guard ensures it only fires for CC sessions
spawned by the loop, so keeping it installed the whole time is safe.
2026-04-02 10:51:48 -04:00
a1a3dfbd63 fix: use env var instead of tmux check for Stop hook scoping
The tmux display-message approach had edge cases: it could succeed outside
tmux, fail on first iteration, or behave differently depending on tmux
socket state.

Replace with AGENT_LOOP_ACTIVE env var exported by loop.sh. CC sessions
spawned by the loop inherit it; interactive CC sessions don't. Simple,
no external dependencies, no race conditions.
2026-04-02 10:42:46 -04:00
c46de6815c refactor: remove headless mode
Headless mode was half-built and untested. Agent-loop is a plugin
that runs interactively via tmux — there's no CI use case yet.
Removes --headless flag, timeout compatibility shim, output capture
logic, and LOOP_AGENT_TMPFILE handling. Cuts 82 lines from loop.sh.
2026-03-28 12:17:30 -04:00
410c17b3b3 feat: US-007 - Increase evalRetries default from 2 to 3 2026-03-27 18:49:40 -04:00
e3554010dd fix: auto-close finish screen after 30s so background watcher fires 2026-03-27 18:18:07 -04:00
3d86562205 fix: scope Stop hook to per-agent — prevents killing orchestrating CC session 2026-03-27 16:06:48 -04:00
f1fde5cb01 fix: show summary and pause on loop exit — tmux doesn't vanish abruptly 2026-03-27 15:17:13 -04:00
b3d263258a fix: critical bugs, stale refs, README rewrite, security fixes
- Fix evaluator bypass on last story (moved completion check)
- Fix all stale command name references across README, loop.sh, skills, plugin.json
- Fix explore evaluator false rejects (.loop/ files are expected)
- Fix stderr capture order in headless mode
- Fix shell injection risk in hooks.sh python fallback
- Remove .DS_Store from tracking
- Rewrite README to match current architecture (single entry point, tmux, optional tools)
- Add XcodeBuildMCP and iOS simulator MCP to optional tools docs
2026-03-27 14:58:01 -04:00
18d95fed0d fix: don't capture stdout in interactive mode — run claude directly so UI renders 2026-03-27 13:34:54 -04:00
994908aed2 feat: adopt Ralph pattern — pipe to claude (no --print), working Stop hook 2026-03-27 13:24:13 -04:00
1e7f7ea6ed feat: true interactive mode — run claude directly, verdict via file, no script/capture 2026-03-27 13:07:25 -04:00
4a6ddaa193 fix: pass prompt as CLI arg instead of stdin to preserve interactive UI 2026-03-27 12:49:42 -04:00
2a02a54b9d feat: interactive mode — full CC sessions visible in tmux, headless mode via --headless flag 2026-03-27 12:36:56 -04:00
a3cf3e7bae fix: add macOS timeout compatibility (gtimeout or perl fallback) 2026-03-27 12:24:53 -04:00
17e5eb707f feat: agent loop harness with Claude Code plugin support
Generator-evaluator architecture with iterative context-reset for
long-running coding tasks. Ships as a Claude Code plugin — install
with /plugin and use /agent-loop:init, /agent-loop:plan, /agent-loop:run.
2026-03-27 08:03:18 -04:00