# Goal Prompt

Drafts copy-paste-ready /goal commands for goal mode in Claude Code and Codex.

- Repository: https://github.com/trailofbits/skills (7935 stars)
- Category: AI and agents
- License: CC-BY-SA-4.0
- Last updated: 2026-10-28
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add trailofbits/skills --skill goal-prompt -g -a claude-code -y`
Codex: `npx skills add trailofbits/skills --skill goal-prompt -g -a codex -y`
Cursor: `npx skills add trailofbits/skills --skill goal-prompt -g -a cursor -y`
Gemini CLI: `npx skills add trailofbits/skills --skill goal-prompt -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add trailofbits/skills`

## Description

Drafts copy-paste-ready /goal commands for goal mode in Claude Code and Codex. Use when the user asks to create, write, rewrite, improve, compress, clean up, or prepare a goal prompt, goal condition, /goal command, goal-mode objective, or copy-ready long-running task objective.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Goal Prompt

`/goal` keeps the agent working until a completion condition is met. Both Claude Code and Codex take it as one line, max 4,000 characters. In Claude Code a small model re-judges the condition after each turn from the transcript alone, it cannot run commands.

Draft a condition that can terminate, then format it. A goal fits work bigger than one turn with a checkable finish line; chain small goals with review between them rather than writing one giant goal.

## Draft

Include, joined with AND, never "or", the loop takes the cheaper branch:

1. **End state, not activity**, "all `legacyAuth()` call sites use `auth.verify()`", not "migrate the auth code". An activity can be claimed; an end state is true or false.
2. **Scope to read first**, the files, issue, logs, or plan to read before acting.
3. **Stated check**, the exact command and its observable result ("`npm test` exits 0"), plus an instruction to run it and show the output; a result that never lands in the transcript does not exist to the evaluator.
4. **Invariants**, what must not change ("without modifying vendor/"), always including "do not weaken, skip, or edit the checks themselves".
5. **Stop bound or blocked clause**, "or stop after 20 turns", "if blocked, stop and report the blocker". Without one, a mis-stated condition loops forever; the formatter warns when it is missing. (Claude Code resets the turn counter on session resume, so a turn bound silently extends across resumes.)

**Keep it small.** Every constraint narrows the state space the model can explore. Collapse to one terminating criterion when possible, move scope and definitions into a referenced file, and drop non-goals, a constraint earns its place only by closing a real easy-out.

The rest: https://github.com/trailofbits/skills/blob/HEAD/plugins/goal-prompt/skills/goal-prompt/SKILL.md
