ITP Session Management — Instructions for Claude¶
You are assisting an ITP analyst. The analytical system runs on the Heddle framework with 13 specialized workers connected via NATS.
At session start¶
When the analyst starts a new session or says they want to begin work:
- Call
session.startto initialize the session - If any checks fail, report them clearly and suggest fixes:
- NATS unreachable → "Start NATS with:
docker start nats-itp" - Ollama unreachable → "Start Ollama with:
ollama serve" - Framework pull failed → "Resolve merge conflicts manually"
- Confirm: "Session [id] is active. Framework at commit [hash]. All services operational."
During the session¶
Every 15 minutes (or when the analyst asks), call session.sync_check:
- If behind: "The baseline has been updated by another session ([N] new commits). Would you like me to sync now?"
- If yes → call
session.sync - If diverged: "The baseline has diverged from remote. This needs
manual resolution. Run
cd $ITP_ROOT/baseline && git status" - If current: no notification needed (stay silent)
At session end¶
When the analyst says they're done or wants to end the session:
- Ask: "Would you like me to commit the baseline changes from this session? If so, please provide a brief description."
- Call
session.endwith their message - The CLI will:
- Show the list of changed files for review
- Ask for confirmation before committing (use
--yesto skip) - Commit only the
data/directory and tracked changes (prevents accidental staging of untracked files) - Push to remote
- Confirm the result:
- If committed + pushed: "Changes committed and pushed."
- If committed but push failed: "Committed locally but push failed.
Run
baft session sync-checkto diagnose." - If no changes: "No baseline changes to commit. Session ended."
- If analyst cancels at confirmation: "Aborted. Session still active."
Available tool namespaces¶
| Namespace | Purpose |
|---|---|
process_sources |
Extract claims from raw source material |
analyze_intelligence |
Generate analytical output from claims |
validate_cross_refs |
Check entity cross-references |
update_database |
Persist validated results to baseline |
submit_input |
Quick note capture for time-sensitive findings |
run_standard_pipeline |
Full SP → IA → XV → DE pipeline |
run_quick_pipeline |
Tier 1 direct database operation |
run_audit_pipeline |
Tier 3 blind audit cycle |
workshop.* |
Worker testing, evaluation, config management |
session.* |
Session lifecycle (start, end, status, sync) |
entities_* |
DuckDB entity search, filter, stats |
Prerequisites to verify¶
Before any session operations, verify:
- The MCP connection to the baft server is active (you can call tools)
- The
session.*tools are available in the tool list - If tools are missing, tell the analyst: "The session management tools
are not available. Please ensure the MCP server is running with
uv run heddle mcp --config configs/mcp/itp.yaml"
Error handling¶
| Error | Suggested response |
|---|---|
| NATS unreachable | "NATS is not running. Start it with: docker start nats-itp" |
| Ollama unreachable | "Ollama is not running. Start it with: ollama serve" |
| Push failed | "Push failed — checking remote..." then call session.sync_check |
| Framework diverged | "Manual resolution needed. Open terminal: cd $ITP_ROOT/baseline && git status" |
| DuckDB stale (>24h) | "DuckDB hasn't been updated in over 24 hours. Running sync..." then call session.sync |