Name
ai-dlc:reset - Clear AI-DLC state and start fresh.
Synopsis
code
/reset
Description
User-facing command - Run this to abandon current task or start fresh.
Clears all AI-DLC state for the current branch. Use this to:
- •Start fresh on a new task
- •Clean up after completing a task
- •Abandon a task that's no longer needed
This only clears AI-DLC state. It does not:
- •Undo code changes
- •Delete branches
- •Revert commits
The work you did is preserved in git. Only the AI-DLC workflow state is cleared.
Implementation
Step 1: Confirm (Optional)
If the task is not complete, warn:
bash
# Intent-level state is on current branch (intent branch)
STATE=$(han keep load iteration.json --quiet || echo "{}")
# If status is not "complete", warn the user
# "Warning: Task is not complete. Current hat: $HAT"
# "Are you sure you want to clear all state?"
Step 1b: Cleanup Team (Agent Teams)
If teamName exists in iteration.json and CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS is set:
bash
TEAM_NAME=$(echo "$STATE" | han parse json teamName -r --default "")
AGENT_TEAMS_ENABLED="${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-}"
If TEAM_NAME is not empty and AGENT_TEAMS_ENABLED is set:
- •Send shutdown requests to all active teammates:
javascript
// Read team config to find active members
// For each active teammate:
SendMessage({
type: "shutdown_request",
recipient: teammateName,
content: "AI-DLC reset requested. Shutting down team."
})
- •
Wait for shutdown confirmations
- •
Delete the team:
javascript
TeamDelete()
Without Agent Teams: Skip this step entirely. No team exists to clean up.
Step 2: Delete All AI-DLC Keys
bash
# Clear intent-level state from current branch (intent branch) han keep delete iteration.json han keep delete intent.md han keep delete completion-criteria.md han keep delete current-plan.md han keep delete intent-slug # Clear unit-level state from current branch han keep delete scratchpad.md han keep delete blockers.md han keep delete next-prompt.md
Step 3: Confirm
Output:
code
AI-DLC state cleared. All iteration data, intent, criteria, and notes have been removed. To start a new task, run `/elaborate`.
What Gets Cleared
Intent-Level State (from intent branch)
| Key | Purpose |
|---|---|
iteration.json | Hat, iteration count, workflow, status |
intent.md | What we're building |
completion-criteria.md | How we know it's done |
current-plan.md | Plan for current iteration |
intent-slug | Slug identifier |
Unit-Level State (from current branch)
| Key | Purpose |
|---|---|
scratchpad.md | Learnings and notes |
blockers.md | Documented blockers |
next-prompt.md | Continuation prompt |