帮我安装[Pasclaude-goal A Codex-style /goal command for Claude Code. It gives Claude Code a…
- User
帮我安装[Pasclaude-goal A Codex-style /goal command for Claude Code.
It gives Claude Code a persistent local goal state, Codex-inspired continuation instructions, pause/resume/clear/status controls, completion-audit guardrails, and a Stop hook that keeps Claude working while a goal is active.
Install git clone https://github.com/jthack/claude-goal.git cd claude-goal ./install.sh This installs:
~/.claude/skills/goal as a symlink to this repo's goal/ directory a user-level Claude Code Stop hook in ~/.claude/settings.json The goal/ directory is the Claude skill package. It contains SKILL.md, scripts/claude_goal.py, and reference notes.
State is stored at:
~/.claude/goal/goals.sqlite Usage /goal find and fix the flaky auth tests /goal --tokens 250K do deep research and build the full prototype /goal /goal status /goal pause /goal resume /goal clear When a goal is active, the command returns a continuation prompt that wraps the goal text in and requires a completion audit before marking the goal complete.
Notes Claude Code custom skills do not currently expose reliable live per-turn token usage to markdown commands. Token budgets are therefore stored and displayed as soft budgets. Elapsed-time tracking is local and persistent.
The Stop hook blocks Claude from stopping while the current goal is active. It stops blocking when you run /goal pause, /goal clear, or /goal complete.
By default, the runaway guard allows up to 500 Stop-hook continuations for a single active goal. That high default is intentional: /goal is meant for long-running work where Claude may need many turns to finish. If you want a stricter cap, set CLAUDE_GOAL_MAX_STOP_CONTINUES before launching Claude Code:
export CLAUDE_GOAL_MAX_STOP_CONTINUES=50 Test python3 -m pytest teststps://github.com/jthack/claude-goal
Assistant
安装成功。验证一下:
Assistant
已安装完成。状态:
- Skill 路径:
/user_4813494d/.claude/skills/goal→/tmp/claude-goal/goal(symlink) - Stop hook: 已写入 Claude Code settings
- 状态数据库:
/user_4813494d/.claude/goal/goals.sqlite - 当前状态: 无活跃 goal
现在可以在 Claude Code 中使用
/goal命令了。- Skill 路径:
- User
给我讲讲怎么用这个命令
Assistant
基本用法
命令 作用 /goal 做某事...设置一个新目标 /goal --tokens 250K 做某事...设置目标时附带软 token 预算 /goal查看当前目标和 continuation 指令 /goal status查看当前目标 /goal pause暂停目标(Stop hook 停止拦截) /goal resume恢复目标 /goal clear删除目标 /goal complete完成目标(会先触发完成审计) 核心机制
- 设置目标后 — Claude 每次返回都会带上 continuation prompt,把目标包在
<objective>里,持续推动你朝目标前进 - Stop hook — 当有活跃 goal 时,阻止你点 Stop 退出,迫使你继续工作(除非
/goal pause、/goal clear或/goal complete) - 防跑飞 — 默认最多 500 次 Stop hook 连续续命,可通过环境变量
CLAUDE_GOAL_MAX_STOP_CONTINUES调低 - 完成审计 —
/goal complete时,Claude 会执行六步审计:重述目标 → 检查清单 → 查文件/测试/输出 → 找遗漏 → 补缺 → 确认完成后才标记完成
例子
code/goal 给用户模块加上单元测试,覆盖率到 80%之后每次对话都会看到 的 continuation 提示。
- 设置目标后 — Claude 每次返回都会带上 continuation prompt,把目标包在