[FEATURE] Set, pause and clear a native /goal without typing (launcher flag, hook output or CLI)
Problem
A native /goal can only be set, cleared or restored by typing /goal ... into the interactive prompt. A launcher or supervisor script that runs interactive sessions (in tmux) has to type the command into the terminal, and a goal cannot be paused or cleared by a script at all.
Checked on 2.1.294 (Linux): claude --help has no goal option; the only "--goal" string in the binary is an option of the embedded shell-command parser (valuedLong: --width, --goal, --prefix); the only goal-related environment variable I found is CLAUDE_CODE_GOAL_CHECKIN_MINUTES. No setting or hook output sets a goal. A resumed conversation restores an active goal (documented), but a new conversation cannot start with one.
Requests (one concept: driving a goal without typing)
- Set: a way to start an interactive session with a goal, e.g.
claude --goal "<condition>"or--goal-file <path>. - Clear / pause: a way to clear or pause the goal from outside the model turn, e.g. a Stop-hook output field (
"clearGoal": true) or a CLI/IPC command. Today a Stop hook that answers{"continue": false}ends the turn, but the goal stays set and fires again on the next turn, so a script cannot take a goal away without typing/goal clear(which needs the session idle and its prompt visible).
Why
Unattended or supervised sessions (a session paused during a game, restored after a reboot) need to restore, pause and clear a goal deterministically. Typing into a terminal is fragile, and each typed line is recorded as if the human wrote it.
Environment
Claude Code 2.1.294, Linux (Bazzite, Fedora atomic), interactive terminal sessions.
Related
#70649 (model-invocable /goal, closed), #94041 (/goal Stop hook re-fires with no way to acknowledge a hold), #90558.
---
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🤖 Generated with Claude Code