# Conflicts: # docs/event-producer-consumer.md # examples/acp-agent/tests/snapshots/bash-spill/session.jsonl # examples/acp-agent/tests/snapshots/escalation-approved/session.jsonl # examples/acp-agent/tests/snapshots/escalation-rejected/session.jsonl # examples/acp-agent/tests/snapshots/fs-escalation-approved/session.jsonl # examples/acp-agent/tests/snapshots/hook-cc-pretool-ask/session.jsonl # packages/context/workspace-context/tests/workspace-context.spec.ts # packages/core/agent/src/index.ts # packages/support/invariants/tests/invariants.spec.ts # packages/ui/acp/src/index.ts # packages/ui/tui/tests/harness.ts # packages/ui/tui/tests/tui.spec.ts
guard/ — loop-hygiene guard family
Behavioral guard plugins that watch the agent loop for unproductive patterns and nudge the model back on course. A single product package — there is no interface/implementation seam here, because a guard is a self-contained consumer of existing core seams (tools/post-execute, agent/prompt-submit, agent/status), not a swappable capability.
| Package | Role | ctx key |
|---|---|---|
repeat-tool-guard/ |
Advisory reminders when an agent loops on identical tool calls | (listens on ctx.tools' waterfalls) |
Reminders travel as additionalContexts on the tools/post-execute decision; the agent loop appends them as logged context/message events after the step's tool results (see the tools package), so everything a guard says to the model is reconstructable from the session log.