The Behavioral Digest is a persistent contract used to store behavioral rules for an AI agent. It is stored in a Markdown file and follows a specific structure to manage rules by priority and scope.
Storage Locations:
- Project-local (Recommended):
.cozempic/behavioral-digest.md (takes precedence for project-specific corrections). - User-global:
~/.cozempic/behavioral-digest.md.
Rule Classifications:
- Hard Rules: Always injected into the agent's context. Used for zero-tolerance corrections (e.g., git operations).
- Soft Rules: Injected only when the current session scope is relevant (e.g., file operations).
- Pending Rules: Rules with fewer than 3 occurrences that are under observation before being promoted to Active.
Rule Structure:
Each rule includes metadata such as Priority, Source, Importance, Scope, and a Rule definition using prohibition framing (e.g., "Do not [X]").
# Behavioral Digest
<!-- cozempic: behavioral-digest v1 -->
<!-- project: /path/to/project -->
<!-- updated: 2026-03-31T14:23:00Z -->
<!-- session: <session_id_that_last_updated> -->
## Active Rules — Hard (always injected)
### [R001] No Co-Authored-By commits
**Priority**: HARD
**Source**: User correction (3 occurrences)
**First seen**: 2026-03-15 | **Last reinforced**: 2026-03-30
**Importance**: 5 (3 corrections + 2 upvotes)
**Scope**: git operations
**Rule**: Do not add "Co-Authored-By" lines to git commit messages.
**Before**: Added `Co-Authored-By: Claude Sonnet <noreply@anthropic.com>` to commit
**After**: User deleted that line from the commit message
**Signal**: I added Co-Authored-By because default behavior includes it; user treats this project's commits as single-author.
**Trigger**: Any git commit operation
## Active Rules — Soft (injected by scope relevance)
### [R002] Edit not Write for existing files
**Priority**: SOFT
**Source**: User correction (2 occurrences)
**First seen**: 2026-03-20 | **Last reinforced**: 2026-03-28
**Importance**: 2
**Scope**: file operations
**Rule**: Do not use the Write tool to modify existing files — use Edit. Only use Write for new files.
**Before**: Used Write tool to replace entire file content
**After**: User said "use Edit not Write"
**Signal**: I used Write because the change was large; user prefers surgical edits.
**Trigger**: Any file modification operation on existing files
## Pending Rules (< 3 occurrences, under observation)
### [P001] Prefer uv over pip
**Priority**: SOFT (pending)
**Source**: User correction (1 occurrence)
**First seen**: 2026-03-31
**Importance**: 1
**Rule**: Use uv instead of pip for package operations in this project.
**Before**: Suggested `pip install ...`
**After**: User said "we use uv"
**Trigger**: Any package installation or management command