- Superpowers đạt 175.000 GitHub stars - framework biến Claude Code từ generalist thành specialist với TDD bắt buộc và subagent workflow.
- Claude-mem tiết kiệm 10x token bằng 3-layer memory retrieval, hiện tại ở v12.4.9 sau 253 releases.
- Claude-squad chạy 5 agent song song qua tmux + git worktrees, không conflict, PRs sẵn sàng mỗi buổi sáng.
- Toàn bộ stack: $0 cơ sở hạ tầng, chỉ trả $20/tháng cho Claude Code subscription.
TL;DR
Hầu hết mọi người dùng Claude Code như một chatbot. Thread này mô tả cách biến nó thành đội dev 5 người làm việc 24/7, nhờ một stack 6 lớp hoàn toàn open source và chỉ tốn $20/tháng. Key insight: Claude Code không có memory - mỗi session bắt đầu từ zero. Stack này fix vấn đề đó bằng persistent memory, parallel agents, TDD enforcement và automated workflows.
Vấn đề gốc rễ: 47 phút/ngày lãng phí
Claude Code mặc định là ephemeral. Mỗi session mở ra, nó quên hết mọi thứ - stack của bạn, conventions, các quyết định kiến trúc, thậm chí những lỗi đã debug xong. Kết quả: mỗi sáng bạn lại mất 5-10 phút giải thích lại context, rồi mới bắt đầu làm việc thật sự.
Người viết thread đã track một tuần và đếm ra con số: 47 phút/ngày lãng phí cho việc lặp lại context. Nhân 250 ngày làm việc/năm là gần 200 giờ - tương đương 5 tuần toàn thời gian.
Solution không phải là viết CLAUDE.md tốt hơn. Solution là build thêm cả một infrastructure layer ontop.
Lớp 1 - CLAUDE.md: nền móng của mọi thứ
CLAUDE.md là file Claude Code đọc ở mỗi session start. 90% người dùng bỏ qua hoặc viết sai. Một CLAUDE.md hiệu quả cần có:
Stack cụ thể: framework, ORM, deploy target, monorepo structure
Conventions: naming, return format của API, test file placement, commit style
Architecture decisions với context: "chọn Prisma over Drizzle (Dec 2024): type safety priority" - không chỉ là fact, mà có lý do
Current focus: đang migrate payment system, đang audit performance Dashboard
Rules: "không mass edit hơn 3 files mà không show plan trước", "luôn run tests trước khi viết mới"
CLAUDE.md là static. Nó không tự học, không tự cập nhật. Đó là việc của lớp tiếp theo.
Lớp 2 - Persistent memory: AI nhớ mọi quyết định
Hai công cụ hoạt động cùng nhau để tạo ra memory layer:
claude-mem (thedotmack/claude-mem - 70.600 stars): tự động compress mỗi session và inject context vào session sau. Dùng 3-layer retrieval để tiết kiệm ~10x token: search (50-100 tokens/kết quả) - timeline - get_observations (500-1.000 tokens). Web viewer tại localhost:37777 để xem history.
claude-subconscious (letta-ai/claude-subconscious - 2.700 stars): background agent chạy dưới Claude Code, đọc codebase, build memory theo thời gian, "whisper" guidance trước mỗi prompt qua async hooks. Không bao giờ block workflow. Lưu ý: đây là demo app, Letta khuyến dùng Letta Code (npm install -g @letta-ai/letta-code) cho production.
Kết quả thực tế: mở Claude Code thứ Hai sáng, nó đã biết rằng thứ Sáu bạn đang debug race condition trong payment webhook, bạn đã quyết định switch từ polling sang websockets, và vẫn còn cần update tests.
Lớp 3 - Skills: biến generalist thành chuyên gia
Skills là các markdown file dạy Claude Code cách thực hiện task cụ thể theo cách bạn muốn. Hai skill quan trọng nhất:
Superpowers (obra/superpowers - 175.000 stars): framework phát triển phần mềm đầy đủ, có sẵn trên official Anthropic marketplace. Thay vì jump thẳng vào code, superpowers bắt buộc một workflow: brainstorm - spec - plan - TDD - subagent implementation - code review. Claude có thể làm việc autonomous 2 giờ liên tục mà không lệch khỏi plan.
tdd-guard (nizos/tdd-guard - 2.000 stars): hook chạy trước mỗi Write/Edit operation, block ngay nếu không có failing test. Không chỉ yêu cầu test - còn enforce "minimal implementation", ngăn Claude viết code vượt qua yêu cầu của test hiện tại. V1.6.6, có release 2 giờ trước.
Trail of Bits security skills (trailofbits/skills): dành cho security engineers - audit smart contracts (6 blockchain), YARA rules, static analysis, CVE detection.
Lớp 4 - Subagents: một Claude thành năm chuyên gia
Một Claude Code session chỉ làm được 1 việc tại 1 thời điểm. Context bị nhiễm chéo khi chạy qua nhiều task liên tiếp. Subagents giải quyết điều đó bằng cách tách biệt responsibilities:
Architect: design decisions, viết specs, plan implementations - không bao giờ chạm vào code
Coder: viết code theo plan của Architect, full tool access
Reviewer: đọc mọi PR với security-first mindset, không viết code
Tester: viết và run tests, làm việc với tdd-guard
Ops: deployment, CI/CD, infrastructure monitoring
Muốn có sẵn agent collection: wshobson/agents (34.600 stars) cung cấp 184 specialized agents, 16 orchestrators, 150 skills, 98 commands trong 78 plugins. Dùng chiến lược 3-tier: Opus 4.7 (80.8% SWE-bench, 65% fewer tokens) cho critical work, Haiku 4.5 cho operational tasks.
Lớp 5 - Hooks & automation: tự động hóa mọi việc lặp lại
Bất cứ khi nào bạn bắt đầu gõ cùng một instruction lần thứ 3, đó là slash command cần tạo. Ví dụ:
/fix-issue 456: đọc GitHub issue, tạo branch, viết fix với tests, mở PR - thay thế 10 phút workflow bằng 1 lệnh/review: trigger reviewer agent với security checks + test coverage + code quality scoring/deploy staging: chạy full deployment pipeline qua ops agent
Hooks mạnh hơn: chạy tự động tại các moment cụ thể. Pre-commit hook chạy tdd-guard trước mọi commit. Session start hook load memory, đọc session logs gần nhất, prime context. Pre-push hook chạy security review trước khi code lên remote. Bạn không cần nhắc nhở Claude về rules vì rules tự enforce bản thân.
Lớp 6 - Claude-squad: agents làm việc khi bạn ngủ
claude-squad (smtg-ai/claude-squad - 7.300 stars, AGPL-3.0) là terminal multiplexer xây dựng riêng cho parallel AI agents. Mỗi agent được isolated workspace qua git worktrees - mỗi agent làm việc trên branch riêng, không bao giờ conflict.
brew install smtg-ai/tap/cs
cs # mở TUI
cs -y # auto-accept mode cho trusted tasksWorkflow thực tế: trước khi đi ngủ, mở 3 sessions:
Agent 1: fix tất cả issues labeled 'bug' trong repo
Agent 2: viết missing tests cho /services/
Agent 3: refactor dashboard components dùng design tokens mới
Enable cs -y cho trusted tasks, dùng plan mode cho riskier ones. Đóng laptop. 8 giờ sáng: 3 PRs waiting for review, mỗi PR trên branch riêng, tests passing.
Chi phí toàn bộ stack
Lớp | Tool | Chi phí |
|---|---|---|
Foundation | CLAUDE.md | $0 (chỉ là file) |
Memory | claude-mem + claude-subconscious | $0 (open source) |
Skills | superpowers + tdd-guard | $0 (MIT) |
Subagents | wshobson/agents | $0 (MIT) |
Automation | hooks + slash commands | $0 (open source) |
Orchestration | claude-squad | $0 (AGPL-3.0) |
Subscription | Claude Code Pro | $20/tháng |
Infrastructure cost: $0. Chi phí duy nhất là subscription Claude Code. ROI: 47 phút/ngày * 250 ngày = 196 giờ/năm được giải phóng. Chưa tính việc agents làm việc ban đêm trong khi bạn ngủ.
Bắt đầu từ đâu
Không cần build cả 6 lớp ngay hôm nay. Stack này mất 3 tháng để hình thành - nhưng bạn có thể có nền móng trong một buổi chiều:
Viết CLAUDE.md đúng cách: stack, conventions, architecture decisions, current focus, rules. 30 phút, impact ngay lập tức.
Cài superpowers:
/plugin install superpowerstrên official Anthropic marketplace. Biến Claude thành project manager tự động.Cài claude-squad:
brew install smtg-ai/tap/cs. Bắt đầu chạy parallel agents tối nay.Thêm memory và hooks trong tuần tiếp theo khi bạn thấy rõ gap.
Nguồn tham khảo: obra/superpowers, smtg-ai/claude-squad, thedotmack/claude-mem, nizos/tdd-guard, wshobson/agents. Via: @regent0x




