# Instructions for Claude (mobile)

You are looking at the user's house-hunting pipeline. A mini PC on the
user's home network samples drive times from candidate Zillow listings to
a fixed set of destinations, then publishes results into this Google
Drive folder. The user reads the results on mobile via you.

## Files in this folder

| File | Purpose |
|---|---|
| `HOUSES.md` | Human-readable report. Read this first when asked about results. |
| `houses.json` | Same content, structured. Use when asked for ad-hoc analysis. |
| `House Hunting - Listings.xlsx` | User's master list of Zillow URLs. Source of truth for which listings to track. |
| `House Hunting - Commute Destinations.xlsx` | User's destinations (Work / Hobby / Night Life / Trips), with Maps shortlinks and day-type. |
| `add-*.txt` | **Inbox files you create to add new listings.** See below. |

## How to interpret `HOUSES.md`

- **Scores** section ranks listings per dimension (Work / Hobby / Night
  Life / Trips / Weekday / Weekend). Lower commute = better. With ≤4
  listings the rank is shown (`#1/3`); with 5+ a percentile is shown
  (`p87`). Higher percentile = better.
- **Frozen listings** (❄) have completed their ~14-day sampling window
  and are now static insights — still compared in the rankings.
- Cells reading "—" mean no samples in that bucket yet (often because
  the schedule hasn't fired for that slot since the listing was added).

## Adding a listing from a Zillow URL

When the user says something like *"add this house: https://www.zillow.com/homedetails/..."*:

1. Use the Google Drive `create_file` tool to create a new file in this
   same folder (`House Hunting`).
2. **Filename**: `add-YYYY-MM-DD-HHMM-<slug>.txt` — use the current date
   and a short slug derived from the URL (e.g. the city name). The
   pipeline ignores everything in the filename except the `add-` prefix
   and `.txt` extension, so any unique name works.
3. **Content**: the Zillow URL (or postal address) on its own line. You
   may include multiple URLs, one per line. Lines starting with `#` are
   treated as comments.

Example file content:
```
https://www.zillow.com/homedetails/24360-270th-Avenue-SE-Maple-Valley-WA-98038/48797234_zpid/
```

The mini PC's inbox timer runs every 5 minutes. Within that window it:
- Pulls your `add-*.txt` file
- Geocodes the address and inserts the listing into the pipeline DB
- Deletes the inbox file from Drive
- Regenerates `HOUSES.md` so the listing shows up immediately

After 5–10 minutes, refresh `HOUSES.md` and confirm the listing appears
in the **Listings** section with status `active`.

## What you should *not* do

- Don't try to edit `House Hunting - Listings.xlsx` or `... -
  Destinations.xlsx` in place — the Drive connector can't reliably do
  that. Use the `add-*.txt` inbox instead.
- Don't create multiple inbox files for the same URL — duplicates are
  detected (the existing listing is just re-activated if archived) but
  it's wasteful.
- Don't archive or remove listings from the inbox — that needs a CLI
  command on the mini PC.

## When you don't know something

If the user asks about pipeline mechanics, sampling rules, or anything
not in `HOUSES.md`, the most accurate source is the README inside the
project at `~/househunt/README.md` on the mini PC. You don't have access
to that — say so honestly rather than guessing.
