AI Assistant Extracts Apple Watch Sleep Data for Clinic: 5 Gotchas

A developer spent a Sunday getting an AI assistant to convert six months of Apple Watch sleep data into a CSV matching a sleep clinic's intake form format. The process revealed five critical data pitfalls that any AI health data pipeline must handle.
Key Issues Found
- In-bed vs actual sleep: The watch logs an "in bed" window and separate sleep-stage records (core/deep/REM). The assistant initially reported the in-bed window as total sleep (e.g., 7 hours instead of 3). Correct total is the sum of sleep stages, not time in bed.
- Timezone offsets: Raw Apple Health export timestamps are in UTC. Without conversion to local time, bedtimes appeared at 7am. After conversion, some nights shifted to a different calendar date.
- Off-by-one dates: Apple's weekly/monthly summary emails date a night by the morning you woke up. The clinic form wants the night you went to bed. The assistant trusted the email's date, causing half the rows to be a day off.
- Zero-sleep nights vanished: Nights with zero asleep time have no "asleep" records, so the assistant skipped them. The monthly summary explicitly flags them as 0.0 hours — these are clinically important. The fix: include them at zero.
- Invented HR/HRV values: For nights missing morning HR or HRV readings, the assistant filled in a value (carried over from another day). For a medical form, this is unacceptable. The fix: write
N/Aand never estimate.
Cool Feature: Text Message Integration
The developer had texted a friend about sleep data (e.g., "watch says 2 hrs 40 min last tuesday"). The assistant matched these comments to the correct night and added them to the notes column. However, relative dates like "last tuesday" tripped it up at first — it anchored to the present day instead of the date the text was sent.
Final CSV
After fixing overcounting sleep, timezone conversion, using bed dates, including zero-sleep nights, and stopping invented HR values, the CSV matched the clinic's format exactly — one row per night with columns: bedtime, time in bed, total sleep, awakenings, efficiency, resting HR, HRV, notes.
Practical Takeaways
- Always verify the distinction between "in-bed" and "asleep" in any sleep tracking export — the difference is large.
- Handle timezone conversion explicitly and check for date boundary shifts.
- Include zero-value nights; they are often the most clinically relevant.
- Never allow AI to impute missing health metrics — use
N/A. - Cross-referencing text messages with sensor data is powerful but requires correct temporal anchoring.
📖 Read the full source: r/openclaw
👀 See Also

Config Rollback Watchdog Gateway: Combine Health Checks with Automatic Rollback
A Reddit user proposes a watchdog that restarts the OpenClaw gateway on port failure, combined with automatic config rollback after 5 failed starts to prevent configuration-induced boot loops.

5 Patterns for Getting Better Results from Claude (Non-Technical Users)
Practical scaffolding, example-based prompting, negative instructions, persistent context, and source grounding — five patterns that consistently improve output quality from Claude, backed by six months of field experience.

Claude Prompt Codes Retested: L99 Sharper, OODA Narrower, ARTIFACTS Faded, and 3 New Codes to Use
A 6-month retest of L99, OODA, and ARTIFACTS prompt codes on Claude shows L99 sharper on Sonnet 4.6/Opus 4.7, OODA failing on strategic prompts, ARTIFACTS unnecessary for code, and three new codes (/skeptic, /blindspots, /decompose) earning daily use. Stack no more than 2 codes.

Collaborative vs Directive AI Prompts Yield Different Outcomes
A Reddit discussion highlights measurable differences in AI-assisted development outcomes between users who collaborate with AI using "we" language versus those who give directive "do this" commands. The collaborative approach surfaces dead-ends and challenges assumptions through shared context.