pause
Flagged{"isSafe":false,"isSuspicious":true,"riskLevel":"high","findings":[{"category":"prompt_injection","severity":"high","description":"Explicit prompt injection attempting to override model behavior: contains STOP messages and instruction to begin executing steps immediately, potentially bypassing safeguards.","evidence":"**STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**"}],"summary":"The skill content contains a prompt-injection attempt that could coerce the AI into executing steps or ignoring safety prompts. The surrounding workflow describes safe, local-state capture logic, but the injection line represents a high-risk vulnerability if not sanitized. Mitigations: strip or ignore prompt-injection cues, run analysis in a sandbox, and enforce strict prompt-safety filtering before executing any steps."}
npx machina-cli add skill SienkLogic/plan-build-run/pause --openclawSTOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.
Step 0 — Immediate Output
Before ANY tool calls, display this banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► PAUSING SESSION ║
╚══════════════════════════════════════════════════════════════╝
Then proceed to Step 1.
$pbr-pause — Save Session State
You are running the pause skill. Your job is to capture the current session state so the user can resume exactly where they left off in a future conversation. This creates a .continue-here.md handoff file with everything the next session needs.
This skill runs inline (no Task delegation).
Core Principle
Capture everything the next session needs to hit the ground running. The resume skill will read this file cold, with zero prior context. Write it as if you're handing off to a colleague who has never seen this project.
Flow
Step 1: Read Current State
Flag: --checkpoint
If $ARGUMENTS contains --checkpoint:
- Perform a lightweight state dump without full session analysis
- Write a minimal .continue-here.md with just: Position, git status, and suggested next action
- Skip the detailed "Completed This Session" analysis (saves time)
- Useful for quick manual checkpoints at any point
Read the following files to understand where things stand:
-
.planning/STATE.md— Current position- Extract: current phase, current plan, progress, blockers
- If STATE.md doesn't exist, display:
╔══════════════════════════════════════════════════════════════╗ ║ ERROR ║ ╚══════════════════════════════════════════════════════════════╝ No Plan-Build-Run project state found. Nothing to pause. **To fix:** Run `$pbr-begin` to initialize a project first.
-
.planning/config.json— Project settings- Extract: project name, feature toggles
-
.planning/ROADMAP.md— Phase overview- Extract: current phase name, total phases
Step 2: Determine Current Phase Directory
From STATE.md, get the current phase number and find its directory:
- List directories in
.planning/phases/ - Match the current phase number to a directory
- If no match: use the most recently modified phase directory
Step 3: Gather Session State
Collect the following information:
Current Position
- Phase number and name
- Plan number (if mid-phase) or "between plans"
- Status: in-progress, between-plans, between-phases, planning, reviewing
Work Completed This Session
Scan the current phase directory for SUMMARY.md files:
- Read each SUMMARY.md frontmatter
- Note which ones were created/modified recently (check timestamps or git log)
- For recently completed plans: extract the plan name and brief status
Also check git log for recent commits:
git log --oneline -20 --since="8 hours ago"
This gives a reasonable window for "this session's work."
Remaining Work
Scan for plan files without corresponding SUMMARY.md files:
- These are plans that haven't been executed yet
- List them with brief descriptions from their frontmatter
Key Decisions Made
Check for:
- Recent CONTEXT.md files (from
$pbr-discuss) - Key decisions in recent SUMMARY.md files
- Any deviations noted in summaries
Blockers or Concerns
From STATE.md blockers section and any:
- Failed verifications
- Checkpoint stops
- Active debug sessions
- Unresolved issues noted in summaries
What to Do Next
Determine the logical next action (same routing logic as $pbr-status):
- If mid-plan execution: "Continue building phase N"
- If between plans in a phase: "Execute next plan (plan M)"
- If phase complete, not reviewed: "Review phase N"
- If phase reviewed, has gaps: "Fix gaps in phase N"
- If phase complete: "Plan phase N+1"
Step 4: Write .continue-here.md
CRITICAL: Write pause state NOW before displaying confirmation. Do NOT skip this step.
Write the handoff file to the current phase directory:
Path: .planning/phases/{NN}-{phase-name}/.continue-here.md
Content:
Read skills/pause/templates/continue-here.md.tmpl for the handoff file format. Fill in all {variable} placeholders with actual session data gathered in Steps 1-3.
Step 5: Update STATE.md
CRITICAL -- DO NOT SKIP: Update STATE.md frontmatter AND body. Both must be updated atomically.
First, update the STATE.md YAML frontmatter:
- Set
last_command: "$pbr-pause" - Set
last_activity: {ISO datetime}
Then update the Session Continuity section of STATE.md:
### Session Continuity
**Last paused:** {ISO datetime}
**Position:** Phase {N}, Plan {M}
**Continue file:** .planning/phases/{NN}-{phase-name}/.continue-here.md
**Next action:** {suggested command}
If the Session Continuity section doesn't exist, create it at the end of STATE.md.
Step 6: Commit as WIP
Reference: skills/shared/commit-planning-docs.md for the standard commit pattern.
If planning.commit_docs: true in config.json:
git add .planning/phases/{NN}-{phase-name}/.continue-here.md
git add .planning/STATE.md
git commit -m "wip(planning): save session state — phase {N} plan {M}"
Commit rules:
- Always use
wip(planning):prefix for pause commits - Include phase and plan numbers
- Stage only the continue-here and STATE.md files
- Do NOT stage any code changes (those should already be committed by the executor)
Step 7: Confirm to User
Display branded confirmation:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► SESSION SAVED ✓ ║
╚══════════════════════════════════════════════════════════════╝
Position: Phase {N} — {phase name}, Plan {M}
Completed: {count} plans this session
Remaining: {count} plans in this phase
╔══════════════════════════════════════════════════════════════╗
║ ▶ NEXT UP ║
╚══════════════════════════════════════════════════════════════╝
**Resume in your next session**
`$pbr-resume`
<sub>`/clear` first → fresh context window</sub>
What Gets Captured
| Information | Source | Why It Matters |
|---|---|---|
| Phase + plan position | STATE.md | Know where to start |
| Completed work | SUMMARY.md files, git log | Know what's already done |
| Remaining work | Plan files without summaries | Know what's left |
| Decisions | CONTEXT.md, SUMMARY.md | Preserve user preferences |
| Blockers | STATE.md, verification files | Don't repeat failed approaches |
| Next steps | Routing logic | Immediate action on resume |
Edge Cases
No work was done this session
- Still write the continue-here file
- "Completed This Session" section says: "No plans completed (discussion/planning only)"
- Capture any decisions or context from the conversation
Multiple phases were worked on
- Write .continue-here.md in the MOST RECENT phase directory
- Reference the other phases in the "Completed This Session" section
- Next steps should focus on the current position
Mid-task pause (executor was interrupted)
- Note which task was in progress
- Warn: "Task {name} was in progress when paused. It may need to be re-executed."
- Check git log to see if any partial commits exist
.continue-here.md already exists
- Always REPLACE the existing file entirely — never append
- Appending causes stale data from previous sessions to persist, which confuses resume
- The old .continue-here.md content is superseded by the current state
- No need to ask the user — the current session state is always more accurate
STATE.md doesn't exist
- Warn: "No STATE.md found. Creating a minimal pause file."
- Write .continue-here.md based on git log and file system scan only
- Don't try to update STATE.md
No git history (fresh project)
- Skip the git log step
- Estimate session work from file modification times
- Still write the continue-here file
Anti-Patterns
- DO NOT include full file contents in .continue-here.md — keep it concise
- DO NOT stage code files in the WIP commit — only planning docs
- DO NOT skip the commit when
planning.commit_docsis enabled — the WIP commit preserves the pause state in version control and ensures.continue-here.mdis not lost if working tree changes occur - DO NOT write multiple .continue-here.md files — one per pause
- DO NOT include sensitive information (API keys, passwords) in the handoff
- DO NOT modify any code files — this skill only writes planning docs
- DO NOT skip the "Next Steps" section — it's the most important part for resumption
Source
git clone https://github.com/SienkLogic/plan-build-run/blob/main/plugins/codex-pbr/skills/pause/SKILL.mdView on GitHub Overview
The pause skill captures your current session state and writes a portable handoff file (.continue-here.md) so you can resume exactly where you left off. It consolidates position, plan status, blockers, decisions, and suggested next actions for a smooth handoff.
How This Skill Works
When invoked (optionally with --checkpoint), the skill extracts the current phase, plan status, progress, blockers, and recent decisions, then writes a compact .continue-here.md file. It runs inline, without delegating tasks, to produce a self-contained resume snapshot.
When to Use It
- You are mid-flight in a multi-step plan and need a clean point to resume later.
- You want a quick checkpoint that captures Position, status, and a suggested next action using --checkpoint.
- You’re handing off work to a teammate and need a faithful session snapshot.
- You’re between plans or phases and want a clear handoff outline.
- You must pause to switch tools or tasks but retain full context for later resumption.
Quick Start
- Step 1: Run the pause command at a suitable checkpoint (or with --checkpoint for a quick dump).
- Step 2: Locate and review the generated .continue-here.md to confirm contents.
- Step 3: In the next session, load the saved state and resume from the indicated position.
Best Practices
- Use --checkpoint for lightweight, fast dumps that focus on Position, git status, and next action.
- Verify the saved .continue-here.md includes Phase, Plan, Status, and Next Action.
- Cross-check STATE.md and ROADMAP.md to ensure the snapshot matches current reality.
- Keep a single canonical handoff file per session to avoid drift.
- Update and re-pause after significant progress to keep the resume point fresh.
Example Use Cases
- Pausing after completing a phase to share a clear resume point with teammates.
- Saving a checkpoint before attempting a potentially disruptive change in the plan.
- Handing off a project context to a new engineer with a .continue-here.md.
- Pausing during mid-plan work to switch to another tool, then resuming later.
- Recording blockers and decisions in a resume snapshot for later review.