# Claude Code — Start-Session Template (Agent Arbitrage) — v2

Paste this at the start of each Claude Code session, then paste the task below it.

---

You are working on Agent Arbitrage. Before doing anything, follow ALL rules in `AGENTS.md` — Section 1 (Locked Values), Section 2 (Forbidden Actions), and Section 3 (Scope) are absolute.

**Environment / .env:** `.env` is gitignored. If it is not present in this working copy, recreate it from environment variables before running anything that needs credentials. Do not print, echo, or commit `.env` contents.

**Git discipline:** Work on a feature branch, never commit directly to `main`. I deploy to production myself (merge the PR on GitHub → `git pull origin main` on the VPS → `deploy_update.sh`, which restarts services but does NOT pull). You do not deploy. When you believe the work is complete, commit to the branch and post a brief status summary — then wait.

**Documentation discipline (REQUIRED):** If a code change alters any behaviour, name, formula, threshold, constant, or data flow that is described in `Documentation/`, `AGENTS.md`, or `README.md`, update the affected doc **in the same PR** as the code change. Before committing, list which docs your changes affect and how (or state "no documented behaviour affected"). Do NOT silently let code and docs drift apart. If you discover an existing doc that is already wrong (unrelated to your change), flag it per §3 rather than fixing it inline — it may be intended behaviour the code drifted from, which is an owner decision.

**Dev log policy:** Do NOT write a dev log until I explicitly request one. When you think you're done, post a short status summary and wait — I will review, test, and may have follow-ups. The dev log is written ONCE at the very end, capturing everything that actually shipped, including iterations and corrections between your first "I think this is done" and the final approved state. Match the format of the existing entries in `Dev_Logs/`.

**READ before starting:**
- `README.md`
- `AGENTS.md`
- `Documentation/System_State.md`
- `Documentation/Data_Logic.md`
- `Documentation/Dashboard_Specification.md`
- `Documentation/Token_Management_Strategy.md`
- `Documentation/System_Architecture.md`
- `Documentation/Feature_Deals_Dashboard.md`
- `Documentation/Feature_Guided_Learning_Strategies_Intelligence.md`
- `Documentation/INFERRED_PRICE_LOGIC.md`
- The 3 most recent Dev Logs in `Dev_Logs/` (by date in filename)

**Do NOT read:**
- `xai_cache.json`, `strategies.json`, `agent_brain.json`
- any `*.log` file of any kind
- `Diagnostics/`, `tests/` (unless a task tells you to run/modify a test)
- `AgentArbitrage_BeforeGateCheckFeature2/`
- `RAW_PRODUCT_DATA.md` or any other historical document unless I ask
- anything in any `Archive/` directory unless I ask

**Workflow:** Symptoms not theories — verify against the live code before changing it. If a task's premise doesn't match what you find, stop and tell me. Respect STOP-and-confirm checkpoints in the task: post the requested output and wait for my OK before continuing.

---

### Changes from v1 (reference — do not paste this section)

- **Added the Documentation discipline block** — the "update affected docs in the same PR" rule, with the important carve-out that pre-existing doc errors get *flagged*, not auto-fixed, because a doc may hold intended behaviour the code drifted from (owner decision).
- Everything else unchanged from v1.
