Repository navigation
Closed
Description
Goal
A way for an agent or a human to break a rule of these conventions on purpose, behind two gates:
- explicit human approval;
- a note of the broken rule in the PR and in the task README.
The case that prompted it: bringing an existing analysis repo up to date with conventions it predates, which
means renaming task directories, adding task ids to READMEs and the like. It is a one-off, it needs agents to
break some rules, and it should have a safe route.
Facts
- Rules live in three places: the five session rules (
hooks/session_context.md), the skill, and the template's
CONVENTIONS.md. Most are stated only. - Four hooks block with exit code 2 and have no override:
guard_task_layout(PreToolUse and Stop),
guard_task_paths,guard_worktree_pixi,guard_shared_writes. - In the prompting case, two things stand in the way: the layout hook (READMEs and top-level files of tasks made
before the template) and session rule 1 (earlier task directories are never edited).
Open questions
Defaults are the briefing session's suggestions; nothing here is decided.
- Q1 How does a hook learn of an approved exception? Default: the human names it when starting the session
(for example an environment variable the hooks read), so an agent cannot grant itself one. To verify first:
that plugin hooks see the launching shell's environment, and that an agent's own commands cannot change it.
Alternative: the hooks read the note from the task README. - Q2 Scope of one exception. Default: one named guard, for one session.
- Q3 Where the note goes when the work is not one analysis task, as in a repo-wide migration: the PR body
only, or also each touched task's README? - Q4 Rules that are stated only. Default: one sentence and no machinery: a rule may be broken only with the
human's explicit approval, noted in the README and the PR. - Q5 The note's format. Default: one line per exception (rule, why, approved by, date). A new README
heading would change what the layout hook accepts.
Constraints
- Simple: rules over machinery, one home per fact.
- Its own PR, after Declared inputs per task and
analysis-workflow trace#23, which touches the same hooks.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Marius1311 commentedon Nov 18, 2026
Decided, per question; implemented in #29 and quadbio/analysis_template#32.
/analysis-workflow:allow <guard>. Not at session start: a guard is usually learnt of only when it fires.CONVENTIONS.md.The facts Q1 asked to verify, tested with Claude Code 2.1.327:
export, or a line added to the session's env file, reaches the hooksenvblock written to a settings file mid-session reaches the hooksUserPromptSubmitfires for a subagent's report, another session's message and a scheduled promptUserPromptExpansionfires for any of those, or when the model loads the skill