forge-goal

forge-goal is a command for Claude Code from pablomarin/claude-codex-forge. It costs 0 tokens per session (1,007 once invoked), scanned A, original, MIT.

A Forge workflow for managing a durable, human-authorized goal across agent turns. Forge is a workflow layer that records the goal, scope version, progress, evidence, and active host.

In plain words
What is it for?
Use it to run long, bounded agent goals with turn limits, progress tracking, qualification checks, and evidence records.
Why use it?
It prevents work from continuing without authorization or losing track of the exact task and its progress. It can resume the next unchecked step while preserving the original workflow reference.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: reads .claude/ paths.

Good fit Use it to run long, bounded agent goals with turn limits, progress tracking, qualification checks, and evidence records.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/pablomarin/claude-codex-forge/forge-goal
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/pablomarin/claude-codex-forge

Made for: Claude Code.

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 forge-goal

README.md
[![agentmods](https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/forge-goal/github.svg)](https://agentmods.dev/commands/pablomarin/claude-codex-forge/forge-goal)
Your own site
<a href="https://agentmods.dev/commands/pablomarin/claude-codex-forge/forge-goal"><img src="https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/forge-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 forge-goal

Your own site · 80×15
<a href="https://agentmods.dev/commands/pablomarin/claude-codex-forge/forge-goal"><img src="https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/forge-goal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,007 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.00000 $0.01007
Opus 5.5 $0.00000 $0.00403
Sonnet 5.5 $0.00000 $0.00201
Haiku 4.5 $0.00000 $0.00101

Measured 13d ago against content hash 4b58121cc48b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

forge-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 13d 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/forge-goal.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Forge Goal Composition Contract

This canonical workflow is installed only as .forge/workflows/goal.md. Forge must never install .claude/commands/goal.md or .agents/skills/goal/SKILL.md; each host retains its native /goal.

Activation

  1. Read .forge/local/state.md and the active workflow. The developer's native /goal invocation or explicit native Goal request is the human activation; agent-written state never grants autonomy.
  2. For a new objective, create a nonce, stable objective hash, and activation UUID. Set turn_count to 0, activation_count to 1, and turn_ceiling to 20. For a same-objective reactivation after exhaustion, retain the nonce and validated count, generate a new activation UUID, increment activation_count, and set the ceiling to 20 * activation_count. A changed objective always gets a new nonce and starts from zero.
  3. Persist the exact goal fields from state.template.md, then run .forge/hooks/lib/goal-ledger.sh activate --project <root> --state .forge/local/state.md (or the PowerShell twin). The helper must accept the next sequential activation before work continues.
  4. Compose the host's native Goal over this contract only when authenticated qualification proves every Must behavior. Otherwise report BLOCKED; never claim reduced parity.

Loop

On every turn:

  1. Validate the repository binding, activation sequence, objective nonce, durable count/ceiling, state, and evidence. At the start of every continued turn, first sync the state's turn_count to the ledger's already-published count. The Stop hook appends the current turn afterward, so state may lag the ledger by exactly one only between Stop and the next turn; any greater lag or count reduction fails closed.
  2. Resume the exact next unchecked durable step. A same-host resume may restore native context; a cross-host resume starts a fresh native session and never claims session transfer.
  3. Increment the persistent Forge count through hook-owned records. Native session, token, or turn counters may reset; the Forge ceiling and consumed count never reset after interruption or host switching.
  4. Record measurable checklist progress and the next step. FORGE_GOAL_STUCK_WARNING is advisory: inspect progress, run the cheapest safe falsifying check, or surface a blocker; it does not reset the budget or authorize another broad loop. Do not invoke /council as a routine response. During Goal, Council may resolve a genuine non-destructive decision. It must concern product or engineering judgment and be required to continue the active native Goal. If the check produces a deterministic smallest answer, use that instead. Otherwise apply the chairman's verdict and continue. Council also remains available for an explicit developer request or a concrete high-impact architectural fork that remains unresolved after the check.
  5. If FORGE_GOAL_BUDGET_EXHAUSTED appears, preserve the exact checkpoint and stop native autonomy. Resume requires a new native /goal invocation or explicit native Goal request. Same-objective reactivation adds exactly one 20-turn tranche and continues with the existing count; it never starts at zero.
  6. Invalidate only receipts whose candidate boundary changed and rerun the affected final gates.

Read the full file on GitHub · 72 lines

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. 13d ago Changed · +1 lines 4b58121cc48b
  2. 16d ago Changed · +7 lines cf1944f8c55a
  3. 17d ago Changed · +12 lines 20b9c5638112
  4. 1mo ago First seen · 52 lines · 0 tokens per session scan A 515fcf028f2e

Subscribe to this mod's changes

forge-goal is a command published in the GitHub repository pablomarin/claude-codex-forge (5 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,007 tokens. 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-09-04.