Adds two sibling files in plugins/ultraplan-local/docs/ that together
specify a new /ultracontinue command for zero-friction multi-session
resumption — drafted from design dialogue at the end of the config-audit
v5.0.0 release session (5 sessions, ~10 manual NEXT-SESSION-PROMPT
context-handovers — friction this work removes).
ultracontinue-brief.md (159 lines):
- Follows the /ultrabrief-local template (frontmatter brief_version: 2.0)
so /ultraplan-local can consume it directly
- Defines per-project state-file convention .claude/projects/<project>/
.session-state.local.json as the contract; /ultracontinue is read-only,
multiple writers may update
- 10 falsifiable success criteria including cross-project consistency,
no-new-deps, validator + helper command, docs sweep across plugin
README + CLAUDE.md + marketplace root README
- 3 research topics: ultraexecute end-of-session integration depth,
graceful-handoff alignment (no hard dep), Claude Code slash-command
conventions for read+execute commands
- Explicit non-goals: not replacing /ultraexecute-local --resume, not
replacing graceful-handoff, not auto-orchestrating N sessions
- Open questions and assumptions flagged for plan-critic / scope-guardian
ultracontinue-design-notes.md (117 lines):
- Captures the dialogue rationale that shaped the brief, so the
implementing session has full context without needing to read this
conversation's transcript
- Origin (config-audit v5 release pain point), key design insight
("state-fil ER kontrakten, ikke verktøyet"), 6 design decisions with
alternatives considered, anti-patterns from KTG auto-memory to respect,
recommended reading order, expected scope (1-2 execution sessions)
No code changes. Brief is ready for /ultraplan-local --brief
plugins/ultraplan-local/docs/ultracontinue-brief.md (light path) or
/ultraresearch-local for full research path.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
16 KiB
| type | brief_version | created | task | slug | project_dir | research_topics | research_status | auto_research | interview_turns | source |
|---|---|---|---|---|---|---|---|---|---|---|
| ultrabrief | 2.0 | 2026-05-01 | Add /ultracontinue command for zero-friction multi-session resumption | ultracontinue | .claude/projects/2026-05-01-ultracontinue/ | 3 | pending | false | 0 | manual |
Task: /ultracontinue — Zero-Friction Multi-Session Resumption
Drafted manually 2026-05-01 from KTG/Claude design dialogue after the config-audit v5.0.0 release run (5 sessions, ~40 turns of
NEXT-SESSION-PROMPT.local.mdhandoffs). Brief follows the/ultrabrief-localtemplate for consistency with the rest of the ultraplan-local pipeline, but was not produced through the interview — it is a hand-written design brief./ultraplan-localshould still be able to consume it.
Intent
Multi-session execution today (e.g. config-audit v5.0.0's 5-session release run) requires KTG to manually maintain a NEXT-SESSION-PROMPT.local.md at the end of every session and copy-paste its contents into the next fresh Claude Code session. This works but adds two friction points per session: (1) at session-end, decide what context the next session needs and write it; (2) at session-start, locate the file and paste it. Across a 5-session run that's 10 manual context-handover steps, each prone to omission, copy errors, or stale state. The NEXT-SESSION-PROMPT.local.md convention is captured in KTG's auto-memory as feedback_session_handoff_prompt.md but is not formalized in any tool — it lives entirely in operator discipline.
The opportunity: a single command, identical across all projects, that bootstraps the next session with zero thinking. KTG starts a fresh Claude session, types /ultracontinue, and the right context loads. End of friction.
Goal
A new /ultracontinue command in the ultraplan-local plugin that reads a per-project state file (.claude/projects/<project>/.session-state.local.json), shows a 3-line summary (project, next-session label, brief path), and immediately begins executing the next session. Works whether the previous session was driven by /ultraexecute-local (formal pipeline) or executed manually turn-by-turn (informal pipeline like the v5.0.0 release run). The state file is the contract — any session-end mechanism may write to it, and /ultracontinue only reads.
Non-Goals
- Replace
/ultraexecute-local --resume. That flag resumes a SINGLE session from aprogress.jsoncheckpoint after a crash./ultracontinueadvances to the NEXT session in a multi-session plan. They are complementary, not overlapping. - Replace
graceful-handoff. That plugin solves context-budget rescue (dump state when current session approaches its token limit)./ultracontinuesolves planned multi-session continuation. They MAY share the state-file convention as a consistency win, but/ultracontinuemust work standalone withoutgraceful-handoffinstalled. - Auto-orchestrate the entire multi-session run from one command.
/ultracontinueadvances ONE session per invocation. Running 5 sessions back-to-back requires 5 invocations across 5 fresh Claude sessions (which is the point — context resets between them). - Replace
NEXT-SESSION-PROMPT.local.mdretroactively. Existing projects mid-flight may keep using it. The new command works alongside it; migration is opt-in per project. - Build a session scheduler / cron / background runner. Out of scope. KTG starts each session manually.
Constraints
- Per-project state file. Path:
.claude/projects/<project>/.session-state.local.json. Gitignored by default. No global state. - No hard dependency on
graceful-handoff./ultracontinuemust work in projects/repos wheregraceful-handoffis not installed. - Works for both formal and informal multi-session flows. Formal =
/ultraexecute-localwrites the state file as part of its standard end-of-session contract. Informal = a tiny helper command (or KTG manually) writes the state file at end of a manual session series like the v5.0.0 release run. - Zero new external dependencies. Plain
node:fsJSON read. No npm packages. - Cross-platform. Node
.mjsscript, no shell-isms; works on macOS / Linux / Windows. - Convention is documented in
docs/HANDOVER-CONTRACTS.md— same place as the brief/research/plan/progress.json contracts already live. The state file gets a sixth handover entry.
Preferences
- State file IS the contract.
/ultracontinuereads it; multiple writers can update it. Loose coupling > tight coupling to a specific writer. - Minimal state-file schema.
project,next_session_brief_path,next_session_label,status,updated_at. Everything else is optional metadata. - No interactive prompts in
/ultracontinuestartup. Show summary, start. If KTG wants to abort, Ctrl+C. Per dialogue: "ingen prompts, men la informasjon synes". - Match existing ultraplan-local skill structure. New command file at
commands/ultracontinue-local.md, no agents needed (deterministic file read), follow existing frontmatter conventions. - Match existing handover-validator pattern. Add
lib/validators/session-state-validator.mjsfor the new contract; CLI returns{valid, errors[], warnings[], parsed}.
Non-Functional Requirements
- Cold-start latency: < 500ms from
/ultracontinueinvocation to "begin executing session" output. - Failure mode is obvious. Missing state file → tell user "no active multi-session project here; start with
/ultrabrief-localor/ultraplan-local". Malformed state file → tell user the validation error and where to fix it. - Idempotent. Running
/ultracontinuetwice in the same session does not advance state. State only advances when the SESSION completes (writer's responsibility). - Self-documenting. First-time user can
/ultracontinue --helpand understand the model without reading other docs. - Zero secrets in the state file. Status, paths, labels — never API keys, never user content beyond filenames.
Success Criteria
Falsifiable, command-checkable:
- SC-1: A new project with
.claude/projects/<project>/.session-state.local.jsoncontaining the documented schema can be resumed via/ultracontinuefrom a fresh Claude session, and the correct brief loads. Verified by running the command in a fixture project and asserting the loaded content. - SC-2:
/ultracontinueinvoked in a directory with no state file emits a helpful message (not a stack trace) pointing at/ultrabrief-local//ultraplan-localas the entry points. Verified: exit cleanly with informative stderr. - SC-3: The session-state-validator CLI exists at
lib/validators/session-state-validator.mjsand returns{valid:true, errors:[], warnings:[], parsed:{...}}for a well-formed file; structured errors with stable codes for malformed files. Verified via fixture-backed tests. - SC-4:
/ultraexecute-localwrites the state file at end-of-session — both for explicit session-spec runs (--session N) and for formal session-strategy plans. Verified: after a session completes,.session-state.local.jsonexists and points at next session. (May land in a follow-up step if it requires significant ultraexecute restructure.) - SC-5: A
/ultraplan-local end-session(or equivalent) helper exists for INFORMAL multi-session flows like the v5.0.0 release run — single command writes the state file pointing at the next session brief. Verified: invocation produces a valid state file the validator accepts. - SC-6:
docs/HANDOVER-CONTRACTS.mdhas a "Handover 6 —.session-state.local.json" entry with producer, consumer, path conventions, schema, body invariants, validation strategy, versioning, and failure modes. Verified: file exists with the section heading. - SC-7: Plugin
README.md,CLAUDE.md, and root marketplaceREADME.mddocument/ultracontinuein command tables. Verified: grep finds the command name in all three. - SC-8: Cross-project consistency: running
/ultracontinuein two different projects (config-audit-style and any greenfield project) shows identical output structure (project / next-session-label / brief-path / "Begin?"-equivalent narration). Verified by manual diff or fixture-based test. - SC-9: Tests: at least 1 unit test for the validator, 1 integration test for the command's load+narrate flow, 1 negative test (missing file), 1 negative test (malformed file). Plugin's
node --test 'tests/**/*.test.mjs'stays green. - SC-10: No new external dependencies in
package.jsonor any newnode_modules/directory created by this work. Verified:git diff package.jsonshows nodependencieschange;find . -name node_modules -not -path '*/tests/fixtures/*'returns no new entries.
Research Plan
Three research topics. Topics 1 and 2 are local (codebase-only); topic 3 is light external (verify Anthropic / Claude Code conventions).
Topic 1: /ultraexecute-local end-of-session integration depth
- Why this matters: Per dialogue: "ultraexecute-local må være 100% konsekvent for hvordan den fullfører hver eneste sesjon". The state file's reliability depends on EVERY session-end path writing it. This research scopes how invasive that change is.
- Research question: "Where in
commands/ultraexecute-local.mddoes end-of-session occur, and what fewest-touch insertion points guarantee state-file write across (a) successful session, (b) failed session with manual abort, (c) compaction-survival recovery, (d)--session Nexplicit single-session runs?" - Suggested invocation:
/ultraresearch-local --project .claude/projects/2026-05-01-ultracontinue --local "Where in ultraexecute-local does end-of-session occur, and what fewest-touch insertion points guarantee state-file write across all session-end paths?" - Required for plan steps: ultraexecute-local code edits; failure-mode handling; whether SC-4 lands in v1.0 or follow-up
- Confidence needed: high
- Estimated cost: standard — agent swarm
- Scope hint: local
Topic 2: graceful-handoff plugin alignment
- Why this matters: The two plugins solve adjacent problems and SHOULD share the state-file convention without making
graceful-handoffa hard dep. This research determines whethergraceful-handoffwrites a similar file today, what schema it uses, and whether convergence is one-sided (graceful-handoff adopts ultraplan's schema) or mutual (both align on a v1 schema co-published in ultraplan-local). - Research question: "Does
graceful-handoffalready produce a session-state file, what is its schema, and what is the minimum-friction path to make it write to the same.session-state.local.jsonconvention without imposing a hard dependency from/ultracontinueongraceful-handoff?" - Suggested invocation:
/ultraresearch-local --project .claude/projects/2026-05-01-ultracontinue --local "Does graceful-handoff produce a session-state file? What schema? Convergence path?" - Required for plan steps: SC-5 helper command design; whether
graceful-handoffgets a docs note in its README pointing at the convention - Confidence needed: medium
- Estimated cost: quick — inline research
- Scope hint: local (both plugins are in this repo)
Topic 3: Claude Code slash-command conventions for read+execute commands
- Why this matters:
/ultracontinuereads state then immediately starts work. We need to verify that this pattern (noAskUserQuestion, just narrate-and-go) matches Claude Code's UX expectations and doesn't trip any guardrails (e.g. auto-approval behavior in plan mode, hook ordering, allowed-tools list for the slash command). - Research question: "What are Claude Code's documented conventions for slash commands that read state and immediately begin a multi-step task without user confirmation, and what
allowed-tools/model/ frontmatter pattern do similar commands use?" - Suggested invocation:
/ultraresearch-local --project .claude/projects/2026-05-01-ultracontinue --external "What are Claude Code's documented conventions for slash commands that read state and immediately begin a multi-step task without user confirmation?" - Required for plan steps:
commands/ultracontinue-local.mdfrontmatter + behavior section - Confidence needed: medium
- Estimated cost: quick — docs lookup
- Scope hint: external
Open Questions / Assumptions
- [ASSUMPTION] State-file format
.session-state.local.jsonis JSON, not YAML — matchesprogress.jsonconvention from ultraplan-local. Could be YAML for human-edit-friendliness, but JSON has mechanical-validator advantages and parity with existingprogress.json. - [ASSUMPTION] State file is gitignored via the existing
*.local.*pattern (already in most plugin.gitignorefiles including config-audit). No new gitignore entry needed. - [QUESTION] Should
/ultracontinueaccept an optional<project-dir>arg for projects not at the cwd? Default is "find.claude/projects/<...>/.session-state.local.jsonreachable from cwd". Argument override = nice-to-have. - [QUESTION] Should the state file track ALL completed sessions (history), or just last + next? Minimal contract = last + next. History is metadata that can grow as needed without breaking compat.
- [QUESTION] Naming —
/ultracontinuevs/ultraplan-local continuevs/continue. KTG decision in dialogue:/ultracontinuefor muscle-memory parity with the other ultra-prefixed commands. Plan should confirm no global Claude Code/continuebuiltin collides. - [QUESTION] What's the upgrade path for projects that already have
NEXT-SESSION-PROMPT.local.md(config-audit historical, ultraplan-local historical)? Backward compat =/ultracontinuecould read either if state-file is missing. Or simpler: documented manual migration ("write a state file pointing at your existing NEXT-SESSION-PROMPT").
Prior Attempts
-
NEXT-SESSION-PROMPT.local.mdmanual convention. Captured in KTG's auto-memory (feedback_session_handoff_prompt.mdandfeedback_next_session_prompt_manual.md). Used heavily in config-audit v5.0.0 release (5 sessions). Worked, but operator-driven — KTG must remember to invoke it at session-start AND write it at session-end. The auto-memory entryfeedback_next_session_prompt_manual.mdexplicitly notes: "Ikke foreslå auto-loading via SessionStart/CLAUDE.md. Manuell invokasjon unngår stale-fil-risiko." This brief addresses the friction without re-introducing the stale-file risk:/ultracontinueis still operator-invoked, but the state file is mechanically validated and the load is deterministic. -
/ultraexecute-local --session Nflag. Already exists and works for HEADLESS / scripted multi-session runs via session specs. Does not address the INTERACTIVE multi-session case where each session is a fresh Claude Code chat. -
graceful-handoffplugin. Solves a different problem (intra-session context-budget rescue). Pattern overlap exists; this brief proposes alignment without dependency.
Metadata
- Created: 2026-05-01
- Interview turns: 0 (manual brief from design dialogue)
- Auto-research opted in: no — research is suggested but KTG decides
- Source: manual
How to continue
Manual (recommended for this brief — research is light and the planning happens once):
# Run the three research topics (order does not matter):
/ultraresearch-local --project .claude/projects/2026-05-01-ultracontinue --local "Where in ultraexecute-local does end-of-session occur, and what fewest-touch insertion points guarantee state-file write across all session-end paths?"
/ultraresearch-local --project .claude/projects/2026-05-01-ultracontinue --local "Does graceful-handoff produce a session-state file? What schema? Convergence path?"
/ultraresearch-local --project .claude/projects/2026-05-01-ultracontinue --external "What are Claude Code's documented conventions for slash commands that read state and immediately begin a multi-step task without user confirmation?"
# Then plan:
/ultraplan-local --project .claude/projects/2026-05-01-ultracontinue
# Then execute (likely 1-2 sessions; not large enough to need /ultracontinue itself):
/ultraexecute-local --project .claude/projects/2026-05-01-ultracontinue
Skip-research path (faster, lower confidence): /ultraplan-local --brief plugins/ultraplan-local/docs/ultracontinue-brief.md directly. Will ship /ultracontinue with assumptions noted and SC-4 (ultraexecute integration) likely deferred to follow-up.