Robert Mill สรุป best practice จากทีมที่สร้าง Claude Agents SDK — วิวัฒนาการจาก LLM call → workflow → agent, ทำไม Bash เป็น tool ที่ทรงพลัง, agent loop 3 step, design principle
วิวัฒนาการจาก LLM Call สู่ Agent
วงการเดินผ่าน 3 stage:
- Single LLM features — call ทีละครั้ง ตอบทีละอัน เช่น จัด category email
- Workflows — process multi-step มีโครง เช่น RAG-based codebase indexing
- Agents — ระบบ autonomous เต็มตัว รันเองต่อเนื่อง 10-30+ นาที
Claude Code = agent จริงตัวแรก. Claude Agents SDK build ตรงบน Claude Code
ทุก Agent ต้องมี Harness
Harness = component ที่ห่อ model ให้กลายเป็น agent. Element สำคัญ:
- Tools — interact กับ filesystem, run command, custom capability
- Prompts — core directive ที่นำทาง behavior
- File System — essential สำหรับ context engineering
- Skills — progressive capability disclosure
- Sub-agents — delegate task + จัดการ context
SDK รวมบทเรียนจากการ deploy Claude Code จริง — จัด tool error, ปรับ context, จัด permission
Bash Is All You Need
Bash กลายเป็น tool ที่ทรงพลังสุดของ agent เพราะ:
- Composability — pipe command, เก็บ result, chain operation แบบ dynamic
- Dynamic script generation — agent เขียน + รัน script ได้ on demand
- Leverage software ที่มีอยู่ — integrate ffmpeg, jq, LibreOffice, CLI tool ต่าง ๆ
- Self-verification — เก็บ intermediate result + verify pattern เอง
แทนที่จะออกแบบ tool สำหรับ search/lint/execute แยกทุก use case → agent ใช้ CLI ที่มีอยู่แล้วแบบ dynamic
Agent Loop — 3 Step
- Gather Context — ประเมิน state ปัจจุบัน, อ่านไฟล์, search info
- Take Action — implement การเปลี่ยนแปลง, run command, call API
- Verify Work — ยืนยัน execution สำเร็จ + self-correct
Design Principles
- “Simple does not mean easy” — ความเรียบง่ายผิวเผินซ่อนรายละเอียด implementation สำคัญไว้
- ใช้ sub-agent จัดการ context
- มอง filesystem เป็น context engineering tool ไม่ใช่แค่ที่เก็บบทสนทนา
- Deploy skill สำหรับ graduated capability exposure
แหล่งที่มา: “Claude Agents SDK: Best Practices From the Team That Built It” โดย Robert Mill ตีพิมพ์ 20 ก.พ. 2026 บน Medium · อ่านต้นฉบับ