From 6f0bf998ceb4fbc0f86f1b436ae50dcf4565244f Mon Sep 17 00:00:00 2001 From: Marius1311 Date: Mon, 12 Oct 2026 12:36:24 +0200 Subject: [PATCH 1/2] Say how to use the plugin: one claude --worktree session per task The README gains a Use section and points at the marketplace for the install commands. The session-start rules and the skill name the same command, so an agent in the main checkout can tell the human how to start a task. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Vtrv52oTpCLDMKzN13i4Nw --- README.md | 24 +++++++++++++++++------- hooks/session_context.md | 2 +- skills/analysis-workflow/SKILL.md | 3 ++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7dec7e8..8001900 100644 --- a/README.md +++ b/README.md @@ -15,18 +15,28 @@ It assumes analysis repos made from [analysis_template](https://github.com/quadb (pixi-managed) and code repos from the [scverse cookiecutter](https://github.com/scverse/cookiecutter-scverse) (uv-managed). Nothing in it is specific to a dataset, an analysis or a compute environment. -## Install +## Use -**The plugin**, once per machine: +Start each analysis task as its own session, from the analysis repo's main checkout: ```bash -claude plugin marketplace add quadbio/claude-plugins -claude plugin install analysis-workflow@quadbio +claude --worktree ``` -The skill is then available everywhere, so it can set up a new project. The hooks and session-start rules act only -in repos that enable the plugin in their committed `.claude/settings.json`, as -[analysis_template](https://github.com/quadbio/analysis_template) does: +1. The agent works on that worktree's branch, in a new task directory `analysis//_vN/`; a later + answer to the same question gets the next version, in a new session. +2. It asks you which working object is current, then works in scripts; outputs go to the task directory. +3. Results reach a shared working object only after you sign off the dry run. +4. It opens a PR. Once it is merged, leave with `/exit` and remove the worktree. + +Notebooks and environment changes (`pixi install`, `pixi add`) stay with you, in the main checkout. With no +analysis repo yet, ask Claude to start an analysis project: the skill sets one up. + +## Install + +**The plugin**, once per machine, from the [quadbio marketplace](https://github.com/quadbio/claude-plugins). The +skill is then available everywhere; the hooks and session-start rules act only in repos that enable the plugin in +their committed `.claude/settings.json`, as [analysis_template](https://github.com/quadbio/analysis_template) does: ```json { diff --git a/hooks/session_context.md b/hooks/session_context.md index 13eb658..a40253e 100644 --- a/hooks/session_context.md +++ b/hooks/session_context.md @@ -2,7 +2,7 @@ This repository follows the analysis-workflow conventions. Load the `analysis-wo analysis code, outputs or data. Always: 1. One task = one session = one git worktree = one directory `analysis//.../_vN/`. A new task - directory needs a new session. + directory needs a new session, which the human starts with `claude --worktree ` in the main checkout. 2. Every output path comes from `task_paths(__file__)` (package `analysis_workflow`); never a bare relative path. 3. Ask the human which working object (and which label keys) is current; never infer it from a script or the newest file name. diff --git a/skills/analysis-workflow/SKILL.md b/skills/analysis-workflow/SKILL.md index fd5c327..7449ef8 100644 --- a/skills/analysis-workflow/SKILL.md +++ b/skills/analysis-workflow/SKILL.md @@ -41,7 +41,8 @@ into the human lane. **Start** 1. One task = one session = one git worktree = one branch = one directory `analysis//.../_vN/`, merged - through one or more PRs. A new task directory needs a new session; a later answer to the same question is `_v2`. + through one or more PRs. A new task directory needs a new session, which the human starts with + `claude --worktree ` in the main checkout; a later answer to the same question is `_v2`. 2. Copy `assets/task_template/`. 3. Ask which working object and which label keys are current, and record them under Inputs. Never infer them from a script or the newest file name. From cc5fac0a33112b1a56a3bd3ddedaa1d87b938996 Mon Sep 17 00:00:00 2001 From: Marius1311 Date: Mon, 12 Oct 2026 12:46:41 +0200 Subject: [PATCH 2/2] Pull the main checkout before starting a task claude --worktree branches from origin's default branch, while the task runs on the main checkout's environment; a stale main checkout pairs new code with an old environment. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Vtrv52oTpCLDMKzN13i4Nw --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8001900..7ab4f81 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ It assumes analysis repos made from [analysis_template](https://github.com/quadb ## Use -Start each analysis task as its own session, from the analysis repo's main checkout: +Start each analysis task as its own session, from the analysis repo's main checkout. Pull it first: the worktree +branches from `origin`'s default branch but runs on the main checkout's environment. ```bash claude --worktree