PreCompact hook fires on /compact and autoCompact. When task_plan.md is
present, surfaces a reminder to flush in-context progress to progress.md
before compaction completes and prints the active Plan-SHA256 if attested.
Stays silent without a plan. Exit 0 always; never blocks compaction.
/plan-goal composes with Claude Code's /goal (v2.1.139, May 12 2026).
Derives a termination condition from the active plan so /goal stops the
agent when the plan-file is genuinely complete, not just when the
conversation looks done.
/plan-loop composes with /loop (v2.1.72+). Default 10-minute tick re-reads
planning files, runs check-complete, nudges a progress.md entry if the
last tick produced no change. templates/loop.md ships a planning-aware
default for ~/.claude/loop.md so bare /loop works grounded in the plan.
OpenCode session-catchup rewritten for the SQLite migration (sst/opencode
dev @ 2026-05-14). Reads ${XDG_DATA_HOME:-~/.local/share}/opencode/opencode.db
read-only via URI, scopes by session.directory, surfaces unsynced planning
edits. Verified against a real 162 MB OpenCode database (94 sessions, 56
unsynced parts correctly extracted from the lovable-at-home directory).
Codex gains a PermissionRequest adapter that surfaces a one-line plan
reminder when an active plan exists. Read-only; never blocks.
Tests: +19 covering PreCompact behavior, slash command file structure,
OpenCode SQLite catchup with a synthetic schema-matching DB, and Codex
PermissionRequest emit/silent behavior. 98 tests passing.
Deliberately not changed: paths glob (auto-invocation behavior risk),
wholesale !command swap (would freeze attestation hash and defeat v2.37
tamper gate), native Plan Mode panel integration (no plugin API
documented), language variant consolidation (separate breaking-change
track). PreCompact lives in the canonical SKILL.md + 5 language variants
+ clawhub-upload; other IDE mirrors keep their existing compaction
hooks until per-IDE PreCompact adapters land in a future release.
1.8 KiB
1.8 KiB
description, disable-model-invocation, allowed-tools
| description | disable-model-invocation | allowed-tools |
|---|---|---|
| Bridge Claude Code's /goal to the active plan. Derives a goal condition from task_plan.md and invokes /goal so Claude keeps working until the plan is complete. Available since v2.38.0. | true | Read Bash |
Bridge the active plan to Claude Code's /goal primitive.
Steps:
- Resolve the active plan: prefer
${PLAN_ID}env var, then.planning/.active_plan, then newest.planning/<dir>/, then legacy./task_plan.md. - Read the resolved
task_plan.md. - Derive a goal condition from the plan content:
- Default: "all phases in task_plan.md report Status: complete and check-complete.sh reports ALL PHASES COMPLETE"
- If user passed an argument: use that as an additional clause (e.g.,
/plan-goal until all tests pass)
- Issue Claude Code's
/goal <condition>with the derived text. - Confirm to the user: print the goal condition + the active plan ID + remind that
/goal clearcancels.
If task_plan.md does not exist, refuse and direct user to run /plan first.
Why this exists:
/goal runs the agent until a small fast model confirms the condition is met. It evaluates the transcript only, not files. By deriving the condition from the plan file, this command turns the file-based plan into a measurable termination criterion for /goal, so the loop terminates when the plan is actually done, not when the conversation looks done.
Notes:
/plan-goaldoes not replace/goal. It composes with it. Users can still run/goal "any text"directly.- The derived condition stays under the 4000-char limit
/goalenforces by quoting only phase headers + acceptance criteria, not full task body. - Combine with
/plan-loopfor a "babysit until done" workflow:/plan-loopcadence +/plan-goaltermination.