﻿Working only from session context ΓÇö this is the constraint envelope the repo's standing decisions impose, plus the one commit that names the feature (`b5181ca feat: add bounded opt-in SessionStart continuity`) and the untracked `reports/sessionstart-ab/`. I have not read the hook implementation, `docs/PROGRAM.md`, or those reports, so treat the mechanism details below as the rules it must satisfy rather than a description of shipped code.

## Default state
Off. Two independent things force this: the commit subject says "opt-in," and CLAUDE.md's working norms make edits to the **global** `~/.claude/settings.json` a hard HALT point requiring explicit approval from Mike. A SessionStart hook is registered in settings, so it cannot be silently switched on ΓÇö no code path in this repo should ever enable it as a side effect of install or reindex. Absent user action, sessions behave exactly as they do today.

## Archive / database access
Read-only, always. The standing server posture is "no tool mutates DB or sources; reindex is a separate CLI step," and a session-start path is the last place to violate that ΓÇö it runs unattended, before the user has said anything. Practical consequences:

- Read `%LOCALAPPDATA%\claude-archive-mcp\archive.db`; never write, never trigger a reindex.
- Paths and env come from `config.py` only ΓÇö nothing else reads `os.environ`, no hardcoded paths.
- The DB may be missing, stale, or at an older `user_version`. Note the tension: `db.bootstrap_schema()` applies unapplied migrations on open, which *is* a write, and refuses a too-new DB with `SchemaVersionError`. A start-time path should not be the thing that performs a migration or that dies on that error.

## Context bounds
"Bounded" is the load-bearing word. Whatever is injected is prepended to *every* session, paid before the user types a character, and it competes with CLAUDE.md, memory, and the tool schemas already in the window. So the payload needs a fixed ceiling enforced in code, not an emergent size that grows with archive volume or recent activity. `reports/sessionstart-ab/` reads as the evidence artifact for exactly this trade ΓÇö measured benefit against a known token cost.

## Failure behavior
Degrade to silence. A hook failure must not block or slow session start, emit a user-visible error, or leave a half-written payload; missing DB, locked DB, schema mismatch, or empty result all take the same path ΓÇö inject nothing, log to file, exit clean. The repo's logging rule ("file only, never stdout") is about the stdio MCP server owning stdout in its own process; a hook is a separate process where stdout *is* the injection channel. Don't conflate them, and don't let diagnostics leak into the injected text.

## MCP contract
SessionStart sits outside the tool surface. The contract is eleven read-only, source-aware tools plus the per-project resource; continuity injection must not become a twelfth tool, alter existing tool semantics, or change the search tiers governed by CONTRACT.md. It also can't assume optional extras ΓÇö `find_related_chats` needs the `[embeddings]` extra and `scripts/embed.py`, so any embedding-backed continuity has to be conditional on that being present.
