Claude Opus 4.6 + Agent Teams + Firecrawl: Xây Chrome Extension Tìm Coupon Trong Một Buổi
Điểm nổi bật
Nhấn để đến mục tương ứng
- 1 Khi nên dùng Task thực sự parallelizable — components độc lập Timeline là constraint chính Budget không phải concern lớn Khi không nên dùng Tasks có nhiều dependencies giữa components Solo project nhỏ — overhead coordination không worth it Budget tight — Agent Teams multiply cost nhanh Rule of thumb:.
- 2 Claude Opus 4.6 không phải là "Opus tốt hơn một chút" — đây là model với những thay đổi kiến trúc quan trọng ảnh hưởng đến cách bạn build với nó. 1M Token Context Window (Beta) Context window 1 triệu token không chỉ là con số.
- 3 5000-8000 thinking tokens Cost savings so với fixed maximum thinking: 50-100 thinking tokens Medium task (debug auth flow): Grigorio test adaptive thinking mode với cùng task ở different complexity levels:.
- 4 Một orchestrator agent nhận task tổng thể Orchestrator spawn nhiều sub-agents cho các subtasks Mỗi sub-agent chạy trong tmux pane riêng — independent và parallel Sub-agents report back kết quả cho orchestrator Orchestrator synthesize và deliver final output Demo ấn tượng nhất từ Anthropic:.
- 5 Output clean Markdown thay vì raw HTML — LLM đọc hiệu quả hơn, ít token hơn /agent endpoint: Firecrawl tự navigate web autonomously để hoàn thành task Handle JavaScript-heavy sites (SPAs) mà curl/fetch thường fail Anti-bot bypass built-in Quan trọng:.
Claude Opus 4.6 — Những Gì Thực Sự Mới
Claude Opus 4.6 không phải là "Opus tốt hơn một chút" — đây là model với những thay đổi kiến trúc quan trọng ảnh hưởng đến cách bạn build với nó. Leonardo Grigorio từ Firecrawl phân tích những improvements thực sự relevant cho developers:
1M Token Context Window (Beta)
Context window 1 triệu token không chỉ là con số. Với MRCR v2 benchmark, Opus 4.6 đạt 76% accuracy (so với 18.5% của model trước) — nghĩa là ít "context rot" hơn đáng kể khi làm việc với large codebase hay nhiều documents.
Implications cho developers:
- Đưa entire codebase vào một session — không cần chunking
- Maintain coherence trong projects nhiều file
- Research tasks với nhiều sources không bị mất context
128K Output Tokens — Gấp Đôi
Output token limit tăng từ 64K lên 128K. Điều này quan trọng cho:
- Generate large files trong một lần
- Viết comprehensive documentation không bị cắt
- Complete implementations không cần nhiều calls
Adaptive Thinking Mode
Thay vì fixed reasoning budget, Opus 4.6 dynamically allocate thinking effort. Simple tasks: ít compute. Complex reasoning: full extended thinking. Kết quả: better price/quality ratio mà không sacrifice quality cho hard tasks.
Fine-Grained Tool Streaming (Generally Available)
Tool streaming cho phép xem Claude đang gọi tool gì và nhận partial results trong realtime — không cần đợi full response. Crucial cho long-running agentic tasks.
Agent Teams — Orchestrator + Sub-Agents
Agent Teams là tính năng research preview trong Claude Code. Concept cơ bản:
- Một orchestrator agent nhận task tổng thể
- Orchestrator spawn nhiều sub-agents cho các subtasks
- Mỗi sub-agent chạy trong tmux pane riêng — independent và parallel
- Sub-agents report back kết quả cho orchestrator
- Orchestrator synthesize và deliver final output
Demo ấn tượng nhất từ Anthropic: 16 agent teams build C compiler trong Rust, compile và boot Linux 6.9 trên x86, ARM, và RISC-V. Cost ~$20,000 tokens. Timeline: 3 giờ. Để so sánh — bình thường cần team kỹ sư nhiều tuần.
Với Agent Teams, pattern lý tưởng là:
- Orchestrator: architecture decisions, task delegation, synthesis
- Sub-agent 1: Design và UI
- Sub-agent 2: Core functionality
- Sub-agent 3: Tests và validation
- Sub-agent 4: Documentation
"The orchestrator delegates tasks like design, component building, and testing to specialized agents" — mỗi agent focus vào domain của mình.
Firecrawl — Web Scraping Cho AI Agents
Firecrawl không phải scraping tool thông thường. Nó được thiết kế specific cho AI agents:
- Output clean Markdown thay vì raw HTML — LLM đọc hiệu quả hơn, ít token hơn
-
/agentendpoint: Firecrawl tự navigate web autonomously để hoàn thành task - Handle JavaScript-heavy sites (SPAs) mà curl/fetch thường fail
- Anti-bot bypass built-in
Quan trọng: 5 free daily agent executions — đủ để experiment và prototype mà không cần tốn tiền.
Tutorial: Chrome Extension Tìm Coupon
Grigorio build một Chrome extension tìm coupon discount codes tự động. Đây là walkthrough của implementation:
Tech Stack
- Plasmo framework — Chrome extension development với React
- shadcn components — UI components với Firecrawl branding
- Firecrawl /agent endpoint — autonomous web research cho coupon codes
- Claude Opus 4.6 — orchestration và reasoning
Architecture
Extension flow:
- User click extension button khi ở trang checkout
- Extension extract: website name, URL, product details, ngày, locale
- Send to Firecrawl /agent với task: "Tìm active coupon codes cho [website] ngày [date]"
- Firecrawl autonomously browse coupon sites, Reddit deals, public sources
- Return structured list coupon codes với reliability score
- Display trong extension popup, ranked by reliability
- One-click apply vào input field
Tại Sao Firecrawl Thay Vì Claude Native Browsing?
Claude có khả năng browse web natively, nhưng với structured web research task, Firecrawl vượt trội vì:
- Speed: Firecrawl parallel browse nhiều sources, Claude browse sequential
- Context efficiency: Firecrawl return clean summaries, không đổ raw HTML vào context window
- Reliability: Handle JS-heavy coupon sites tốt hơn basic fetch
- Cost: Ít token hơn = cheaper per search
Code Pattern Chính
Firecrawl /agent call:
const result = await firecrawl.agent({
task: `Find active coupon codes for ${websiteName} on ${currentDate}.
Site URL: ${siteUrl}.
Return: list of codes with estimated discount and confidence score.
Focus on: official site, coupon aggregators, Reddit r/deals.`,
maxIterations: 10
});
Kết quả được Claude Opus 4.6 process và rank theo:
- Source reliability (official site > coupon site > Reddit)
- Freshness (ngày đăng)
- Community validation (upvotes, comments confirm working)
Agent Teams Trong Practice — Cẩn Thận Với Chi Phí
Grigorio honest về trade-offs của Agent Teams:
Khi nên dùng
- Task thực sự parallelizable — components độc lập
- Timeline là constraint chính
- Budget không phải concern lớn
Khi không nên dùng
- Tasks có nhiều dependencies giữa components
- Solo project nhỏ — overhead coordination không worth it
- Budget tight — Agent Teams multiply cost nhanh
Rule of thumb: 16 agents chạy parallel tốn token gấp ~16 lần so với single agent sequential. Nếu task có thể làm sequential trong thời gian chấp nhận được, agent teams không cần thiết.
Adaptive Thinking Trong Thực Tế
Grigorio test adaptive thinking mode với cùng task ở different complexity levels:
- Simple task (categorize file type): 50-100 thinking tokens
- Medium task (debug auth flow): 500-1000 thinking tokens
- Complex task (architect microservices): 5000-8000 thinking tokens
Cost savings so với fixed maximum thinking: ~40-60% cho mixed workloads. Significant cho production applications với high volume.
Tổng Kết: Opus 4.6 + Firecrawl = Stack Mạnh Cho Web-Aware Agents
Combination Opus 4.6 + Firecrawl solve một gap lớn trong AI agent ecosystem: web research tốn kém và không reliable với basic tools. Firecrawl handle dirty web scraping work, Opus 4.6 handle reasoning và synthesis.
Chrome extension coupon finder là một use case, nhưng pattern này applicable cho bất kỳ agent nào cần:
- Real-time web research
- Price monitoring
- Competitor intelligence
- News aggregation với context
Đọc thêm về multi-agent architecture tại Building Effective Agents với Claude — Hướng dẫn kiến trúc và Agent Workflows — Chaining, Routing, Parallelization. Để hiểu Claude Code deep-dive, xem Claude Code toàn tập.
Nguồn tham khảo
Bài viết tổng hợp từ: Leonardo Grigorio, "Building Apps with Claude Opus 4.6 Agent Teams & Firecrawl Agent", đăng tại firecrawl.dev. Firecrawl là nền tảng web scraping và research cho AI agents.
Bai viet co huu ich khong?
Bản quyền thuộc về tác giả. Vui lòng dẫn nguồn khi chia sẻ.




