Skip to content

DefaultPerson/cc-goal-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc-goal-stack

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 a goal.md charter, 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 with agent-workflow autoresearch 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.

Quick start

# 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

How /goal-prep works

  1. Validate objective length (≤4000 chars, matches upstream Codex).
  2. Silent 11-field intake compiler.
  3. 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.
  4. Classify goal kind, derive slug, create <cwd>/.claude/cc-goal-stack/<slug>/.
  5. Write goal.md with intake summary + anti-patterns + adversarial-review block.
  6. 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.

How /autoresearch works

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.

Native /goal cheat-sheet

  • Surface: /goal <condition>, /goal clear (aliases: stop/off/ reset/none/cancel). To resume a session that had an active goal, use claude --resume or claude --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-prep emits a paste-ready preamble.
  • Source: closed binary. openai/codex (codex-rs/core/templates/goals/) has a similar implementation worth reading for the design rationale.

Install

Via Claude Code plugin manager (recommended)

In a Claude Code session:

/plugin marketplace add DefaultPerson/cc-goal-stack
/plugin install cc-goal-stack@cc-goal-stack
/reload-plugins

For development (live edits, current session only)

git clone https://github.com/DefaultPerson/cc-goal-stack
claude --plugin-dir ./cc-goal-stack

After install

  • Slash commands /cc-goal-stack:goal-prep and /cc-goal-stack:autoresearch appear in /help and slash autocomplete.
  • The cc-goal-stack:autoresearch-worker subagent is available to the Agent tool (used by /autoresearch Phase 2.5 for context economy).
  • /reload-plugins picks up changes without a full Claude Code restart.

Acknowledgments

  • tolibear/goalbuddy (MIT) — 11-field Intake Compiler, diagnostic ladder pattern, goal.md charter 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.

License

MIT. See LICENSE.

About

Claude Code plugin: warmup for native /goal + autoresearch (deterministic keep-or-revert metric loop).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages