Skip to content

Commit 5fed946

Browse files
committed
fix: stronger auto-continue when goal step completed
The PostToolUse hook for goal_update_step now injects full next-step context via additionalContext (not just a systemMessage nudge), with an explicit continuation directive. This prevents Claude from stopping to ask the user between goal steps. Co-developed-by: Claude Code v2.1.50 (claude-opus-4-6)
1 parent ee50b65 commit 5fed946

4 files changed

Lines changed: 39 additions & 12 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "context-daddy",
1010
"source": "./",
1111
"description": "Your codebase's context needs a responsible adult. Fast code exploration, living project narratives, and tribal knowledge that survives across sessions.",
12-
"version": "0.15.3",
12+
"version": "0.15.4",
1313
"author": {
1414
"name": "Robert Taylor"
1515
},

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "context-daddy",
3-
"version": "0.15.3",
3+
"version": "0.15.4",
44
"description": "Your codebase's context needs a responsible adult. Fast code exploration, living project narratives, and tribal knowledge that survives across sessions.",
55
"author": {
66
"name": "Robert Taylor"

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to the context-tools plugin will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.15.4] - 2026-03-04
9+
10+
### Fixed
11+
- **Stronger auto-continue after step completion** - When `goal_update_step` marks a step done, the hook now injects the full next-step context via `additionalContext` (not just a soft `systemMessage` nudge), with an explicit "ACTION REQUIRED: Continue immediately" directive
12+
813
## [0.15.3] - 2026-03-04
914

1015
### Added

hooks/goals-post-tool.sh

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
# PostToolUse hook for goals MCP tools
3-
# Shows updated goal status as a transient message after goal changes
3+
# Shows updated goal status after goal changes.
4+
# When a step is completed, injects the next step details and a strong
5+
# continuation directive so Claude doesn't stop and wait.
46
set -euo pipefail
57

68
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../scripts" && pwd)"
@@ -14,19 +16,39 @@ TOOL_OUTPUT=$(echo "$INPUT" | python3 -c "import sys,json; print(json.load(sys.s
1416
# Get updated status
1517
GOAL_STATUS=$(bash "${SCRIPT_DIR}/goal-context-helper.sh" --status "${PROJECT_ROOT}" 2>/dev/null || true)
1618

17-
if [[ -n "${GOAL_STATUS}" ]]; then
18-
# Add continuation nudge when a step was just completed
19-
NUDGE=""
20-
if [[ "${TOOL_NAME}" == *"goal_update_step"* ]] && echo "${TOOL_OUTPUT}" | grep -q "completed"; then
21-
NUDGE=" | Continue to the next step."
19+
if [[ -z "${GOAL_STATUS}" ]]; then
20+
echo '{}'
21+
exit 0
22+
fi
23+
24+
# When a step was just completed, inject strong continuation context
25+
if [[ "${TOOL_NAME}" == *"goal_update_step"* ]] && echo "${TOOL_OUTPUT}" | grep -q "completed"; then
26+
# Check if all steps are done
27+
if echo "${TOOL_OUTPUT}" | grep -q "All steps done"; then
28+
STATUS_ESCAPED=$(echo -n "${GOAL_STATUS} | All steps complete!" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" | sed 's/^"//;s/"$//')
29+
cat << EOF
30+
{
31+
"systemMessage": "${STATUS_ESCAPED}"
32+
}
33+
EOF
34+
else
35+
# Get full goal context with next step details
36+
GOAL_CONTEXT=$(bash "${SCRIPT_DIR}/goal-context-helper.sh" "${PROJECT_ROOT}" 2>/dev/null || true)
37+
CONTINUATION="✅ Step completed. Here is your updated goal context:\n\n${GOAL_CONTEXT}\n\n**ACTION REQUIRED**: Continue immediately with the next step shown above. Do NOT stop to ask the user — they expect you to keep working through the goal steps. Only pause if you need user input or clarification for the NEXT step."
38+
CONTEXT_ESCAPED=$(echo -e "${CONTINUATION}" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" | sed 's/^"//;s/"$//')
39+
STATUS_ESCAPED=$(echo -n "${GOAL_STATUS}" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" | sed 's/^"//;s/"$//')
40+
cat << EOF
41+
{
42+
"systemMessage": "${STATUS_ESCAPED}",
43+
"additionalContext": "${CONTEXT_ESCAPED}"
44+
}
45+
EOF
2246
fi
23-
MSG="${GOAL_STATUS}${NUDGE}"
24-
STATUS_ESCAPED=$(echo -n "${MSG}" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" | sed 's/^"//;s/"$//')
47+
else
48+
STATUS_ESCAPED=$(echo -n "${GOAL_STATUS}" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" | sed 's/^"//;s/"$//')
2549
cat << EOF
2650
{
2751
"systemMessage": "${STATUS_ESCAPED}"
2852
}
2953
EOF
30-
else
31-
echo '{}'
3254
fi

0 commit comments

Comments
 (0)