Companion plugin to Claude Code's native /goal (v2.1.139+).
Two skills:
/cc-goal-stack:goal-prep— pre-execution intake. Walks a 6-question diagnostic ladder (3 batches), seeds anti-patterns, writes agoal.mdcharter, and emits a paste-ready preamble + native/goal <condition>command./cc-goal-stack:autoresearch— deterministic keep-or-revert metric loop. Commit before verify, revert on regression. Backwards-compatible withagent-workflowautoresearch files.
cc-goal-stack does not replace native /goal. Native handles the
auto-loop; this plugin adds warmup, anti-patterns, codex review hooks,
and an orthogonal metric loop.
# Charter + preamble for any goal
/cc-goal-stack:goal-prep find P1 bugs in checkout/*
# Then paste the printed preamble + run printed /goal command
/goal Five P1 bugs in checkout/* are logged with repro+expected+actual, or stop after 20 turns
# Or run a metric loop directly
/cc-goal-stack:autoresearch reduce p95 latency of /api/search- Validate objective length (≤4000 chars, matches upstream Codex).
- Silent 11-field intake compiler.
- 6 diagnostic ladder questions (3 batches: 1 → 2 → 3) with the reflection pattern: "I read this as: X. Blind spot: Y. Material question? 1/2/3. Default: N." Last batch includes a heads-up slot for what user already tried / domain failure modes.
- Classify goal kind, derive slug, create
<cwd>/.claude/cc-goal-stack/<slug>/. - Write
goal.mdwith intake summary + anti-patterns + adversarial-review block. - Print preamble (for pasting into conversation) +
/goal <condition>command.
Strictly non-execution. The skill never reads implementation files, never browses repos, never invokes other skills the user mentioned.
Not for /autoresearch. /goal-prep emits a charter for native
/goal's condition-driven auto-loop (model-judged completion). For
metric optimization with deterministic keep-or-revert, run
/cc-goal-stack:autoresearch directly — it has its own intake phase.
The two skills don't interoperate by design.
Setup, then per iteration ideate → delegate-to-subagent → verify →
keep or revert. The cc-goal-stack:autoresearch-worker subagent
applies one hypothesis inside scope, commits, and writes a receipt to
autoresearch-iterations/iter-<N>.md; parent reads only the receipt
summary, so context size stays roughly constant per iteration.
ScheduleWakeup paces sub-hour iterations; CronCreate paces longer ones
(durable across sessions). Requires git. Backwards-compatible with
agent-workflow scratchpad/history formats (state schema v2 adds
codex_enabled + sibling autoresearch-iterations/; v1 state
auto-migrates on --continue).
Optional codex auto-suggest at trigger points: 3 consecutive failures →
spawn codex:codex-rescue subagent (or print /codex:rescue for user);
pre-merge → run codex review --base main via Bash (CLI, not slash —
/codex:adversarial-review has disable-model-invocation: true). Never
auto-applied.
- Surface:
/goal <condition>,/goal clear(aliases:stop/off/reset/none/cancel). To resume a session that had an active goal, useclaude --resumeorclaude --continue— the goal is auto-restored. - Built-in Stop-hook wrapper + Haiku evaluator after each turn.
- Char limit: ≤4000.
- Default bound: append
, or stop after N turns(we use 20). - Evaluator sees only conversation context, not files on disk. That's
why
/goal-prepemits a paste-ready preamble. - Source: closed binary. openai/codex
(
codex-rs/core/templates/goals/) has a similar implementation worth reading for the design rationale.
In a Claude Code session:
/plugin marketplace add DefaultPerson/cc-goal-stack
/plugin install cc-goal-stack@cc-goal-stack
/reload-plugins
git clone https://github.com/DefaultPerson/cc-goal-stack
claude --plugin-dir ./cc-goal-stack- Slash commands
/cc-goal-stack:goal-prepand/cc-goal-stack:autoresearchappear in/helpand slash autocomplete. - The
cc-goal-stack:autoresearch-workersubagent is available to the Agent tool (used by/autoresearchPhase 2.5 for context economy). /reload-pluginspicks up changes without a full Claude Code restart.
- tolibear/goalbuddy (MIT) —
11-field Intake Compiler, diagnostic ladder pattern,
goal.mdcharter structure. - openai/codex-plugin-cc (Apache 2.0) — codex review result-handling rules (no auto-apply, preserve evidence boundaries).
openai/codex (Apache 2.0) ships a
/goal command at codex-rs/core/templates/goals/ with the same
architecture (completion-condition + small-fast-model evaluator). Claude
Code v2.1.139+ has its own native /goal; whether one ports from the
other is not documented. This plugin defers loop execution to whichever
/goal is built into the current Claude Code, and does not duplicate
that prose.
MIT. See LICENSE.