Two small Claude Code tricks that took me one evening to set up, plus a refinement of Matthew’s canary idea that came out of it. The problem Claude has no clock. Mid-session it genuinely does not know if it’s been ten minutes or six hours, whether it’s afternoon or nearly midnight — and in long sessions it slowly gets sloppy about early instructions without anyone noticing. Two cheap fixes and one tripwire: Trick 1 — inject the time (and turn count) every prompt Claude Code has hooks — scripts that fire on events. A UserPromptSubmit hook runs every time you send a message, and whatever it prints gets injected into Claude’s context. So: a tiny script that prints the turn number and wall-clock time. ~/.claude/hooks/turn-time.sh: #!/bin/bash # Injects "[turn N · HH:MM TZ]" into Claude's context on every prompt. STATE_DIR="${HOME}/.claude/state"; mkdir -p "$STATE_DIR" SESSION_ID=$(python3 -c "import json,sys; print(json.load(sys.stdin).get('session_id',''))" 2>/dev/null) [ -z "$SESSION_ID" ] && exit 0 F="$STATE_DIR/turns-$SESSION_ID" COUNT=$(( $(cat "$F" 2>/dev/null || echo 0) + 1 )); echo "$COUNT" > "$F" echo "[turn $COUNT · $(date '+%H:%M %Z')]" Wire it up in ~/.claude/settings.json (and chmod +x the script): { "hooks": { "UserPromptSubmit": [ { "hooks": [ { "type": "command", "command": "~/.claude/hooks/turn-time.sh" } ] } ] } } Cost: roughly 10 tokens per turn — noise. Benefit: Claude knows what time it is, how long the session has run, and can pace itself (“it’s 11pm and turn 80 — want to wrap?”). Session notes get real timestamps too. Trick 2 — timestamps in the UI One setting, no script: { "showMessageTimestamps": true } Every Claude response gets stamped with its arrival time in the terminal — like a shell prompt for your conversation. (Display-only; it doesn’t enter the transcript content. That distinction matters for trick 3.) Trick 3 — the canary, with an answer key Matthew’s original idea: put an instruction early in your setup like “always begin every response with the word X.” When Claude stops doing it, your context is getting muddy — the canary died, get out of the mine.