Hot Cache — "ผมให้ AI อ่านทุกอย่างก่อนตอบ — แต่ไม่ต้องเปิดเอง"
แทนที่จะ paste context เองทุกเช้า ผมให้ cron รวม standup, decisions, deadline และไฟล์ที่เพิ่งแก้เป็น hot-cache.md ไฟล์เดียวทุก 4 ชั่วโมง AI อ่านไฟล์เดียวก็รู้สถานการณ์
เปิด Claude Code ตอนเช้า ถามว่า "วันนี้ต้องทำอะไร?"
มันตอบว่า "I don't have access to your current tasks"
ทุกเช้าเริ่มใหม่ทุกครั้ง
ปัญหาคือ AI ไม่รู้ context ของเรา มันไม่รู้ว่าเมื่อวาน ship อะไรไป blocker ตอนนี้คืออะไร deadline เมื่อไหร่ ตลาดเป็นยังไง
วิธีปกติ: เปิด session แล้วก็ paste context เอง ทุกเช้า ทุกครั้ง
วิธีที่ผมทำ: สร้าง hot cache
hot cache คือไฟล์ markdown ไฟล์เดียว ที่รวม context ทุกอย่างที่ AI ต้องรู้ไว้ที่เดียว
แล้วให้ cron refresh มันอัตโนมัติ ทุก 4 ชั่วโมง
พอเปิด session ใหม่ AI อ่านไฟล์นี้ไฟล์เดียว รู้ทุกอย่างที่เปลี่ยนไปตั้งแต่ session ก่อน
ข้างในมีอะไร:
# Hot Cache — 2026-05-24
## Last Standup
- skip bridge ✅ cleared yesterday
- entity setup BLOCKED on Won
- staging env WAITING on Liz
## Active Decisions (top 100 lines)
- [ht_20260218_001] Identity: social-first (Privy) — active
- [ht_20260309_002] Bot controls on-chain — active
...
## Launch Gate (top 50 lines)
- Phase 2: TG ✅ · Deposit ✅ · Withdrawal ✅ · Twitter ✅
- Remaining: entity setup, staging env, mainnet flow testing
- Target: June 2 (post-Penang)
## Schedule
LAUNCH_DATE="2026-06-05"
LAUNCH_MODE="production"
## Recently Modified Files (last 24h)
/root/thufir/data/tester-gate.md
/root/thufir/data/hot-cache.md
...
## Session Primer (compressed)
Build status, active blockers, tomorrow's top 3
AI อ่านไฟล์นี้ไฟล์เดียว รู้ว่า:
- เมื่อวาน ship อะไร
- blocker ตอนนี้คืออะไร
- decision ไหนยัง active
- deadline เหลืออีกกี่วัน
- ไฟล์ไหนเปลี่ยนล่าสุด
ไม่ต้อง paste context เอง ไม่ต้องเปิด 5 ไฟล์ ไม่ต้องอธิบายซ้ำ
trick คือ AI ไม่ได้ไป fetch ข้อมูลเอง
hot cache ไม่ใช่ tool ที่ AI เรียกตอน runtime มันคือ snapshot ที่ cron สร้างไว้ให้ AI อ่านตอนเริ่ม
ทำไม? เพราะ fetch เองช้า แพง แถมพังบ่อย ถ้าให้ AI ไปอ่าน 10 ไฟล์ทุก session มันเสีย token ไปแค่ "อ่านสถานการณ์"
cron refresh ทุก 4 ชั่วโมง: ไปดึง standup ล่าสุด, decisions ที่ยัง active, launch gate status, schedule config, recently modified files — รวมไว้ที่เดียว ตัดให้สั้น ใส่ limit (decisions top 100 บรรทัด, gate top 50)
AI อ่าน 1 ไฟล์ ≈ 200 บรรทัด แทนที่จะอ่าน 10 ไฟล์ ≈ 2,000 บรรทัด
วิธี setup:
สร้างไฟล์
hot-cache.mdใน project directoryเขียน script ที่ดึง context จากไฟล์ต่างๆ มารวม เช่น:
#!/bin/bash
# refresh-hot-cache.sh
echo "# Hot Cache — $(date '+%Y-%m-%d')" > hot-cache.md
echo "" >> hot-cache.md
# Standup
echo "## Last Standup" >> hot-cache.md
tail -50 logs/standup/$(date '+%Y-%m-%d').txt >> hot-cache.md 2>/dev/null
# Active decisions
echo "## Active Decisions" >> hot-cache.md
head -100 vault/decisions.md >> hot-cache.md
# Schedule
echo "## Schedule" >> hot-cache.md
cat schedule.env >> hot-cache.md
# Recently modified files
echo "## Recently Modified (last 24h)" >> hot-cache.md
find . -name "*.md" -mtime -1 -type f >> hot-cache.md
- ตั้ง cron:
0 */4 * * * /root/project/refresh-hot-cache.sh
- ใส่ใน CLAUDE.md:
อ่าน data/hot-cache.md ก่อนตอบคำถามเรื่อง project status, blockers, หรือ decisions
แค่นี้ AI ก็รู้ทุกเช้าว่าเกิดอะไรขึ้น
ปรับให้เข้ากับ project อะไรก็ได้:
ถ้าเป็น dev project → ดึง git log, open PRs, CI status, test coverage
ถ้าเป็น content → ดึง post performance, content calendar, publishing queue
ถ้าเป็น trading → ดึง portfolio balance, open positions, market sentiment
หลักการเดียวกัน: cron refresh snapshot → AI อ่าน snapshot → ไม่ต้อง fetch เอง
ของผม hot cache ถูก refresh ทุก 4 ชั่วโมง รวม:
- standup summary (จาก cron ที่รันเช้า)
- active decisions 100 บรรทัดแรก (จาก Obsidian vault)
- launch gate status (จาก tester-gate.md)
- schedule config (launch date, vacation mode)
- session primer (build status, blockers, interpersonal flags)
- recently modified files (เช็ค file change ใน 24 ชม.)
ทั้งหมดอยู่ใน markdown ไฟล์เดียว ไม่มี API ไม่มี database ไม่มี dependency
ข้อดีที่ไม่คิดว่าจะได้: พอ context อยู่ที่เดียว ผมเองก็เปิดอ่านทุกเช้าเหมือนกัน มันกลายเป็น dashboard ของทั้ง AI และตัวเอง