Give each agent slot a session: a plugin, a skill, and a terminal that stays #133

Merged
nectenda-agent merged 1 commit from worktree-agent-session into main 2026-09-23 20:00:20 +01:00
Collaborator

The session side of the agent loop: each slot is a VS Code terminal that runs one Claude session per card, restarting between cards so every card starts with a clean context.

  • A session-only plugin in scripts/agent/claude/ (hooks, the work-queue skill, and settings), loaded with --plugin-dir/--settings by slot.sh. Interactive sessions never load it, and the hooks are silent outside a slot anyway.
  • The prompt hook claims a card before the turn starts, because the phone only renames a session on a prompt. It claims only for the loop prompt, and reports a failed claim.
  • slot.sh, end-session.sh (SIGTERM to CLAUDE_PID, proven 23 Sep), gate-local.sh (local e2e capped at 2), pr.mjs (body written once, before CI starts; a release note is required), card.mjs.
  • .vscode/tasks.json opens three slots with the folder; slot.sh refuses to run from a worktree.
  • docs/changes/README.md gains the spec template.

42 tests; each session-side rule was mutation-checked.

Changelog

NONE

The session side of the agent loop: each slot is a VS Code terminal that runs one Claude session per card, restarting between cards so every card starts with a clean context. - A session-only plugin in `scripts/agent/claude/` (hooks, the `work-queue` skill, and settings), loaded with `--plugin-dir`/`--settings` by `slot.sh`. Interactive sessions never load it, and the hooks are silent outside a slot anyway. - The prompt hook claims a card before the turn starts, because the phone only renames a session on a prompt. It claims only for the loop prompt, and reports a failed claim. - `slot.sh`, `end-session.sh` (SIGTERM to `CLAUDE_PID`, proven 23 Sep), `gate-local.sh` (local e2e capped at 2), `pr.mjs` (body written once, before CI starts; a release note is required), `card.mjs`. - `.vscode/tasks.json` opens three slots with the folder; `slot.sh` refuses to run from a worktree. - `docs/changes/README.md` gains the spec template. 42 tests; each session-side rule was mutation-checked. ## Changelog NONE
Give each agent slot a session: a plugin, a skill, and a terminal that stays
All checks were successful
Release note / release-note (pull_request) Successful in 18s
CI / e2e (pull_request) Successful in 5m14s
CI / build (pull_request) Successful in 5m22s
CI / promote (pull_request) Has been skipped
CI / e2e (push) Successful in 5m49s
CI / build (push) Successful in 5m50s
CI / promote (push) Successful in 30s
6714fa59d6
The session side of the agent loop. A slot is a VS Code terminal that
opens with the folder and runs scripts/agent/slot.sh. The script runs one
Claude session per card and starts the next when a card is handed off, so
every card begins with an empty context while the terminal, and the name
on the phone, stay where they were.

Everything a slot session needs ships as a session-only plugin in
scripts/agent/claude/, loaded with --plugin-dir and --settings. .claude/
is gitignored, and project-level hooks would rename every session in the
repository; this way interactive sessions never see any of it, and both
hooks are silent anyway unless NECTENDA_AGENT_SLOT is set.

- The prompt hook claims the card before the turn starts, because the
  Remote Control name only changes when a prompt is submitted. It claims
  only for the work-queue loop's own prompt, never when a person types
  into an idle slot, and it reports a failed claim rather than
  swallowing it.
- The skill carries one card from spec to a green pull request: a plan
  approved on the phone (or a pre-approved one plan-check says is still
  fresh), tests citing their rule ids, the local gate, a fresh-context
  review, and a hand-off to the merge queue. Then it ends the session.
- end-session.sh ends the session with SIGTERM to CLAUDE_PID. That path
  was established on 23 Sep 2026: exit 0, transcript kept. It refuses to
  run outside a slot.
- gate-local.sh is CI's build job in order, then the real-Obsidian suite,
  capped at two concurrent runs on the Mac for CPU.
- pr.mjs writes the body once, before CI starts, with a release note it
  refuses to go without and the card's area:* labels.

42 tests, and each session-side rule was broken once to see its test fail.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015k9tkUtbU3wBpCHAHq7Qas
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Nectenda/nectenda!133
No description provided.