Skip to content

fix: make constitution warning an explicit Claude instruction via stdout#11

Merged
salimomrani merged 1 commit into
masterfrom
fix/constitution-prompt-explicit-claude-instruction
Mar 11, 2026
Merged

fix: make constitution warning an explicit Claude instruction via stdout#11
salimomrani merged 1 commit into
masterfrom
fix/constitution-prompt-explicit-claude-instruction

Conversation

@salimomrani

Copy link
Copy Markdown
Owner

Summary

Claude Code injects SessionStart hook stdout silently into Claude's context — Claude wasn't proactively mentioning the unfilled constitution because the previous warning was only on stderr.

This fix uses a dual approach:

  • stdoutIMPORTANT: ... instruction forcing Claude to tell the user to run /speckit.constitution on the very next response
  • stderr → short terminal-visible message ⚠️ Constitution not configured yet. Run: /speckit.constitution

Test plan

  • Test updated to assert both >&2 and IMPORTANT are present in the generated hook
  • 47/47 tests passing

🤖 Generated with Claude Code

Claude Code injects SessionStart hook stdout into context silently —
Claude wasn't acting on the previous stderr-only approach. Now outputs
an IMPORTANT instruction to stdout (Claude's context) so Claude is
forced to mention it on the next response, plus a short stderr message
for immediate terminal visibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@salimomrani
salimomrani merged commit 219f44b into master Mar 11, 2026
4 checks passed
@salimomrani
salimomrani deleted the fix/constitution-prompt-explicit-claude-instruction branch April 16, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant