L
Tahap 1 · Drive the tool
Stage 1 · Drive the tool
Learn
Sebelum bisa mimpin, kamu harus bisa nyetir. Modul ini bikin kamu nyaman ngomong sama Claude Code: apa bedanya sama chat biasa, gimana nyetir biar dia paham, dan gimana dia gerak tanpa bikin kamu deg-degan.
Before you can lead, you have to be able to drive. This module gets you comfortable talking to Claude Code: how it differs from a normal chat, how to steer it so it understands, and how it works without making you nervous.
5 lessonlessons
L1
Apa itu Claude Code — agentic loop vs chatbot
What is Claude Code — agentic loop vs chatbot
Chatbot itu cuma ngomong: kamu nanya, dia jawab teks, selesai. Claude Code itu kerja. Dia jalan di terminal, di dalam folder project kamu, dan punya tangan: bisa baca file, ngedit file, jalanin command, nyari ke seluruh repo, sampai commit ke git.
A chatbot only talks: you ask, it replies with text, done. Claude Code works. It runs in your terminal, inside your project folder, and it has hands: it can read files, edit files, run commands, search the whole repo, even commit to git.
Kuncinya satu kata: agentic loop. Kamu kasih satu tujuan, dia muter sendiri — baca konteks → mikir → ambil aksi (pakai tool) → cek hasil → lanjut — sampai tujuannya kelar. Bukan satu balasan, tapi serangkaian langkah nyata.
The key phrase is one word: agentic loop. You give it one goal, and it cycles on its own — read context → think → take action (use a tool) → check the result → continue — until the goal is done. Not a single reply, but a series of real steps.
Agentic loop — muter sampai kelar, bukan sekali jawab
Agentic loop — it cycles until done, not one-and-done
BacaReadkontekscontext→
MikirThink→
AksiActpakai tooluse a tool→
CekCheckhasilresult
↻ ulangi otomatis sampai tujuan tercapai
↻ repeats automatically until the goal is reached
Chatbot: Tanya → Jawab → berhenti. Cuma teks, nggak nyentuh apa-apa.
Chatbot: Ask → Answer → stop. Just text, touches nothing.
Mindset shift: kamu bukan ngobrol sama AI, kamu lagi ngasih kerjaan ke sesuatu yang bisa nyentuh file beneran.
Mindset shift: you're not chatting with an AI, you're handing work to something that can actually touch your files.
L2
Setup & first run
Claude Code = CLI. Kamu install sekali, terus jalanin dari dalam folder project. Begitu masuk, dia langsung "nyadar" konteks repo kamu.
Claude Code is a CLI. You install it once, then run it from inside your project folder. The moment you're in, it "reads the room" — your repo's context.
# install (pilih salah satu)
curl -fsSL https://claude.ai/install.sh | bash # native (recommended)
npm install -g @anthropic-ai/claude-code # via npm (alternatif)
# masuk ke project, lalu start
cd ~/project
claude
# install (pick one)
curl -fsSL https://claude.ai/install.sh | bash # native (recommended)
npm install -g @anthropic-ai/claude-code # via npm (alternative)
# go into your project, then start
cd ~/project
claude
Sekarang kamu di dalam sesi interaktif. Ketik tujuan kamu pakai bahasa biasa. Dia bakal nanya izin pas mau ngedit/ngejalanin sesuatu yang berdampak (lebih lanjut di L5).
Now you're in an interactive session. Type your goal in plain language. It'll ask permission before editing or running anything with side effects (more in L5).
Coba
Try it
Buka project kamu, jalanin claude, terus ketik: "Jelasin struktur project ini, file mana yang jadi entry point." Perhatiin: dia baca file dulu sebelum jawab — itu agentic loop yang lagi jalan.
Open your project, run claude, then type: "Explain this project's structure, and which file is the entry point." Notice: it reads files before answering — that's the agentic loop in action.
L3
Prompting yang tajam
Sharp prompting
Hasil jelek 90% gara-gara prompt ngambang, bukan AI-nya bodoh. Empat hal yang bikin prompt kamu tajam:
Bad results are 90% vague prompts, not a dumb AI. Four things that make your prompts sharp:
- Spesifik soal hasil. Bukan "rapihin kode ini", tapi "pecah fungsi ini jadi 3, kasih nama yang jelas, jangan ubah behavior".
- Kasih konteks & file. Tunjuk file-nya langsung: "di
src/auth.ts, ...". Dia kerja jauh lebih akurat kalau tau harus liat ke mana.
- Kasih peran. "Kamu reviewer keamanan" beda hasilnya sama "kamu junior dev". Peran nyetel cara dia mikir.
- Sebut kondisi selesai. "Beres kalau
npm test hijau" — dia jadi tau kapan harus berhenti, dan bakal ngecek sendiri.
- Be specific about the outcome. Not "clean up this code", but "split this function into 3, give them clear names, don't change behavior".
- Give context & files. Point straight at the file: "in
src/auth.ts, ...". It works far more accurately when it knows where to look.
- Give it a role. "You're a security reviewer" yields different results than "you're a junior dev". The role sets how it thinks.
- State the done condition. "Done when
npm test is green" — it knows when to stop, and will check itself.
Prompt yang bagus = brief yang bagus. Bayangin kamu lagi nge-brief orang, bukan ngetik ke Google.
A good prompt = a good brief. Imagine you're briefing a person, not typing into Google.
L4
Plan mode — mikir dulu sebelum gerak
Plan mode — think before moving
Buat perubahan gede, kamu nggak mau dia langsung ngedit 12 file. Plan mode bikin Claude Code nyusun rencana dulu — file apa yang disentuh, urutan langkah, trade-off — dan nungguin approval kamu sebelum nyentuh apa pun.
For big changes, you don't want it editing 12 files right away. Plan mode makes Claude Code draft a plan first — which files it'll touch, the order of steps, trade-offs — and wait for your approval before touching anything.
Alurnya: kamu masuk plan mode (ketik /plan), kasih tujuan, dia balikin rencana, kamu baca → approve / revisi → baru dia eksekusi. Ini ngubah "semoga dia bener" jadi "rencananya udah jelas, gas".
The flow: you enter plan mode (type /plan), give the goal, it returns a plan, you read it → approve / revise → then it executes. This turns "hope it's right" into "the plan is clear, go".
Kapan dipakai
When to use it
Refactor lintas-file, fitur baru, migrasi, atau apa pun yang kamu sendiri belum yakin pendekatannya. Buat edit kecil/jelas, skip — plan mode malah mperlambat.
Cross-file refactors, new features, migrations, or anything where you're not sure of the approach yourself. For small, obvious edits, skip it — plan mode just slows you down.
L5
Baca, edit & run dengan aman
Read, edit & run safely
Claude Code default-nya hati-hati: dia minta izin sebelum ngedit file atau jalanin command yang berdampak. Kamu yang pegang rem. Tiga hal yang perlu kamu paham:
Claude Code is careful by default: it asks permission before editing files or running commands with side effects. You hold the brakes. Three things to understand:
- Permission prompt. Tiap aksi berisiko (hapus, overwrite, command asing) bakal munta konfirmasi. Baca dulu, baru iya.
- Allowlist. Command yang sering & aman (kayak
npm test, git status) bisa kamu izinin permanen biar nggak ditanya terus.
- Git = jaring pengaman. Kerja di branch, commit sering. Salah arah tinggal balik. Ini kebiasaan paling murah yang nyelametin kamu.
- Permission prompt. Every risky action (delete, overwrite, unfamiliar command) asks for confirmation. Read first, then say yes.
- Allowlist. Frequent, safe commands (like
npm test, git status) can be permanently allowed so it stops asking.
- Git = safety net. Work on a branch, commit often. Wrong turn? Just go back. It's the cheapest habit that saves you.
Aman itu bukan soal AI-nya dipercaya 100% — tapi soal kamu punya undo. Branch + commit = undo.
Safety isn't about trusting the AI 100% — it's about having an undo. Branch + commit = undo.
E
Tahap 2 · Kasih aturan & ingatan
Stage 2 · Set rules & memory
Establish
Di tahap L kamu ngulang-ngulang konteks tiap sesi. Capek. Tahap E bikin Claude Code inget — aturan main, gaya kerja, dan perintah favorit kamu jadi permanen, nggak usah diketik ulang.
In stage L you repeat context every session. Tiring. Stage E makes Claude Code remember — the rules, your working style, and your favorite commands become permanent, no retyping.
4 lessonlessons
E1
CLAUDE.md — aturan yang selalu dipatuhi
CLAUDE.md — rules it always follows
CLAUDE.md itu file di root project kamu yang otomatis kebaca tiap sesi. Anggap kayak onboarding doc buat anggota tim baru — isinya hal yang kamu nggak mau jelasin berulang-ulang.
CLAUDE.md is a file at your project root that's auto-loaded every session. Think of it as an onboarding doc for a new teammate — it holds the things you don't want to explain over and over.
CLAUDE.md
# Project: Toko Online API
## Konvensi
- Pakai TypeScript strict. Jangan ada `any`.
- Test pakai Vitest. Tiap fitur baru wajib ada test.
## Command penting
- Build: `npm run build`
- Test: `npm test`
## Jangan
- Jangan commit ke `main` langsung. Selalu branch.
- Jangan ubah file di `legacy/` tanpa nanya dulu.
# Project: Online Store API
## Conventions
- Use strict TypeScript. No `any`.
- Test with Vitest. Every new feature needs a test.
## Key commands
- Build: `npm run build`
- Test: `npm test`
## Don't
- Don't commit to `main` directly. Always branch.
- Don't change files in `legacy/` without asking first.
Cara cepet bikin: jalanin /init di sesi — Claude Code bakal nyusun draf CLAUDE.md dari isi repo kamu, tinggal kamu rapihin.
Quick way to create one: run /init in a session — Claude Code drafts a CLAUDE.md from your repo, and you just tidy it up.
Setiap kali kamu ngoreksi hal yang sama dua kali, itu sinyal: tulis di CLAUDE.md, biar nggak ada koreksi ketiga.
Every time you correct the same thing twice, that's a signal: write it in CLAUDE.md, so there's no third correction.
E2
Memory & continuity antar-sesi
Memory & continuity across sessions
CLAUDE.md itu aturan project. Memory itu hal yang kamu mau Claude inget lintas waktu — keputusan, preferensi, status kerjaan yang lagi jalan. Bedanya: CLAUDE.md kamu tulis tangan; memory bisa kamu suruh dia simpen sendiri.
CLAUDE.md is project rules. Memory is what you want Claude to remember over time — decisions, preferences, the status of ongoing work. The difference: you write CLAUDE.md by hand; memory you can tell it to save on its own.
- Simpan keputusan, bukan kode. "Kita pindah dari REST ke tRPC karena X" — itu konteks yang nggak keliatan dari git history.
- Tulis tanggal absolut. "deadline 13 Juli 2026", bukan "minggu depan" — biar masih kebaca sesi depan.
- Update, jangan numpuk. Kalau ada file memory yang udah usang, betulin — jangan biarin dia nyimpen dua versi.
- Save decisions, not code. "We moved from REST to tRPC because X" — that's context git history doesn't show.
- Write absolute dates. "deadline 13 July 2026", not "next week" — so it still reads right next session.
- Update, don't pile up. If a memory is stale, fix it — don't let it keep two versions.
Coba
Try it
Di akhir sesi, ketik: "Inget ya: kita mutusin pakai Postgres, bukan Mongo, alasannya butuh relasi kuat." Sesi berikutnya, tanya balik — dia masih tau.
At the end of a session, type: "Remember: we chose Postgres, not Mongo, because we need strong relations." Next session, ask again — it still knows.
E3
Context management — jaga tetap lean
Context management — keep it lean
Claude Code punya "ruang ingat" terbatas per sesi (context window). Kalau kamu jejelin semua, dia jadi lemot & gampang ilang fokus. Aturan main:
Claude Code has a limited "working memory" per session (the context window). Cram everything in and it gets slow & loses focus. The rules:
- Tunjuk file, jangan paste. Bilang "liat
src/api.ts", jangan tempel 800 baris ke chat. Dia bisa baca sendiri.
- Mulai bersih buat tugas baru. Selesai satu kerjaan gede,
/clear sebelum mulai yang nggak nyambung — biar konteks lama nggak ngeganggu.
- Satu sesi, satu fokus. Jangan campur "benerin bug auth" sama "desain ulang landing" di sesi yang sama.
- Point at files, don't paste. Say "look at
src/api.ts", don't paste 800 lines into the chat. It can read it itself.
- Start clean for new tasks. After a big task,
/clear before starting something unrelated — so old context doesn't interfere.
- One session, one focus. Don't mix "fix the auth bug" with "redesign the landing page" in the same session.
Context window itu kayak meja kerja — makin berantakan, makin lambat. Bersihin tiap ganti tugas.
The context window is like a desk — the messier it gets, the slower you go. Clear it whenever you switch tasks.
E4
Skills & slash commands
Kalau ada alur kerja yang kamu ulang terus — "review PR ini pakai checklist kamu", "bikin draft changelog" — jadiin slash command. Sekali bikin, tinggal panggil /nama kapan aja.
If there's a workflow you repeat — "review this PR with my checklist", "draft a changelog" — turn it into a slash command. Build it once, then call /name anytime.
.claude/commands/review.md
# Review checklist kamu
Review perubahan di branch ini. Cek:
1. Ada test buat tiap fungsi baru?
2. Error handling-nya bener?
3. Ada secret/key yang ke-commit?
Kasih output ringkas: PASS / FIX per poin.
# My review checklist
Review the changes on this branch. Check:
1. Is there a test for every new function?
2. Is error handling correct?
3. Any secrets/keys committed?
Give a short output: PASS / FIX per item.
Sekarang tinggal ketik /review — dia jalanin checklist itu tanpa kamu ngetik ulang. Ini SOP kamu, dikodifikasi. (Di versi baru Claude Code, command kayak gini udah jadi bagian "skills" — folder .claude/skills/ juga bikin /review yang sama; .claude/commands/ tetap jalan.)
Now just type /review — it runs that checklist without you retyping. This is your SOP, codified. (In recent Claude Code, commands like this have merged into "skills" — a .claude/skills/ folder also creates the same /review; .claude/commands/ still works.)
Slash command = SOP yang bisa dieksekusi. Kerjaan berulang kamu berhenti jadi ketikan, jadi satu kata.
A slash command = an executable SOP. Your repetitive work stops being typing and becomes one word.
A
Tahap 3 · Sambung ke sistem nyata
Stage 3 · Connect to real systems
Attach
Sejauh ini Claude Code cuma "lihat" folder kamu. Tahap A nyolokin dia ke dunia luar — GitHub, database, Notion, Figma, browser — biar dia bisa narik & ngubah data beneran, bukan cuma file lokal.
So far Claude Code only "sees" your folder. Stage A plugs it into the outside world — GitHub, databases, Notion, Figma, the browser — so it can pull & change real data, not just local files.
4 lessonlessons
A1
MCP servers — apa & kenapa
MCP servers — what & why
MCP (Model Context Protocol) itu colokan standar buat nyambungin Claude ke tool/data luar. Satu MCP server = satu set "tangan" baru. Pasang GitHub MCP → Claude bisa baca issue & bikin PR. Pasang database MCP → dia bisa query data kamu.
MCP (Model Context Protocol) is a standard plug for connecting Claude to external tools/data. One MCP server = a new set of "hands". Add the GitHub MCP → Claude can read issues & open PRs. Add a database MCP → it can query your data.
# nambah MCP server (contoh)
claude mcp add github
claude mcp list # liat yang udah konek
# add an MCP server (example)
claude mcp add github
claude mcp list # see what's connected
Kenapa ini gede: tanpa MCP, AI cuma bisa ngomongin sistem kamu. Dengan MCP, dia bisa beraksi di sistem kamu — itu beda antara "kasih saran" dan "ngerjain".
Why this is big: without MCP, the AI can only talk about your systems. With MCP, it can act on them — that's the difference between "give advice" and "get it done".
MCP — satu colokan = satu set "tangan" baru
MCP — one plug = a new set of "hands"
Claude Code
GitHubissue · PR
Databasequery · migrasiquery · migration
Notiondocs
Figmadesign token
Playwrightbrowser
Tanpa MCP: cuma bisa ngomongin sistem. Dengan MCP: bisa beraksi di sistem.
Without MCP: it can only talk about systems. With MCP: it can act on them.
Tiap MCP yang dicolok = satu kerjaan manual yang sekarang bisa dilempar.
Every MCP you plug in = one manual job you can now hand off.
A2
Integrasi yang sering kepake
Integrations you'll actually use
Kamu nggak perlu semua. Pasang yang nyentuh kerjaan kamu:
You don't need them all. Add the ones that touch your work:
- GitHub — baca issue, review & bikin PR, cari kode lintas repo.
- Database (Postgres/Supabase) — query, cek skema, jalanin migrasi.
- Notion — baca/tulis dokumen & database tim.
- Playwright — nyetir browser beneran: ngeklik, ngisi form, screenshot, verifikasi UI.
- Figma — narik design token / komponen langsung dari file desain.
- GitHub — read issues, review & open PRs, search code across repos.
- Database (Postgres/Supabase) — query, inspect schema, run migrations.
- Notion — read/write your team's docs & databases.
- Playwright — drive a real browser: click, fill forms, screenshot, verify the UI.
- Figma — pull design tokens / components straight from the design file.
Pola yang ngebuka mata
An eye-opening pattern
Gabungin dua: "Ambil 5 issue teratas dari GitHub, terus drafin balasannya di Notion." Satu kalimat, dua sistem, nol copy-paste. Itu kekuatan Attach.
Combine two: "Grab the top 5 GitHub issues, then draft replies in Notion." One sentence, two systems, zero copy-paste. That's the power of Attach.
A3
Git workflow — branch, commit, PR
Claude Code paling kuat pas dikasih alur git penuh lewat gh (GitHub CLI). Dia bisa bikin branch, commit dengan pesan yang rapi, push, sampai buka PR — semua diarahin sama kamu.
Claude Code is at its strongest with the full git flow via gh (GitHub CLI). It can create branches, commit with clean messages, push, and open PRs — all directed by you.
# Claude bisa ngejalanin alur ini buat kamu:
git checkout -b fix/login-bug
# ...dia ngedit & test...
git commit -m "fix: handle null session on login"
gh pr create --fill
# Claude can run this flow for you:
git checkout -b fix/login-bug
# ...it edits & tests...
git commit -m "fix: handle null session on login"
gh pr create --fill
- Branch dulu, selalu. Apalagi kalau CLAUDE.md kamu udah larang commit ke
main.
- Commit kecil & sering. Gampang di-review, gampang di-revert.
- Biarin dia nulis PR body. Dia inget semua yang diubah — ringkasannya biasanya lebih lengkap dari yang kamu tulis manual.
- Branch first, always. Especially if your CLAUDE.md already forbids committing to
main.
- Small, frequent commits. Easy to review, easy to revert.
- Let it write the PR body. It remembers everything it changed — the summary is usually more complete than what you'd write by hand.
Git bukan cuma version control di sini — itu kontrak antara kamu & agent. Tiap commit = checkpoint yang kamu setujui.
Git isn't just version control here — it's the contract between you & the agent. Every commit = a checkpoint you approved.
A4
Hooks & permissions — atur otomatis
Hooks & permissions — automate the rules
Dua tuas kontrol penting ada di settings.json:
Two important control levers live in settings.json:
- Permissions / allowlist. Tentuin command apa yang boleh jalan tanpa nanya. Sekali set, sesi kamu jadi mulus.
- Hooks. Otomatisin perilaku di sekitar aksi Claude. Contoh: tiap habis ngedit file, otomatis jalanin formatter. Atau sebelum commit, otomatis jalanin lint.
- Permissions / allowlist. Decide which commands may run without asking. Set once, and your sessions get smooth.
- Hooks. Automate behavior around Claude's actions. Example: after every file edit, auto-run a formatter. Or before a commit, auto-run lint.
.claude/settings.json
{
"hooks": {
"PostToolUse": [{
"matcher": "Edit",
"hooks": [{ "type": "command", "command": "npm run format" }]
}]
}
}
Bedanya sama nyuruh manual: hook itu dijamin jalan tiap kondisi kepenuhin — bukan "semoga AI inget". Kamu mindahin aturan dari harapan ke mesin.
The difference from asking manually: a hook is guaranteed to run whenever its condition is met — not "hope the AI remembers". You move the rule from hope to machine.
Hook = kebiasaan yang dipasang ke sistem. Kamu nggak perlu inget format kode — mesinnya yang inget.
A hook = a habit wired into the system. You don't need to remember to format code — the machine remembers.
D
Tahap 4 · Mimpin tanpa ngerjain
Stage 4 · Lead without doing
Direct
Puncaknya. Di sini kamu berhenti ngetik tiap langkah dan mulai mengarahkan: nyuruh AI jalan sendiri sesuai waktu (loop), dan ngebagi kerjaan ke banyak agent spesialis yang jalan paralel (subagents). Kamu naik dari operator jadi konduktor.
The peak. Here you stop typing every step and start directing: telling the AI to run on its own over time (loop), and splitting work across many specialist agents running in parallel (subagents). You rise from operator to conductor.
5 lessonlessons
D1
Loop mode — otonom lintas waktu
Loop mode — autonomous over time
Loop bikin Claude Code ngejalanin satu tugas berulang — di interval tetap, atau self-paced (dia nentuin sendiri kapan layak ngecek lagi). Bedanya sama nyuruh sekali: loop jalan terus, ngambil keputusan tiap putaran.
Loop makes Claude Code run one task repeatedly — on a fixed interval, or self-paced (it decides when it's worth checking again). The difference from a one-off: a loop keeps running, making decisions each round.
# interval tetap
/loop 30m cek inbox, triage file baru
# self-paced (dia yang atur ritme)
/loop pantau CI, lapor kalau merah
# fixed interval
/loop 30m check inbox, triage new files
# self-paced (it sets the rhythm)
/loop watch CI, report if it goes red
- Watcher. Jaga folder/inbox/endpoint; begitu ada yang berubah, dia bertindak.
- Poller. Tungguin sesuatu kelar (build, deploy), lanjut pas siap.
- Stop condition. Kasih syarat berhenti ("stop kalau 2x cek kosong") biar nggak jalan selamanya.
- Watcher. Guard a folder/inbox/endpoint; the moment something changes, it acts.
- Poller. Wait for something to finish (build, deploy), continue when it's ready.
- Stop condition. Give it a stopping rule ("stop after 2 empty checks") so it doesn't run forever.
Loop = AI yang kerja pas kamu nggak ada. Ini titik di mana waktu kamu mulai beneran balik.
Loop = AI that works while you're away. This is where your time genuinely starts coming back.
D2
Background tasks & cron — bikin permanen
Background tasks & cron — make it permanent
Loop hidup selama sesi kamu kebuka. Buat yang harus jalan terus walau kamu tutup laptop, kamu turunin ke cron — penjadwal OS yang ngejalanin script otomatis.
A loop lives while your session is open. For things that must run even after you close the laptop, drop down to cron — the OS scheduler that runs scripts automatically.
# crontab: tiap hari jam 08:05, sync transaksi
5 1 * * * /usr/bin/python3 ~/sync.py >> ~/sync.log 2>&1
# crontab: every day at 08:05, sync transactions
5 1 * * * /usr/bin/python3 ~/sync.py >> ~/sync.log 2>&1
Beda peran, jangan ketuker:
Different roles, don't mix them up:
Cron vs Loop — jangan ketuker
Cron vs Loop — don't mix them up
Cron · ototCron · muscle
Script buta
A blind script
Jalanin hal yang sama, tepat waktu, tanpa mikir. Buat tugas mekanis fixed. Hidup walau laptop ketutup.
Runs the same thing, on time, without thinking. For fixed mechanical tasks. Lives even with the laptop closed.
Loop · otot + otakLoop · muscle + brain
Agent yang nalar
An agent that reasons
Mutusin tiap putaran (ambil apa, triage ke mana). Buat yang butuh judgment. Hidup selama sesi.
Decides each round (what to grab, where to triage). For things that need judgment. Lives during the session.
Pola matang dulu di loop (manual, fleksibel) → baru turunin ke cron pas udah jadi rutinitas pasti.
Let the pattern mature in a loop (manual, flexible) → only drop to cron once it's a settled routine.
D3
Subagents — delegasi ke spesialis
Subagents — delegate to specialists
Subagent itu agent terpisah yang kamu kasih satu tugas, jalan di konteks sendiri yang bersih, terus balikin hasilnya. Kenapa dipisah?
A subagent is a separate agent you hand one task, runs in its own clean context, then returns the result. Why separate?
- Jaga konteks utama tetap bersih. Riset yang makan 50 file dikerjain di subagent — kamu cuma terima kesimpulannya, bukan sampah-nya.
- Paralel. Lima subagent bisa jalan bareng, tiap-tiap garap potongan beda.
- Spesialisasi. Tiap agent bisa punya keahlian & tool sendiri.
- Keep the main context clean. Research that eats 50 files runs in a subagent — you only get the conclusion, not the mess.
- Parallel. Five subagents can run at once, each working a different chunk.
- Specialization. Each agent can have its own expertise & tools.
Pola
Pattern
"Sebar 4 subagent buat nyari bug — masing-masing pegang satu modul — terus kumpulin temuannya jadi satu laporan." Kamu cuma baca laporan akhir; kerja kasarnya keurus paralel.
"Fan out 4 subagents to hunt bugs — each owns one module — then gather the findings into one report." You just read the final report; the grunt work is handled in parallel.
Sebar paralel → gabung jadi satu hasil
Fan out in parallel → merge into one result
Orchestrator
▼ sebar (paralel)▼ fan out (parallel)
RisetResearch
TulisWrite
Review
QA
▼ kumpulin▼ gather
Laporan akhirFinal report
D4
Bangun agent squad / fleet
Build an agent squad / fleet
Subagent sekali-pakai itu bagus. Tapi kekuatan beneran muncul pas kamu bikin squad permanen — agent custom yang nempel di project kamu, tiap-tiap punya peran, tool, dan aturan sendiri. Definisinya satu file Markdown:
One-off subagents are good. But the real power shows when you build a permanent squad — custom agents that live in your project, each with its own role, tools, and rules. Defined in a single Markdown file:
.claude/agents/reviewer.md
---
name: reviewer
description: Review kode buat bug & security. Pakai sebelum merge.
tools: Read, Grep, Bash
model: sonnet
---
Kamu reviewer senior. Fokus correctness & keamanan.
Jangan ngedit kode — lapor temuan + saran fix doang.
---
name: reviewer
description: Review code for bugs & security. Use before merge.
tools: Read, Grep, Bash
model: sonnet
---
You're a senior reviewer. Focus on correctness & security.
Don't edit code — just report findings + suggested fixes.
Sekali kebikin, kamu bisa route kerjaan ke dia: "suruh reviewer cek branch ini". Punya beberapa = kamu punya tim: ada yang riset, ada yang nulis, ada yang QA. Persis kayak ngebangun departemen, tapi isinya agent.
Once built, you can route work to it: "have the reviewer check this branch". Have several = you have a team: one researches, one writes, one does QA. Exactly like building a department, but staffed by agents.
Frontmatter = "job desc" agent. name & description wajib; tools & model opsional (masih ada field opsional lain). Description yang jelas bikin Claude tau kapan manggil agent yang mana.
Frontmatter = the agent's "job description". name & description are required; tools & model are optional (there are more optional fields). A clear description lets Claude know when to call which agent.
D5
Orchestration — manage subagents
Begitu punya squad, kerjaan kamu berubah jadi orchestrator: nentuin apa yang jalan paralel, apa yang berurutan, dan gimana hasilnya digabung. Dua pola dasar:
Once you have a squad, your job becomes the orchestrator: deciding what runs in parallel, what runs in sequence, and how results merge. Two base patterns:
- Parallel (fan-out). Banyak agent jalan bareng, nggak saling nunggu. Cepet, cocok buat kerjaan independen — sweep, riset multi-sumber, review multi-dimensi.
- Pipeline. Output agent satu jadi input agent berikutnya. Cocok buat alur bertahap — temukan → verifikasi → rangkum.
- Parallel (fan-out). Many agents run at once, no waiting on each other. Fast, good for independent work — sweeps, multi-source research, multi-dimension reviews.
- Pipeline. One agent's output becomes the next agent's input. Good for staged flows — find → verify → summarize.
Dua pola orchestrate
Two orchestration patterns
Parallel · fan-out
ABC
Jalan bareng dari satu sumber, nggak saling nunggu. Cepet — buat kerjaan independen.
Run together from one source, no waiting. Fast — for independent work.
Pipeline
TemukanFind→VerifikasiVerify→RangkumSummarize
Output satu jadi input berikutnya. Buat alur bertahap yang saling tergantung.
One's output is the next one's input. For staged, dependent flows.
Aturan main orchestrator
Orchestrator rules of thumb
Fan-out pas tugas independen. Pipeline pas tiap tahap butuh hasil tahap sebelumnya. Dan selalu ada satu langkah verifikasi di ujung — jangan percaya gitu aja hasil yang belum dicek.
Fan out when tasks are independent. Pipeline when each stage needs the previous result. And always put a verify step at the end — don't blindly trust unchecked results.
Di titik ini kamu nggak nyentuh kode lagi — kamu ngatur siapa-ngerjain-apa. Itu arti D: Direct. Kamu udah mimpin, bukan ngetik.
At this point you're not touching code anymore — you're arranging who-does-what. That's what D: Direct means. You're leading now, not typing.