plan-goal

plan-goal is a command for Claude Code from OthmanAdi/planning-with-files. It costs 43 tokens per session (645 once invoked), scanned A, original, MIT.

A command that turns a file-based task plan into a completion condition for Claude Code's goal loop, which keeps working until that condition is met.

In plain words
What is it for?
It helps run planned tasks to completion and can add an extra condition, such as requiring all tests to pass.
Why use it?
It connects the written plan to an automatic stopping rule, so work can continue until every planned phase is complete.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the planning-with-files plugin — 6 skills, 15 commands, 9 hooks shipped together

Good fit It helps run planned tasks to completion and can add an extra condition, such as requiring all tests to pass.

Compare 6 commands from other repositories ↓
About the project

OthmanAdi/planning-with-files is a planning system that stores an AI coding agent's task plan, findings, and progress in project files so the work can be recovered after context resets, crashes, or compaction. It is for long-running coding tasks across many agent tools, including Claude Code, Codex CLI, and Cursor. The catalogue entries are the project's commands, hooks, skills, plugin, and instruction for maintaining those planning files.

OthmanAdi/planning-with-files · 28,354 stars · on GitHub · planningwithfiles.tech

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add OthmanAdi/planning-with-files
Claude Code
/plugin install planning-with-files

Made for: Claude Code.

Or install planning-with-files, the plugin that ships this one along with the rest of its 6 skills, 15 commands, 9 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for plan-goal

README.md
[![agentmods](https://agentmods.dev/badge/commands/othmanadi/planning-with-files/plan-goal/github.svg)](https://agentmods.dev/commands/othmanadi/planning-with-files/plan-goal)
Your own site
<a href="https://agentmods.dev/commands/othmanadi/planning-with-files/plan-goal"><img src="https://agentmods.dev/badge/commands/othmanadi/planning-with-files/plan-goal/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for plan-goal

Your own site · 80×15
<a href="https://agentmods.dev/commands/othmanadi/planning-with-files/plan-goal"><img src="https://agentmods.dev/badge/commands/othmanadi/planning-with-files/plan-goal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 645 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.00645
Opus 5.5 $0.00017 $0.00258
Sonnet 5.5 $0.00009 $0.00129
Haiku 4.5 $0.00004 $0.00064

Measured 1mo ago against content hash db4e2c95c2da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plan-goal scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/plan-goal.md · 34 lines

What it actually says

Bridge the active plan to Claude Code's /goal primitive.

Steps:

  1. Validate ${PWF_PLAN_ROOT} as an absolute existing project root when set; refuse an invalid root pin. Otherwise use cwd as the project root. Resolve the selected plan with sh ${CLAUDE_PLUGIN_ROOT}/scripts/resolve-plan-dir.sh (PowerShell: & "$env:CLAUDE_PLUGIN_ROOT\scripts\resolve-plan-dir.ps1"). A printed directory is the selected plan. On empty output:
    • With non-empty ${PLAN_ID}, the plan selector was rejected. Refuse and ask the user to correct the pin; never fall back to another plan.
    • If resolve-plan-dir.sh --check-ambiguity (PowerShell: -CheckAmbiguity) prints PWF_PLAN_AMBIGUOUS_V1, multiple plans exist without a selector. Refuse and ask the user to set PLAN_ID=<slug>.
    • Otherwise use legacy task_plan.md from the validated project root (PWF_PLAN_ROOT when set), if it exists. A valid root pin alone does not reject a legacy root plan. The shared .planning/.active_plan pointer does not bind a parallel session.
  2. Read the selected task_plan.md and retain its absolute path for the goal condition and completion check.
  3. Derive a goal condition from the plan content:
    • Default: "all phases in the selected task_plan.md report Status: complete and check-complete.sh with that explicit plan path reports ALL PHASES COMPLETE"
    • If user passed an argument: use that as an additional clause (e.g., /plan-goal until all tests pass)
  4. Issue Claude Code's /goal <condition> with the derived text.
  5. Confirm to the user: print the goal condition + the active plan ID + remind that /goal clear cancels.

If task_plan.md does not exist, refuse and direct user to run /plan first.

Why this exists:

/goal runs the agent until a small fast model confirms the condition is met. It evaluates the transcript only, not files. By deriving the condition from the plan file, this command turns the file-based plan into a measurable termination criterion for /goal, so the loop terminates when the plan is actually done, not when the conversation looks done.

Notes:

  • /plan-goal does not replace /goal. It composes with it. Users can still run /goal "any text" directly.
  • The derived condition stays under the 4000-char limit /goal enforces by quoting only phase headers + acceptance criteria, not full task body.
  • Combine with /plan-loop for a "babysit until done" workflow: /plan-loop cadence + /plan-goal termination.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +4 lines db4e2c95c2da
  2. 3mo ago First seen · 30 lines · 43 tokens per session scan A e148eefe8c82

Subscribe to this mod's changes

plan-goal is a command published in the GitHub repository OthmanAdi/planning-with-files (28,354 stars, last pushed today), licensed MIT. It adds 43 tokens to every session and 645 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

plan-goal compared with commands from other repositories

plan-goal next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
plan-goalOthmanAdi/planning-with-filesCommand28ktodayMITA43Claude Code
genshijin-compressInterfaceX-co-jp/genshijinCommand3365d agoMITA17Claude Code
pick-first-segmentstefanoskarakasis/Product-Marketing-SkillsCommand22yesterdayMITA11Claude Code
design-formAmey-Thakur/AI-SKILLSCommand142mo agoMITA19Claude Code
reviewnunoamorim99/agile-ledgerCommand11mo agoMITA16Claude Code
standupnunoamorim99/agile-ledgerCommand11mo agoMITA9Claude Code
enum-udppashki975/thm-claude-kitCommand23mo agoMITA16Claude Code