Problem
Mitzo currently relies on a static systemPrompt.append string that tells the model to read CLAUDE.md and .cursor/rules/ for project context.
That is weaker than Claude Code's startup path in mgmt, where a SessionStart hook runs a generator and injects the resulting boot context directly as additionalContext.
Current Mitzo behavior means:
- project context is only loaded if the model decides to read the right files
- startup context quality varies by session
- generated boot bundles like
mgmt/.cursor/rules/boot-context.mdc are only consumed indirectly
- Mitzo remains behind Cursor / Claude Code for deterministic startup behavior
Current Reference
In mgmt, Claude Code startup runs:
.claude/hooks/inject-boot-context.sh
- which calls
python3 scripts/build_boot_context.py --json
- which emits deterministic startup context from canonical source files
Mitzo currently does this instead in server/chat.ts:
- append a static instruction to read
CLAUDE.md and .cursor/rules/
Proposal
Add a pre-chat startup hook / prompt assembly step in Mitzo that can:
- detect a repo-local context generator or boot hook
- execute it before
query()
- inject the returned context directly into
systemPrompt.append (or equivalent startup prompt layer)
- fall back to the current "read CLAUDE.md and .cursor/rules/" instruction when no generator exists
For mgmt, that would mean calling something like:
python3 scripts/build_boot_context.py --json
Why This Is Better
- deterministic startup context across sessions
- parity with Claude Code behavior
- no dependence on the model remembering to read the right files
- allows repo-specific compiled boot context without hardcoding mgmt logic into Mitzo
- good stepping stone toward a fuller context-assembler later
Constraints
- Must stay repo-agnostic: not every repo will have
scripts/build_boot_context.py
- Must fail soft: if the hook/generator errors, Mitzo should still start the chat
- Should avoid double-loading context by injecting generated boot content and also telling the model to re-read the same files unnecessarily
- Keep existing concise Mitzo mobile-specific instructions
Acceptance Criteria
- Mitzo supports an optional pre-chat context hook/generator call before
query()
- For repos that expose a generator/hook, the returned context is injected automatically
- For repos without one, Mitzo preserves current behavior
- Failure to run the generator does not block chat startup
- Add one integration path for
mgmt as the first concrete consumer
Problem
Mitzo currently relies on a static
systemPrompt.appendstring that tells the model to readCLAUDE.mdand.cursor/rules/for project context.That is weaker than Claude Code's startup path in
mgmt, where a SessionStart hook runs a generator and injects the resulting boot context directly asadditionalContext.Current Mitzo behavior means:
mgmt/.cursor/rules/boot-context.mdcare only consumed indirectlyCurrent Reference
In
mgmt, Claude Code startup runs:.claude/hooks/inject-boot-context.shpython3 scripts/build_boot_context.py --jsonMitzo currently does this instead in
server/chat.ts:CLAUDE.mdand.cursor/rules/Proposal
Add a pre-chat startup hook / prompt assembly step in Mitzo that can:
query()systemPrompt.append(or equivalent startup prompt layer)For
mgmt, that would mean calling something like:python3 scripts/build_boot_context.py --jsonWhy This Is Better
Constraints
scripts/build_boot_context.pyAcceptance Criteria
query()mgmtas the first concrete consumer