Skip to content

Add agent notes for Claude Code prompt-based hooks#142

Merged
nhorton merged 2 commits intoclaude/remove-formatting-instructions-RlKz2from
claude/update-prompt-rules-EwzPX
Jan 23, 2026
Merged

Add agent notes for Claude Code prompt-based hooks#142
nhorton merged 2 commits intoclaude/remove-formatting-instructions-RlKz2from
claude/update-prompt-rules-EwzPX

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 23, 2026

Summary

Added documentation for AI agents working on Claude Code jinja templates, specifically addressing best practices when implementing prompt-based hooks.

Changes

  • Created src/deepwork/templates/claude/AGENTS.md with guidance for prompt-based hook implementation
  • Documented that response format instructions should NOT be included in prompt hooks, as Claude Code's internal instructions already specify the expected format
  • Added reference to related Claude Code issue for context

Details

This documentation clarifies a common pitfall when writing prompt-based hooks (e.g., Stop hooks with type: prompt). Including redundant response format instructions can conflict with Claude Code's built-in behavior. The guide directs developers to rely on the framework's internal specifications rather than adding custom response format directives.

Add notes for AI agents working on jinja templates, specifically
documenting that prompt-based hooks should not include response
format instructions since Claude Code's internal instructions
already specify the expected format.

Reference: anthropics/claude-code#11786
@nhorton nhorton changed the base branch from main to claude/remove-formatting-instructions-RlKz2 January 23, 2026 22:37
Clarified instructions regarding response format in prompt-based hooks.
@nhorton nhorton merged commit c8d18ec into claude/remove-formatting-instructions-RlKz2 Jan 23, 2026
@nhorton nhorton deleted the claude/update-prompt-rules-EwzPX branch January 23, 2026 22:38
nhorton added a commit that referenced this pull request Jan 23, 2026
)

* refactor: simplify prompt hook instructions to remove JSON formatting

Remove explicit JSON response format instructions from prompt-based hooks.
Instead of instructing to respond with {"ok": true} or {"ok": false, "reason": "..."},
use simpler language like "let the agent finish" or "have the agent keep working".

Updated:
- skill-job-step.md.jinja template
- hooks_system.md documentation
- Regenerated all skill files via deepwork install

* Add agent notes for Claude Code prompt-based hooks (#142)

* docs: add AGENTS.md for claude templates with prompt hook guidance

Add notes for AI agents working on jinja templates, specifically
documenting that prompt-based hooks should not include response
format instructions since Claude Code's internal instructions
already specify the expected format.

Reference: anthropics/claude-code#11786

* Update AGENTS.md with clarification on response format

Clarified instructions regarding response format in prompt-based hooks.

---------

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants