claude-dev-env 8.115.0 → 8.116.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install.prompt-context.test.mjs +5 -6
- package/docs/rule-guides/verified-work.md +1 -1
- package/hooks/advisory/commit_and_pull_request_words.py +346 -0
- package/hooks/advisory/piece_clauses.py +248 -0
- package/hooks/advisory/pieces_per_level_analysis.py +192 -0
- package/hooks/advisory/pieces_per_level_note.py +265 -0
- package/hooks/advisory/test_commit_and_pull_request_words.py +126 -0
- package/hooks/advisory/test_piece_clauses.py +183 -0
- package/hooks/advisory/test_pieces_per_level_note.py +389 -0
- package/hooks/advisory/test_pieces_per_level_note_bounds.py +215 -0
- package/hooks/advisory/test_pieces_per_level_note_deadline.py +282 -0
- package/hooks/blocking/final_reply_gate.py +7 -29
- package/hooks/blocking/test_final_reply_gate.py +4 -196
- package/hooks/features/README.md +1 -1
- package/hooks/features/conduct-gates.md +5 -12
- package/hooks/features/session-context.md +4 -1
- package/hooks/hooks.json +10 -41
- package/hooks/hooks_constants/background_silence_prompt_constants.py +2 -0
- package/hooks/hooks_constants/pieces_per_level_note_constants.py +255 -0
- package/hooks/hooks_constants/resolve_thread_reply_gate_constants.py +0 -8
- package/hooks/hooks_constants/shell_command_wrappers.py +20 -8
- package/hooks/hooks_constants/test_shell_command_wrappers.py +7 -0
- package/hooks/session/background_silence_prompt.py +1 -1
- package/hooks/test_context_budget_hooks.py +0 -1
- package/package.json +1 -1
- package/scripts/durable_post_lint.py +0 -12
- package/scripts/durable_post_lint_config/config/constants.py +1 -2
- package/scripts/policy_lint/adapter_configuration.py +0 -2
- package/scripts/policy_lint/config/constants.py +0 -2
- package/scripts/test_durable_post_lint.py +0 -53
- package/scripts/tests/test_adapter_configuration.py +0 -16
- package/scripts/tests/test_verified_work_rule.py +13 -0
- package/hooks/blocking/chat_reply_gate.py +0 -260
- package/hooks/blocking/reply_length_gate.py +0 -804
- package/hooks/blocking/test_chat_reply_gate.py +0 -302
- package/hooks/blocking/test_reply_length_gate.py +0 -1324
- package/hooks/hooks_constants/chat_reply_gate_constants.py +0 -60
- package/hooks/hooks_constants/reply_length_gate_constants.py +0 -203
- package/hooks/hooks_constants/test_reply_length_gate_constants.py +0 -81
- package/hooks/hooks_constants/test_visual_reply_rules_constants.py +0 -50
- package/hooks/hooks_constants/visual_reply_rules_constants.py +0 -106
- package/hooks/test_visual_reply_rules.py +0 -362
- package/hooks/visual_reply_rules.py +0 -478
- package/rules/visual-reply-rules.json +0 -56
|
@@ -39,205 +39,13 @@ def run_gate(
|
|
|
39
39
|
def isolated_home(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
|
40
40
|
monkeypatch.setenv("HOME", str(tmp_path))
|
|
41
41
|
monkeypatch.setenv("USERPROFILE", str(tmp_path))
|
|
42
|
-
monkeypatch.delenv("CLAUDE_REPLY_BANNED_WORDS_PATH", raising=False)
|
|
43
42
|
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
json.dumps({"type": "user", "message": {"content": [tool_result]}}), encoding="utf-8"
|
|
49
|
-
)
|
|
50
|
-
return transcript_path
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
@pytest.mark.parametrize(
|
|
54
|
-
("reply_text", "quoted_text"),
|
|
55
|
-
[
|
|
56
|
-
(GUESSED_REPLY, 'Banned word "guess"'),
|
|
57
|
-
(UNCONFIRMED_REPLY, 'No tool validated this: "Merge queue: I didn\u2019t confirm this one."'),
|
|
58
|
-
("It should take about 40 minutes.", "It should take about 40 minutes."),
|
|
59
|
-
],
|
|
60
|
-
)
|
|
61
|
-
def test_should_block_a_closing_reply_that_guesses(
|
|
62
|
-
monkeypatch: pytest.MonkeyPatch,
|
|
63
|
-
capsys: pytest.CaptureFixture[str],
|
|
64
|
-
reply_text: str,
|
|
65
|
-
quoted_text: str,
|
|
66
|
-
) -> None:
|
|
67
|
-
exit_code, stdout_text = run_gate(monkeypatch, capsys, reply_text)
|
|
68
|
-
decision = json.loads(stdout_text)
|
|
69
|
-
assert exit_code == 0
|
|
70
|
-
assert decision["decision"] == "block"
|
|
71
|
-
assert quoted_text in decision["reason"]
|
|
72
|
-
assert decision["reason"].endswith("Rewrite the reply without it.")
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def test_should_block_a_run_no_tool_result_shows(
|
|
76
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
|
|
77
|
-
) -> None:
|
|
78
|
-
transcript_path = write_tool_result_transcript(tmp_path / "s.jsonl", "run 18239170000 ok")
|
|
79
|
-
_, stdout_text = run_gate(monkeypatch, capsys, MEASURED_REPLY, transcript_path)
|
|
80
|
-
assert 'cites "run 18239174012"' in json.loads(stdout_text)["reason"]
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
def test_should_allow_a_run_a_tool_result_shows(
|
|
84
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
|
|
85
|
-
) -> None:
|
|
86
|
-
transcript_path = write_tool_result_transcript(tmp_path / "s.jsonl", "run 18239174012 took 39m")
|
|
87
|
-
assert run_gate(monkeypatch, capsys, MEASURED_REPLY, transcript_path) == (0, "")
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
CITED_PULL_URL = "https://github.com/acme/widgets/pull/8127"
|
|
91
|
-
CITED_PULL_REPLY = f"The control is open as [PR 8127]({CITED_PULL_URL})."
|
|
92
|
-
TASK_NOTIFICATION_ENTRY = {
|
|
93
|
-
"type": "user",
|
|
94
|
-
"message": {
|
|
95
|
-
"role": "user",
|
|
96
|
-
"content": (
|
|
97
|
-
"<task-notification>\n<status>completed</status>\n<result>1. PR "
|
|
98
|
-
f"[#8127]({CITED_PULL_URL}) is open. It is not armed.</result>\n</task-notification>"
|
|
99
|
-
),
|
|
100
|
-
},
|
|
101
|
-
"origin": {"kind": "task-notification", "producer": "session-task"},
|
|
102
|
-
"promptSource": "system",
|
|
103
|
-
}
|
|
104
|
-
OWN_ECHO_FEEDBACK = (
|
|
105
|
-
'Stop hook feedback:\nThe text cites "/pull/8127", and no tool result in this session'
|
|
106
|
-
" shows it. Read it yourself or through a subagent first. Rewrite the reply without it."
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
def write_transcript_entries(transcript_path: Path, all_entries: list[dict[str, object]]) -> Path:
|
|
111
|
-
transcript_path.write_text(
|
|
112
|
-
"\n".join(json.dumps(each_entry) for each_entry in all_entries), encoding="utf-8"
|
|
113
|
-
)
|
|
114
|
-
return transcript_path
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
@pytest.mark.parametrize(
|
|
118
|
-
"hook_entry",
|
|
119
|
-
[
|
|
120
|
-
TASK_NOTIFICATION_ENTRY,
|
|
121
|
-
{
|
|
122
|
-
"type": "user",
|
|
123
|
-
"isMeta": True,
|
|
124
|
-
"message": {
|
|
125
|
-
"role": "user",
|
|
126
|
-
"content": f"Stop hook feedback:\nThese pull requests are still open:\n- {CITED_PULL_URL}",
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"type": "attachment",
|
|
131
|
-
"attachment": {
|
|
132
|
-
"type": "hook_additional_context",
|
|
133
|
-
"content": [f"You opened acme/widgets#8127 {CITED_PULL_URL}"],
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"type": "attachment",
|
|
138
|
-
"attachment": {"type": "hook_system_message", "content": f"Watching {CITED_PULL_URL}"},
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"type": "attachment",
|
|
142
|
-
"attachment": {
|
|
143
|
-
"type": "queued_command",
|
|
144
|
-
"origin": {"kind": "task-notification", "producer": "session-task"},
|
|
145
|
-
"prompt": f"<task-notification><result>Opened {CITED_PULL_URL}</result></task-notification>",
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
)
|
|
150
|
-
def test_should_allow_a_pull_request_link_hook_text_shows(
|
|
151
|
-
monkeypatch: pytest.MonkeyPatch,
|
|
152
|
-
capsys: pytest.CaptureFixture[str],
|
|
153
|
-
tmp_path: Path,
|
|
154
|
-
hook_entry: dict[str, object],
|
|
155
|
-
) -> None:
|
|
156
|
-
transcript_path = write_transcript_entries(tmp_path / "s.jsonl", [hook_entry])
|
|
157
|
-
assert run_gate(monkeypatch, capsys, CITED_PULL_REPLY, transcript_path) == (0, "")
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
def test_should_block_a_pull_request_link_only_the_gate_feedback_echoes(
|
|
161
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
|
|
162
|
-
) -> None:
|
|
163
|
-
feedback_entry = {"type": "user", "isMeta": True, "message": {"role": "user", "content": OWN_ECHO_FEEDBACK}}
|
|
164
|
-
blocking_error_entry = {
|
|
165
|
-
"type": "attachment",
|
|
166
|
-
"attachment": {
|
|
167
|
-
"type": "hook_blocking_error",
|
|
168
|
-
"blockingError": {"blockingError": OWN_ECHO_FEEDBACK.removeprefix("Stop hook feedback:\n")},
|
|
169
|
-
},
|
|
170
|
-
}
|
|
171
|
-
transcript_path = write_transcript_entries(
|
|
172
|
-
tmp_path / "s.jsonl", [feedback_entry, blocking_error_entry]
|
|
173
|
-
)
|
|
174
|
-
_, stdout_text = run_gate(monkeypatch, capsys, CITED_PULL_REPLY, transcript_path)
|
|
175
|
-
assert 'cites "/pull/8127"' in json.loads(stdout_text)["reason"]
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
def test_should_block_a_pull_request_link_the_gate_quotes_in_a_sentence(
|
|
179
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
|
|
180
|
-
) -> None:
|
|
181
|
-
quoting_feedback = (
|
|
182
|
-
f'Stop hook feedback:\nNo tool validated this: "{CITED_PULL_REPLY}". Run the check yourself'
|
|
183
|
-
" or through a subagent, then state what the run, log line, output, or file and line shows."
|
|
184
|
-
" When you cannot run it this turn, report it as `Open: <check> - <next step>`."
|
|
185
|
-
f'\nSentence too long: 40 words, limit 35: "Opened {CITED_PULL_URL} and...".'
|
|
186
|
-
)
|
|
187
|
-
feedback_entry = {"type": "user", "isMeta": True, "message": {"role": "user", "content": quoting_feedback}}
|
|
188
|
-
transcript_path = write_transcript_entries(tmp_path / "s.jsonl", [feedback_entry])
|
|
189
|
-
_, stdout_text = run_gate(monkeypatch, capsys, CITED_PULL_REPLY, transcript_path)
|
|
190
|
-
assert 'cites "/pull/8127"' in json.loads(stdout_text)["reason"]
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
def test_should_block_a_pull_request_link_only_a_typed_queued_prompt_shows(
|
|
194
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
|
|
195
|
-
) -> None:
|
|
196
|
-
typed_entry = {
|
|
197
|
-
"type": "attachment",
|
|
198
|
-
"attachment": {"type": "queued_command", "origin": {"kind": "human"}, "prompt": f"Is {CITED_PULL_URL} done?"},
|
|
199
|
-
}
|
|
200
|
-
transcript_path = write_transcript_entries(tmp_path / "s.jsonl", [typed_entry])
|
|
201
|
-
_, stdout_text = run_gate(monkeypatch, capsys, CITED_PULL_REPLY, transcript_path)
|
|
202
|
-
assert 'cites "/pull/8127"' in json.loads(stdout_text)["reason"]
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
def test_should_block_a_pull_request_link_no_text_shows(
|
|
206
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
|
|
207
|
-
) -> None:
|
|
208
|
-
transcript_path = write_transcript_entries(
|
|
209
|
-
tmp_path / "s.jsonl", [{**TASK_NOTIFICATION_ENTRY, "message": {"role": "user", "content": "PR 8126 opened."}}]
|
|
210
|
-
)
|
|
211
|
-
_, stdout_text = run_gate(monkeypatch, capsys, CITED_PULL_REPLY, transcript_path)
|
|
212
|
-
assert 'cites "/pull/8127"' in json.loads(stdout_text)["reason"]
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
def test_should_block_a_run_only_hook_text_shows(
|
|
216
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
|
|
217
|
-
) -> None:
|
|
218
|
-
transcript_path = write_transcript_entries(
|
|
219
|
-
tmp_path / "s.jsonl",
|
|
220
|
-
[{**TASK_NOTIFICATION_ENTRY, "message": {"role": "user", "content": "run 18239174012 took 39m"}}],
|
|
221
|
-
)
|
|
222
|
-
_, stdout_text = run_gate(monkeypatch, capsys, MEASURED_REPLY, transcript_path)
|
|
223
|
-
assert 'cites "run 18239174012"' in json.loads(stdout_text)["reason"]
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
def test_should_steer_a_skipped_check_to_an_open_line(
|
|
227
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
|
|
228
|
-
) -> None:
|
|
229
|
-
skipped_check_reply = "I have not checked the pivot, reach, or screen 26 captures yet."
|
|
230
|
-
_, stdout_text = run_gate(monkeypatch, capsys, skipped_check_reply)
|
|
231
|
-
block_reason = json.loads(stdout_text)["reason"]
|
|
232
|
-
assert "`Open: <check> - <next step>`" in block_reason
|
|
233
|
-
assert "leave the claim out" not in block_reason
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
def test_should_allow_an_open_line_for_a_skipped_check(
|
|
237
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
|
|
44
|
+
@pytest.mark.parametrize("reply_text", [GUESSED_REPLY, UNCONFIRMED_REPLY, MEASURED_REPLY])
|
|
45
|
+
def test_should_allow_a_closing_reply_the_removed_claim_checks_once_blocked(
|
|
46
|
+
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], reply_text: str
|
|
238
47
|
) -> None:
|
|
239
|
-
|
|
240
|
-
assert run_gate(monkeypatch, capsys, open_line) == (0, "")
|
|
48
|
+
assert run_gate(monkeypatch, capsys, reply_text) == (0, "")
|
|
241
49
|
|
|
242
50
|
|
|
243
51
|
def test_should_allow_a_closing_reply_with_no_message(
|
package/hooks/features/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Each family page starts with a title and an agent-facing behavior summary. Its f
|
|
|
26
26
|
- [Bash dispatchers](./bash-dispatchers.md) covers command rewriting and the post-call reminder.
|
|
27
27
|
- [Post-write validation](./post-write-validation.md) covers the after-write dispatcher and formatter.
|
|
28
28
|
- [Conduct gates](./conduct-gates.md) covers chat replies, edit markers, step notes, checked claims, and the pull request lifecycle skill.
|
|
29
|
-
- [Session context](./session-context.md) covers skill reminders, startup guidance, the npx_pele_guidance hook, and the auto mode denial quick fix.
|
|
29
|
+
- [Session context](./session-context.md) covers skill reminders, startup guidance, the npx_pele_guidance hook, the pieces_per_level_note hook, and the auto mode denial quick fix.
|
|
30
30
|
- [Spawn routing](./spawn-routing.md) covers spawn readiness, pacing, and model selection.
|
|
31
31
|
- [Observability](./observability.md) covers instruction loads and edited files.
|
|
32
32
|
- [Read gates](./read-gates.md) covers the image size cap on Read.
|
|
@@ -4,13 +4,11 @@ This family stops a chat reply, edited message, or tool call when its payload br
|
|
|
4
4
|
|
|
5
5
|
## Checks
|
|
6
6
|
|
|
7
|
-
- `blocking/
|
|
8
|
-
- `blocking/final_reply_gate.py` applies the banned words, `unvalidated_claim_violation`, and `unseen_citation_violation_with_hook_text` from the reply gate to the reply a session ends its turn with. In that citation check a `/pull/N` link also counts as shown when hook or harness text shows it: stop-hook feedback, system reminders, a background agent's task notification, and hook additional context, hook system message, and queued task notification attachments. A skill body, or a prompt the user typed while the session worked, does not count. The gate's own feedback, which quotes the reply, does not count. Its `windows_path_violation` blocks a path the terminal would render without one of its backslashes. Its `unbriefed_question_violation` blocks a reply whose last paragraph, with fences, quotes, and code spans left out, ends with a question mark or says a question still stands, when the turn sent no `AskUserQuestion`, hearthbot decision card, or Codex `request_user_input` call; it is skipped when the transcript cannot be read.
|
|
7
|
+
- `blocking/final_reply_gate.py` checks the reply a session ends its turn with. Its `windows_path_violation` blocks a path the terminal would render without one of its backslashes. Its `unbriefed_question_violation` blocks a reply whose last paragraph, with fences, quotes, and code spans left out, ends with a question mark or says a question still stands, when the turn sent no `AskUserQuestion`, hearthbot decision card, or Codex `request_user_input` call; it is skipped when the transcript cannot be read.
|
|
9
8
|
- `blocking/open_tasks_stop_gate.py` holds the end of a turn once when the prompt that started it asks for work, the turn ran a work tool, and the turn made no tracker call: TaskCreate, TaskUpdate, TodoWrite, the Codex `update_plan`, or the desktop `mcp__ccd_turn__update_plan`. A work tool is any tool but a tracker call, the session title tool, `AskUserQuestion`, a hearthbot decision card, Codex `request_user_input`, `ToolSearch`, `TaskList`, or `TaskGet`. It never reads the reply text. `open_task_asks.is_ask` decides whether a prompt asks for work: a question-only prompt, an acknowledgement such as `thanks!`, an empty prompt, a prompt of only `<system-reminder>` blocks, and an envelope such as `<agent-message>` or `<task-notification>` do not. `blocking/open_tasks_transcript.py` replays the transcript for it: the turn's prompt, its tool calls, and the task list. `session_task_items` merges the task store with the transcript items whose subject the store does not hold, for the session title gate.
|
|
10
9
|
- `session/tracking_nudge.py` adds one `additionalContext` note to a prompt that asks for work. The note asks for an item in the session's task list tool. It shows on the session's first ask and on the first ask after each compaction, through `once_per_session.py`. When the title shows the red flag or the check mark, it also asks for the hourglass before other work. It never blocks.
|
|
11
10
|
- `session/background_silence_prompt.py` adds one `additionalContext` note to a background event prompt, one that starts with `<task-notification>` or opens itself or a `<system-reminder>` block with `[SYSTEM NOTIFICATION - NOT USER INPUT]`, while the user asked for silence. The newest user-typed message that sets silence ("silent unless", "stay silent", "silent on updates", "no updates unless") or lifts it ("you can talk again", "updates are fine", "stop being silent") decides. The note quotes the user's "unless" or "except" clause word for word, or the whole message when it has no such clause, and says to end the turn with no text unless that exception applies now. Envelope prompts, compaction summaries, and quoted `>` lines are not the user's words. It never blocks.
|
|
12
|
-
- The claim judge is a `prompt` hook in `hooks.json`, with no `model` set, so Claude Code's small default hook model reads each chat message and denies every claim, numbered in one refusal, about how code, a file, a tool, a service, a run, or a process behaves, or why something happened, when nothing in the message shows it: inline code that quotes output or a code line, a file and line, or a link. A pull request link covers what that change does, what it blocks or lets through, and its checks. The author's own actions, a restatement of the user's words, questions, instructions, and a decision card's option consequences pass. It catches
|
|
13
|
-
- `blocking/chat_reply_gate.py` runs the `reply_length_gate.py` reply checks on a plain chat reply, which is no tool call. On the first `UserPromptSubmit` of a session, and on the first one after each compaction, it adds the reply rules as `additionalContext`. On `MessageDisplay` it holds each streamed batch until the message ends. A message that passes shows whole. A message that fails shows as a draft from `claude -p` on Haiku that passes the same checks, and the original shows when two drafts fail. The draft changes only the text on screen, so the next `UserPromptSubmit` tells the agent the text the user saw, and `SessionEnd` deletes the stored draft and the session's once-per-session markers for all three hooks. The [reply arena harness](https://github.com/jl-cmd-projects/claude-dev-env/tree/160349b90f627ea542fc6bc7b2b7f86dcbf98b73/tests/reply_arena) ran the comparison that chose this display path.
|
|
11
|
+
- The claim judge is a `prompt` hook in `hooks.json`, with no `model` set, so Claude Code's small default hook model reads each chat message and denies every claim, numbered in one refusal, about how code, a file, a tool, a service, a run, or a process behaves, or why something happened, when nothing in the message shows it: inline code that quotes output or a code line, a file and line, or a link. A pull request link covers what that change does, what it blocks or lets through, and its checks. The author's own actions, a restatement of the user's words, questions, instructions, and a decision card's option consequences pass. It catches plain claims such as "The code lets any of them rewrite it mid-check." `continueOnBlock` returns the reason to the agent as the tool error, so it can add the source and send again. The installer owns it through the `claude-dev-env: ` prefix on its `statusMessage`. It skips `post_widget`, whose input is SVG or HTML markup.
|
|
14
12
|
- `blocking/edit_marker_gate.py` rejects strikethrough and edit-note markers in replacement chat text or cards.
|
|
15
13
|
- `blocking/issue_close_handoff_gate.py` denies an issue comment or issue write that closes the issue and routes a found defect to another issue or epic.
|
|
16
14
|
- `blocking/session_title_format_gate.py` denies a session title that breaks the `<emoji> <name>` shape or has a name longer than 25 characters.
|
|
@@ -19,7 +17,7 @@ This family stops a chat reply, edited message, or tool call when its payload br
|
|
|
19
17
|
- `blocking/wakeup_cap_gate.py` keeps a self-wakeup inside the 1-hour prompt cache. A wake over the step-down (57 minutes for `send_later` and Routines, 3480 seconds for `ScheduleWakeup`) and at most 60 minutes away runs with its delay rewritten to the step-down. A wake over 60 minutes away, or a cron with more than 57 minutes between wakes, is denied with a reason that says to stack wakes under the cap. A Routine that starts a fresh session on each firing passes.
|
|
20
18
|
- `blocking/verify_before_acting.py` blocks a completed mutating call when the agent's reasoning contains an unchecked claim. For an `Agent` or `Task` spawn it adds the same quote as an advisory note and does not block.
|
|
21
19
|
- `blocking/pr_lifecycle_skill_gate.py` denies a commit, push, pull request action, or merge until the `pr-lifecycle` skill appears in the transcript since the last compaction. Read-only `gh pr` subcommands (`view`, `list`, `checks`, `diff`, `status`) pass without it, unless a later argument names another `gh pr` subcommand.
|
|
22
|
-
- `blocking/resolve_thread_reply_gate.py` denies a review thread resolve until the agent's own transcript shows a reply on that same thread that posted after the last user prompt and that no successful resolve of the thread has spent. A resolve is a `resolve_review_thread` call, which names the thread by `threadID`; a `pull_request_review_write` call with method `resolve_thread`, which names it by `threadId`; a shell command with a `gh api graphql` `resolveReviewThread` mutation, which names it by a literal `PRRT_` id; or a shell call to `pulls/<n>/ccr/comments/<id>/resolve`, which names it by a comment id. A graphql resolve that names no `PRRT_` id is denied. A reply is an `add_reply_to_pull_request_comment` call, or a `gh api` call to a comment's `replies` endpoint or to `addPullRequestReviewThreadReply`, which names its thread by `PRRT_` id. A reply and a resolve by comment id match when they name the same comment, or when a successful tool result in the transcript, such as `pull_request_read` `get_review_comments`, lists the comment under the thread by its `discussion_r` anchor or `databaseId`. A reply whose result is an error
|
|
20
|
+
- `blocking/resolve_thread_reply_gate.py` denies a review thread resolve until the agent's own transcript shows a reply on that same thread that posted after the last user prompt and that no successful resolve of the thread has spent. A resolve is a `resolve_review_thread` call, which names the thread by `threadID`; a `pull_request_review_write` call with method `resolve_thread`, which names it by `threadId`; a shell command with a `gh api graphql` `resolveReviewThread` mutation, which names it by a literal `PRRT_` id; or a shell call to `pulls/<n>/ccr/comments/<id>/resolve`, which names it by a comment id. A graphql resolve that names no `PRRT_` id is denied. A reply is an `add_reply_to_pull_request_comment` call, or a `gh api` call to a comment's `replies` endpoint or to `addPullRequestReviewThreadReply`, which names its thread by `PRRT_` id. A reply and a resolve by comment id match when they name the same comment, or when a successful tool result in the transcript, such as `pull_request_read` `get_review_comments`, lists the comment under the thread by its `discussion_r` anchor or `databaseId`. A reply whose result is an error does not count. With no readable transcript, the resolve passes.
|
|
23
21
|
- `blocking/verify_before_commit_gate.py` denies a `git commit` in a repository with a `.claude/skills/verify` or `.agents/skills/verify` directory until the `verify` skill loads after the last user prompt, through a Skill call whose result comes back without an error, or the `/verify` command in that prompt. It reads the committed paths from the staged diff, the tracked changes for `-a`, and the paths of each `git add` earlier in the same command, and passes a commit whose paths are all docs, images, test files, or `.json`, `.jsonl`, `.yaml`, `.yml`, or `.csv` files under a `docs` folder.
|
|
24
22
|
- `blocking/build_eval_before_eval_write_gate.py` denies a write to an eval file until a Skill call named exactly `claude-api` with args `build-eval`, or the `/claude-api build-eval` command, appears in the transcript.
|
|
25
23
|
- `blocking/merge_review_gate.py` denies an agent's merge until a review pass on the merged head reported zero findings, or ruled out every finding and linked the posted rulings. It reads the receipt `scripts/merge_review_receipt.py` writes, requires the merge, auto-merge or merge-queue entry to be pinned to that head, and skips repositories listed in `CLAUDE_MERGE_REVIEW_EXEMPT_REPOSITORIES`. A `gh pr merge` call whose every merge segment carries `--disable-auto` only turns auto-merge off, so it passes. A segment that also carries `--auto`, gives `--auto` or `--disable-auto` an `=` value, joins short flags such as `-sb`, or holds a bare `--` keeps every check. Its deny reason names the review command `CLAUDE_MERGE_REVIEW_COMMAND` sets. The reason tells the agent to run that command for the first three passes and `/code-review low --fix <number>` for each later pass; the gate itself counts no passes. It also denies a pull request open, through `gh pr create`, `pull_request.py create` or a `create_pull_request` tool, until a pass recorded as `merge_review_receipt.py <owner/name> open <head> 0` covers the head the pull request opens with. An open pass also counts when every finding is ruled out: `merge_review_receipt.py <owner/name> open <head> <count> --ruled-out <count> --rulings <path:line,...>`, with a different `path:line` for each finding, checked against the file at that head when the pass is recorded. A merge pinned to that same head passes on the open receipt only when the pass found zero findings.
|
|
@@ -29,13 +27,11 @@ This family stops a chat reply, edited message, or tool call when its payload br
|
|
|
29
27
|
|
|
30
28
|
## When it fires
|
|
31
29
|
|
|
32
|
-
- `blocking/reply_length_gate.py` runs on `PreToolUse`, matcher `mcp__hearthbot__reply|mcp__hearthbot__post_message|mcp__hearthbot__update_message|mcp__hearthbot__ask_decision|AskUserQuestion|mcp__hearthbot__post_widget`, timeout `10` seconds in `hooks.json`.
|
|
33
30
|
- `blocking/final_reply_gate.py` runs on `Stop`, timeout `10` seconds in `hooks.json`.
|
|
34
31
|
- `blocking/open_tasks_stop_gate.py` runs on `Stop`, timeout `10` seconds in `hooks.json`. The installer also registers it on Codex `Stop` and as a native Cursor `stop` entry in `~/.cursor/hooks.json`, where a block also returns `followup_message`. A Cursor stop with status `aborted` or `error` passes. A Cursor stop whose `loop_count` is above 0 passes, because a copy Cursor imports from `~/.claude/settings.json` has no follow-up limit.
|
|
35
32
|
- `session/tracking_nudge.py` runs on `UserPromptSubmit`, matcher empty, timeout `10` seconds in `hooks.json`.
|
|
36
33
|
- `session/background_silence_prompt.py` runs on `UserPromptSubmit`, matcher empty, timeout `10` seconds in `hooks.json`. It reads the transcript only for a background event prompt.
|
|
37
34
|
- The claim judge runs on `PreToolUse`, matcher `mcp__hearthbot__reply|mcp__hearthbot__post_message|mcp__hearthbot__update_message|mcp__hearthbot__ask_decision`, timeout `30` seconds in `hooks.json`.
|
|
38
|
-
- `blocking/chat_reply_gate.py` runs on `UserPromptSubmit`, matcher empty, timeout `10` seconds, on `MessageDisplay`, timeout `100` seconds, and on `SessionEnd`, timeout `3` seconds, in `hooks.json`.
|
|
39
35
|
- `blocking/edit_marker_gate.py` runs on `PreToolUse`, matcher `mcp__.*__update_message`, timeout `10` seconds in `hooks.json`.
|
|
40
36
|
- `blocking/issue_close_handoff_gate.py` runs on `PreToolUse`, matcher `mcp__.*__(add_issue_comment|issue_write|update_issue_comment)`, timeout `10` seconds in `hooks.json`.
|
|
41
37
|
- `blocking/session_title_format_gate.py` runs on `PreToolUse`, matcher `mcp__.*__set_session_title`, timeout `10` seconds in `hooks.json`.
|
|
@@ -58,14 +54,12 @@ Preconditions:
|
|
|
58
54
|
|
|
59
55
|
- Run each command from the repository root with Python and pytest available. The tests create transcript and payload fixtures.
|
|
60
56
|
|
|
61
|
-
- **Reply length.** Input is a reply with four sentences, a plain pull request number, an abbreviation, two sentences with no widget this turn, or widget code with an anchor link. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_reply_length_gate.py -q`. The adjacent test observes a denial and its count, link, or mode reason. Widget code with no flowchart passes with a flowchart reminder in `additionalContext`.
|
|
62
57
|
- **Resolve reply.** Input is a transcript where a thread reply came back refused, or with no reply, or with one reply already spent on a resolve, or with a reply on another thread, then a resolve call, a `pull_request_review_write` `resolve_thread` call, a graphql `resolveReviewThread` command, or a `ccr/comments/<id>/resolve` call. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_resolve_thread_reply_gate.py -q`. The adjacent test observes a deny whose reason says to post the reply, confirm it posted, then resolve. A reply that posted before the resolve passes, and an unreadable transcript passes.
|
|
63
|
-
- **Final reply.** Input is a closing reply
|
|
58
|
+
- **Final reply.** Input is a closing reply. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_final_reply_gate.py -q`. The adjacent test observes a `block` decision for a path in plain text. A reply with a plain-text `D:\Reports\.claude\report.html` is blocked; the same path in backticks or a fenced block passes.
|
|
64
59
|
- **Open tasks.** Input is a transcript whose last prompt asks for work and whose turn ran a Bash call and no tracker call. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_open_tasks_stop_gate.py -q`. The adjacent test observes one `block` decision; the same turn with a TaskCreate, TaskUpdate, TodoWrite, or desktop plan call passes. A question, an acknowledgement, a `<task-notification>` envelope, a tool-free turn, and a held stop pass. The same file covers Codex and Cursor payloads.
|
|
65
60
|
- **Ask nudge.** Input is a `UserPromptSubmit` payload with a work prompt, a question, and a `<task-notification>` envelope, after a transcript whose title shows the red flag. Run `python -m pytest packages/claude-dev-env/hooks/session/test_tracking_nudge.py -q`. The adjacent test observes a task list note and a title note for the work prompt, and empty stdout for the other two. A second ask in the same session gets no task list note until the transcript records a compaction.
|
|
66
61
|
- **Background silence.** Input is a `UserPromptSubmit` payload whose prompt is a `<task-notification>` envelope, after a transcript whose user message reads "Silent on updates unless something merges or youre blocked". Run `python -m pytest packages/claude-dev-env/hooks/session/test_background_silence_prompt.py -q`. The adjacent test observes a note that quotes "unless something merges or youre blocked", and empty stdout for a user-typed prompt, after a lift, and with no silence message.
|
|
67
62
|
- **Claim judge.** Input is a headless `claude -p` session with a stub MCP server named `hearthbot` that exposes `reply` and `ask_decision`, told to send "The code lets any of them rewrite it mid-check." The session settings add the `hooks.json` prompt hook. The stub logs zero bytes sent, and the tool error reads `PreToolUse:mcp__hearthbot__reply hook error: [<the prompt>]: Facts with no source: 1. ...`, numbering every failing claim. The same sentence with a `file:line` in backticks posts. A hook whose `model` Claude Code does not recognize lets every message through, so leave `model` unset. Run `node --test packages/claude-dev-env/bin/install.prompt-hook.test.mjs` for the installer side; it observes one managed prompt hook after two installs and none after uninstall.
|
|
68
|
-
- **Chat reply.** Input is a `MessageDisplay` event whose message holds four sentences, the same message split over two batches, and a `UserPromptSubmit` event. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_chat_reply_gate.py -q`. The adjacent test observes the drafter's text in `displayContent`, an empty first batch, no output for three sentences, the original after two failed drafts, the shown draft in the next `additionalContext`, and the stored draft deleted at session end. A replay of two prompts and a compaction observes the reply rules on the first prompt, no output on the second, and the rules again after the compaction.
|
|
69
63
|
- **Edit marker.** Input is an update message with strikethrough or an edit note. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_edit_marker_gate.py -q`. The adjacent test observes a denial; clean replacement text passes.
|
|
70
64
|
- **Handoff close.** Input is an issue comment that says the issue is closed and that the found defect belongs to another issue. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_issue_close_handoff_gate.py -q`. The adjacent test observes a denial; a close with a plain cross-reference and a routing comment on an open issue both pass.
|
|
71
65
|
- **Session title.** Input is a set session title call with no leading emoji or a name over 25 characters. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_session_title_format_gate.py -q`. The adjacent test observes a denial that names the broken rule; a well-formed title passes.
|
|
@@ -90,8 +84,7 @@ Preconditions:
|
|
|
90
84
|
- `blocking/step_note_gate.py` is off by default and polls for the transcript record. Subagent calls and unreadable records pass.
|
|
91
85
|
- `blocking/wakeup_cap_gate.py` lets an `update_trigger` cron change pass, because that input does not say whether the Routine wakes a session. Its step-down values come from fire-time probes: `send_later` rounds its fire time up to the next minute and polls once a minute, so a 1-minute request landed 123 and 158 seconds later. `ScheduleWakeup` rounds its fire time up to the next minute, so requests of 60 and 90 seconds landed 70 and 121 seconds later.
|
|
92
86
|
- `blocking/verify_before_acting.py` runs after the tool. A block asks the agent to check the claim and undo a contradicted change. A spawn has already started when the hook runs, so a block would stop nothing. The advisory note asks the agent to check the claim before it acts on the spawned agent's result.
|
|
93
|
-
- The reply gate
|
|
94
|
-
- The final reply gate blocks the stop and returns its reason to the model, which rewrites the reply. Claude Code ends the turn anyway after eight blocks in a row. The cited number checks in both gates skip when the transcript cannot be read.
|
|
87
|
+
- The final reply gate blocks the stop and returns its reason to the model, which rewrites the reply. Claude Code ends the turn anyway after eight blocks in a row.
|
|
95
88
|
- The edit marker gate scans replacement cards as well as the message text.
|
|
96
89
|
- The handoff close gate reads the `body` and `comment` fields of issue tools only. A `gh issue close --comment` command in Bash and a pull request body that closes the issue with `Closes #N` do not reach it.
|
|
97
90
|
- The eval write gate reads Write, Edit, MultiEdit, NotebookEdit and apply_patch calls. A Bash or PowerShell command that writes an eval file reaches it without the gate. An apply_patch that will not parse counts as an eval write when any of its words is an eval path. A missing or unreadable transcript denies the write.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Session context
|
|
2
2
|
|
|
3
|
-
This family injects reminders and task guidance when an agent starts, resumes, submits a prompt, starts a workflow helper, starts an artifact page, runs `npx pele`, or hits an auto mode denial. The startup scripts leave the session quiet when their opt-in conditions fail.
|
|
3
|
+
This family injects reminders and task guidance when an agent starts, resumes, submits a prompt, starts a workflow helper, starts an artifact page, runs `npx pele`, commits or opens a pull request whose words name several pieces, or hits an auto mode denial. The startup scripts leave the session quiet when their opt-in conditions fail.
|
|
4
4
|
|
|
5
5
|
## Checks
|
|
6
6
|
|
|
@@ -14,6 +14,7 @@ This family injects reminders and task guidance when an agent starts, resumes, s
|
|
|
14
14
|
- `session/plugin_change_warning.py` compares `installed_plugins.json` with that baseline before each prompt. It names each plugin whose version or install path changed, or that the baseline lacks, once per session, and tells the user to restart Claude Code.
|
|
15
15
|
- `session/artifact_template_pointer.py` routes an agent that starts an artifact page by scope. A status or progress report prefers the status flowchart from `docs/templates/artifact-page/status-flowchart.html`, unless the person asks for another shape. One flow or one comparison is an inline SVG flowchart with minimal text. A multi-part plan or evidence is an html-plan page from `docs/templates/html-plan/README.md`. When the request names the older artifact page template, it points at `docs/templates/artifact-page/README.md`, which names the tracker template and the diagram template and which ask each fits.
|
|
16
16
|
- `session/npx_pele_guidance.py` tells an agent that runs `npx pele` how to render Mermaid instead. Pele is a library with no command, so the hook names the installed copy and a Node snippet that renders with it. When no copy is installed, it points to the pele.run playground.
|
|
17
|
+
- `advisory/pieces_per_level_note.py` adds one context note when a `git commit` subject or a pull request create call names several pieces in the author's own words: a conventional subject or title whose description joins two or more verb-led clauses with commas, semicolons or "and", a "Proof in practice" section with more than one without/with pair, or a "What this does" section with more than one bold-led topic bullet. The note names the pieces, says each gets its own commit and stack level, and gives the commands that split the commit or the pull request into levels. It never blocks, denies or exits non-zero, and a message or body it cannot read gets no note. A command over 8,000 characters gets no note; a title is read to 300 characters, a body to 20,000, and a body line to 500; and a `-F`, `--file` or `--body-file` path is read only when it is a regular file, and only its first 64 KB. A cheap linear check on the payload comes first: the call must hold a `git commit` with a message flag, or a pull request create, as whole words, with a comma, a semicolon, "and", or a body option in its text (the MCP create tool needs a separator in its title or a body), and any other call starts no child process. A call that passes runs its analysis in a child process under one wall-clock deadline of 1 second for the whole child, start to exit, with at most 0.2 seconds of it spent waiting for the exit. A child past the deadline is killed, and the hook prints nothing and exits 0; so does any error in the parent. The environment variable `PIECES_NOTE_TEST_DEADLINE_SECONDS` sets the deadline for tests only.
|
|
17
18
|
- `advisory/auto_mode_denial_quick_fix.py` proposes one `autoMode.allow` entry and a PowerShell block that writes it after an auto mode denial. It never retries the denied call.
|
|
18
19
|
|
|
19
20
|
## When it fires
|
|
@@ -24,6 +25,7 @@ This family injects reminders and task guidance when an agent starts, resumes, s
|
|
|
24
25
|
- `session/plugin_session_baseline_writer.py` runs on `SessionStart`, matcher empty, at `10` seconds, so it sees every source. `session/plugin_change_warning.py` runs on `UserPromptSubmit`, matcher empty, at `10` seconds in `hooks.json`.
|
|
25
26
|
- `session/artifact_template_pointer.py` runs on `PreToolUse` matcher `Artifact|Skill` at `10` seconds in `hooks.json`. It speaks only on an `Artifact` call with action `quickstart` or a `Skill` call that loads `artifact-design`.
|
|
26
27
|
- `session/npx_pele_guidance.py` runs on `PreToolUse` matcher `Bash|PowerShell` at `10` seconds in `hooks.json`. It speaks only on an `npx` command with a `pele` argument, or an `npm exec` or `npm x` command with one after `exec` or `x`.
|
|
28
|
+
- `advisory/pieces_per_level_note.py` (with its analysis in `advisory/pieces_per_level_analysis.py`) runs on `PreToolUse` matcher `Bash|PowerShell|mcp__.*__create_pull_request` at `10` seconds in `hooks.json`. It reads `-m`, `--message`, `-F` and `--file` of `git commit`, the `--title` and `--body-file` of the `gh` and `pull_request.py` create calls, and the `title` and `body` of a `create_pull_request` tool.
|
|
27
29
|
- `advisory/auto_mode_denial_quick_fix.py` runs on `PermissionDenied`, matcher `*`, timeout `10` seconds in `hooks.json`.
|
|
28
30
|
|
|
29
31
|
## Proving it
|
|
@@ -41,6 +43,7 @@ Preconditions:
|
|
|
41
43
|
- **Plugin restart warning.** Input is a SessionStart event, an `installed_plugins.json` change, and a prompt. Run `python -m pytest packages/claude-dev-env/hooks/session/test_plugin_session_baseline_writer.py packages/claude-dev-env/hooks/session/test_plugin_change_warning.py packages/claude-dev-env/hooks/test_plugin_session_baseline.py -q`. The tests observe one warning for a changed version, a changed install path, and a plugin new since start, silence on a `lastUpdated` refresh and on a second prompt, and a warning that still fires after a `compact` SessionStart.
|
|
42
44
|
- **Artifact template pointer.** Input is an `Artifact` quickstart call. Run `python -m pytest packages/claude-dev-env/hooks/session/test_artifact_template_pointer.py -q`. The adjacent test observes the status flowchart path first, the html-plan path ahead of the template path in `additionalContext`, and silence on a publish call or another skill.
|
|
43
45
|
- **npx pele guidance.** Input is a `Bash` or `PowerShell` call whose command runs `npx pele`. Run `python -m pytest packages/claude-dev-env/hooks/session/test_npx_pele_guidance.py -q`. The adjacent test observes the guidance for each install state, a snippet that renders an SVG file under node, and silence on other commands and malformed input.
|
|
46
|
+
- **Pieces per level note.** Input is a commit subject or pull request title that joins verb-led clauses, a body with three without/with pairs, three single-behaviour subjects, and a malformed payload. Run `python -m pytest packages/claude-dev-env/hooks/advisory/test_pieces_per_level_note.py packages/claude-dev-env/hooks/advisory/test_piece_clauses.py -q`. The adjacent tests observe a note and exit 0 for the first two, and no output with exit 0 for the rest.
|
|
44
47
|
- **Denial quick fix.** Input is a `PermissionDenied` event with a bracketed rule label and a classifier verdict. Run `python -m pytest packages/claude-dev-env/hooks/advisory/test_auto_mode_denial_quick_fix.py -q`. The adjacent test observes the named rule, the allow entry, and the PowerShell block; a denial with no verdict gets a note and no block.
|
|
45
48
|
|
|
46
49
|
## Gotchas
|
package/hooks/hooks.json
CHANGED
|
@@ -127,6 +127,16 @@
|
|
|
127
127
|
}
|
|
128
128
|
]
|
|
129
129
|
},
|
|
130
|
+
{
|
|
131
|
+
"matcher": "Bash|PowerShell|mcp__.*__create_pull_request",
|
|
132
|
+
"hooks": [
|
|
133
|
+
{
|
|
134
|
+
"type": "command",
|
|
135
|
+
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/advisory/pieces_per_level_note.py",
|
|
136
|
+
"timeout": 10
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
130
140
|
{
|
|
131
141
|
"matcher": "Write|Edit|MultiEdit|NotebookEdit|apply_patch",
|
|
132
142
|
"hooks": [
|
|
@@ -177,16 +187,6 @@
|
|
|
177
187
|
}
|
|
178
188
|
]
|
|
179
189
|
},
|
|
180
|
-
{
|
|
181
|
-
"matcher": "mcp__hearthbot__reply|mcp__hearthbot__post_message|mcp__hearthbot__update_message|mcp__hearthbot__ask_decision|AskUserQuestion|mcp__hearthbot__post_widget",
|
|
182
|
-
"hooks": [
|
|
183
|
-
{
|
|
184
|
-
"type": "command",
|
|
185
|
-
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/blocking/reply_length_gate.py",
|
|
186
|
-
"timeout": 10
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
},
|
|
190
190
|
{
|
|
191
191
|
"matcher": "mcp__hearthbot__reply|mcp__hearthbot__post_message|mcp__hearthbot__update_message|mcp__hearthbot__ask_decision",
|
|
192
192
|
"hooks": [
|
|
@@ -318,16 +318,6 @@
|
|
|
318
318
|
"timeout": 15
|
|
319
319
|
}
|
|
320
320
|
]
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
"matcher": "Bash|mcp__github__add_issue_comment|mcp__github__update_issue_comment|mcp__github__add_reply_to_pull_request_comment|mcp__github__add_comment_to_pending_review|mcp__github__pull_request_review_write",
|
|
324
|
-
"hooks": [
|
|
325
|
-
{
|
|
326
|
-
"type": "command",
|
|
327
|
-
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/blocking/reply_length_gate.py",
|
|
328
|
-
"timeout": 10
|
|
329
|
-
}
|
|
330
|
-
]
|
|
331
321
|
}
|
|
332
322
|
],
|
|
333
323
|
"UserPromptSubmit": [
|
|
@@ -344,11 +334,6 @@
|
|
|
344
334
|
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/lifecycle/nested_project_hooks.py",
|
|
345
335
|
"timeout": 120
|
|
346
336
|
},
|
|
347
|
-
{
|
|
348
|
-
"type": "command",
|
|
349
|
-
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/blocking/chat_reply_gate.py",
|
|
350
|
-
"timeout": 10
|
|
351
|
-
},
|
|
352
337
|
{
|
|
353
338
|
"type": "command",
|
|
354
339
|
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/session/tracking_nudge.py",
|
|
@@ -496,11 +481,6 @@
|
|
|
496
481
|
"type": "command",
|
|
497
482
|
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/session/session_edit_tracker_cleanup.py",
|
|
498
483
|
"timeout": 3
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
"type": "command",
|
|
502
|
-
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/blocking/chat_reply_gate.py",
|
|
503
|
-
"timeout": 3
|
|
504
484
|
}
|
|
505
485
|
]
|
|
506
486
|
}
|
|
@@ -580,17 +560,6 @@
|
|
|
580
560
|
}
|
|
581
561
|
]
|
|
582
562
|
}
|
|
583
|
-
],
|
|
584
|
-
"MessageDisplay": [
|
|
585
|
-
{
|
|
586
|
-
"hooks": [
|
|
587
|
-
{
|
|
588
|
-
"type": "command",
|
|
589
|
-
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/blocking/chat_reply_gate.py",
|
|
590
|
-
"timeout": 100
|
|
591
|
-
}
|
|
592
|
-
]
|
|
593
|
-
}
|
|
594
563
|
]
|
|
595
564
|
}
|
|
596
565
|
}
|
|
@@ -40,3 +40,5 @@ SILENCE_NOTE_WITHOUT_EXCEPTION = (
|
|
|
40
40
|
" End this turn with no text at all unless that message names an exception that applies now."
|
|
41
41
|
' Tool calls are fine, and a status line such as "No change." counts as text.'
|
|
42
42
|
)
|
|
43
|
+
|
|
44
|
+
ADDITIONAL_CONTEXT_KEY = "additionalContext"
|