KRIT.JUNSREE PERSONAL WEBSITE
MEDIUM

Claude Agents SDK: Best Practice จากทีมที่สร้างมัน

แปลบทความ Robert Mill — วิวัฒนาการ LLM call → workflow → agent, ทำไม Bash เป็น tool ที่ทรงพลังสุด (composability + dynamic script gen + leverage ffmpeg/jq/CLI), agent loop 3 step (Gather Context → Take Action → Verify), design principle จากทีม Claude Code

By krit.junsree@gmail.com ◆ Jul 10, 2026 ◆ 4 MIN READ Beginner

☰ ON THIS PAGE

Robert Mill สรุป best practice จากทีมที่สร้าง Claude Agents SDK — วิวัฒนาการจาก LLM call → workflow → agent, ทำไม Bash เป็น tool ที่ทรงพลัง, agent loop 3 step, design principle

วิวัฒนาการจาก LLM Call สู่ Agent

วงการเดินผ่าน 3 stage:

  1. Single LLM features — call ทีละครั้ง ตอบทีละอัน เช่น จัด category email
  2. Workflows — process multi-step มีโครง เช่น RAG-based codebase indexing
  3. 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

  1. Gather Context — ประเมิน state ปัจจุบัน, อ่านไฟล์, search info
  2. Take Action — implement การเปลี่ยนแปลง, run command, call API
  3. 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 · อ่านต้นฉบับ

Leave a Reply

Your email address will not be published. Required fields are marked *