Skip to content

fix(pstack): give Claude Code delegates a todolist checkpoint and a way to return spawn steps - #865

Open
EthanYoQ wants to merge 1 commit into
cursor:mainfrom
EthanYoQ:pstack/claude-code-delegate-checkpoints
Open

EthanYoQ wants to merge 1 commit into
cursor:mainfrom
EthanYoQ:pstack/claude-code-delegate-checkpoints

Conversation

@EthanYoQ

@EthanYoQ EthanYoQ commented Oct 24, 2026 •

Copy link
Copy Markdown

Refs #864

What changes for a user

  • In Claude Code without TodoWrite, "Open a todolist" now means a Markdown file written before the first edit, updated as each item is done or skipped, and named in the reply. Before this, the adapter said to keep the list in the reply. A background delegate's reply reaches its parent only at the end, so the list was never a checkpoint.
  • A poteto-agent delegate handed playbook steps opens the todolist before its first edit.
  • Steps that need a spawn it cannot or was told not to make go back to the parent under "Returned to parent", instead of a dead-end skip.
  • The delegate ends its reply with the skill, playbook, and principle files it read, so the parent can see what grounded the work without reading the transcript.

Evidence

From one coordinator run with eight background poteto-agent delegates. Details are in the issue.

  • TodoWrite was absent from every delegate's tool list.
  • Delegates told to write a todo file wrote it before their first edit. The one not told wrote it after its PR was open.
  • Three Feature delegates skipped how, architect, and interrogate as "needs a spawn", and one Bug-fix delegate skipped architect. The parent never saw those skips as work it still owed.

Files

  • pstack/docs/harness/claude-code.md: the "Open a todolist" row.
  • pstack/agents/poteto-agent.md: one new paragraph.
  • harness/pstack/claude-code/...: regenerated with node scripts/generate-pstack-harness-trees.mjs. On Windows the script needs the path fix described in the issue. I applied that fix locally and left it out of this PR.
  • node scripts/check-pstack-docs.mjs reports 0 problems.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and subagent instruction text only; no runtime code, auth, or data paths.

Overview
Claude Code harness: When TodoWrite is unavailable, "Open a todolist" now requires writing a Markdown checklist before the first edit, updating items as done or skip: <reason>, and naming that file in the reply—because background subagents only deliver their final reply to the parent, so an in-reply list was never a real checkpoint.

poteto-agent delegate: Playbook steps from the brief must become a todolist before any edit. Steps that need a Task spawn the delegate cannot (or must not) run are returned to the parent under "Returned to parent" instead of being silently skipped. Replies must end with the skill, playbook, and principle files that were read so the coordinator can see what grounded the work.

Reviewed by Cursor Bugbot for commit fdc0a9d. Bugbot is set up for automated code reviews on this repo. Configure here.

In Claude Code without TodoWrite, the adapter told agents to keep the
todolist in their reply. A background delegate's reply reaches its parent
only when it finishes, so that list was never a checkpoint. The adapter now
maps "Open a todolist" to a Markdown file written before the first edit,
updated per item, and named in the reply.

poteto-agent now opens that list before its first edit when its brief
hands it playbook steps, returns steps that need a spawn it cannot make
to its parent instead of skipping them, and ends its reply with the
skill, playbook, and principle files it read.

Regenerated harness/pstack/claude-code with
node scripts/generate-pstack-harness-trees.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit fdc0a9d. Configure here.

| `Task` | `Agent` |
| `AskQuestion` | `AskUserQuestion`. In `-p` mode it is absent, so ask in plain text. |
| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise keep the list in your reply and update it at each phase. |
| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise write the list to a Markdown file before your first edit, mark each item done or `skip: <reason>` as you go, and name the file in your reply. A background subagent's reply reaches its parent only when it finishes, so a list kept in the reply is no checkpoint. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip and return statuses conflict

Medium Severity · Logic Bug

The Claude Code todolist fallback marks unfinished items skip: &lt;reason&gt; in the Markdown file, while poteto-agent tells delegates not to skip spawn-needed steps and to list them under Returned to parent only in the reply. The file is the mid-run checkpoint, so those steps still read as chosen skips.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fdc0a9d. Configure here.


You are operating as poteto-mode's full agent style. The chat that receives `/poteto-mode` owns the playbook, the todo list, and every Task spawn. You are one of its delegates. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. Use the absolute path your parent gave you. With no path, before any other work, search `~/.cursor/plugins/` for a file whose path ends in `skills/poteto-mode/SKILL.md`. If more than one file matches, use the copy whose `.cursor-plugin/plugin.json` has the highest `version`. Your skill catalog hides this skill, so a missing catalog entry does not mean pstack is absent. If no such file exists, stop and tell your parent. Navigate to a leaf `principle-*` skill whenever you apply that principle.

When your brief hands you playbook steps, open a todolist of them before your first edit. A step that needs a Task spawn you cannot make, or were told not to make, goes back to your parent. List it under "Returned to parent" in your reply instead of skipping it. End your reply with the skill, playbook, and principle files you read.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return rule catches implementation steps

Medium Severity · Logic Bug

The new return rule sends any playbook step that needs a Task spawn the delegate cannot make, or was told not to make, back to the parent. Implementation steps are written as "delegate to a subagent," so they match. Feature is the only playbook that tells a no-spawn delegate to own the diff.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fdc0a9d. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant