Claude Code

Đọc bài về Claude Code trên Medium

Best practices

  • Most effective workflows: Effective Workflows

  • Sử dụng custom splash commands

  • More Context = Better performance

    • CLAUDE.md
      • Thường xuyên update thêm vào file này (tăng tính customize)
      • Có thể sử dụng các từ như YOU MUST hoặc IMPORTANT để force Claude run
    • Slash commands
      • create-release-pr.md
      • fix-github-issue.md
      • get-feedback.md - Nói Claude đưa feedback cho 1 plan nào đó.
      • label-github-issues.md
      • lint.md
    • At-mentioning filenames
    • MCP resources
  • Khi chia nhỏ prompt thành các prompts nhỏ hơn, chú ý guide AI để tách thành “testable and committable state.”

  • Message queueing - Cứ gõ 1 loạt prompt vào, kể cả trong lúc Claude Code đang chạy. Nó sẽ tự hiểu thêm như live chating

Resources:

## 📝 Plan & Review Guide

### ✅ Before Starting Work

- Always begin in **plan mode** to create a clear implementation plan.
- Once you have the plan, **save it to**:  
  `.claude/tasks/TASK_NAME.md`
- The plan should include:
  - A **detailed breakdown** of the implementation
  - The **reasoning** behind design choices
  - Clearly defined and **organized tasks**

- If the task involves **external tools or libraries**, research the latest best practices and APIs  
  > 💡 Use the **Task tool** for this purpose

- Avoid over-planning — always aim for **MVP (Minimum Viable Product)** thinking.
- After writing the plan, **submit it for review** before starting implementation.  
  > ❗ **Do not continue** until the plan is reviewed and approved.

---

### 🛠 While Implementing

- **Continuously update** the plan file as work progresses.
- Once a task is completed:
  - **Append a detailed summary** of the changes you made
  - Document any new decisions or deviations
  - Make it easy for other engineers to **pick up where you left off**

> 🧠 The goal is to keep your work transparent, traceable, and easily hand-offable.

Shortcuts

  • Command + Option + K - Add selected to context
  • Control + V - Paste ảnh

Coursera

Notes

Guide AI Labor, coi nó như một member trong team bạn, và bạn là Leader. Không micromanaged, khai mở để cho nó có thể sáng tạo.

Cách đặt câu hỏi đúng/ guide đúng sẽ hơn nhiều so với “mệnh lệnh”.

  • Use VS Code extension

  • Sử dụng /clear khi muốn đổi Tiết kiệm được token trong đoạn chat

  • claude --dangerously-skip-permissions

  • Không cần micro manage AI

# Bad
I would like you to create component/xxx.tsx and create function to display and store data

# Good
Act like a typical user of this application, then create different ways of sorting, filtering and displaying the expenses that are incredibly powerful and userful.

Zoom out, đóng vai là một ông manager thay vì là coder tránh micromanaged

Act as customer or user of this application

Nhược điểm của việc sử dụng prompt: “create …”

  • You are becoming the controller & the bottleneck of software engineering lifecycle here AI sẽ liên tục phải confirm lại xem nên làm thế nào.

The Power of Big Prompts

What you just experienced is fundamentally different from traditional coding:

  1. Vision-Level Instructions: Instead of writing code, you described your vision
  2. Complete Implementation: Claude built an entire application, not just pieces
  3. Holistic Approach: It considered architecture, design, and user experience together
  4. Professional Quality: The result should be production-ready code

AI as Labor, Not Just a Tool

This demonstrates the core concept from the course:

  • Traditional approach: “Write me a function to calculate totals”
  • AI Labor approach: “Build me a complete expense tracking application”

Coi AI là một nhân viên của mình, và mình là leader của nó. Prompt theo cách mà cho phép AI có thể scale được khả năng, thay vì ép nó làm theo ý mình.

# Bad
In expense_list.tsx, add a function to sort the list of expenses by time. At the end of the function, it should update the state of the expense list.

# Good
Look at the list of expenses, how could you make it incredibly bold, beautiful, and modern? Blow my mind with the elegance, simplicity, and beauty of your user interface design changes.

or

The user interface isn't consistent, could you make everything match the style of the list of expenses?

or

When I am trying to prepare my small business taxes, I find it really hard to gather all of the relevant expense. Create something amazing to solve that problem for me.

We want to use the scalability, speed, and ego-less nature of AI Labor to do more than before at a higher level of quality.

Surprise me with your creativity.
  • Cách phát triển phần mềm thay đổi:
    • Dev chuyển từ “viết code” sang “đánh giá, đinh hướng, chọn lựa và sáng tạo”
    • Trước không có effort để thử các cách làm mới. Giờ AI code nhanh nên ta có thể thoải mái thử.
    • Thử - Sai - Học: AI nó là Egoless Bảo thử các phương án dễ hơn nhiều =))
    • Đánh giá được 1 loạt các ý tưởng, rồi chọn hướng tối ưu.
    • Đừng chỉ giải một bài toán rồi đi tiếp. Hãy coi AI như một ‘bài toán tìm kiếm’. Cho nó giải nhiều cách, bạn là người đánh giá, chọn lọc và kết hợp kết quả.

Best of N - Thử N cách và chọn cách tốt nhất.

AI Code Evaluation

Traditional vs. AI Development Evaluation

Traditional Development:

  • Evaluate one solution against theoretical alternatives
  • Make decisions based on experience and intuition
  • Limited ability to test different approaches
  • High cost to change direction

AI Development:

  • Evaluate multiple working implementations
  • Compare real code, not theoretical approaches
  • Test actual user experiences side-by-side

Creating a custom evaluation template ensures that every Best-of-N comparison focuses on what’s actually important to you. Think about what really matters for your projects and create a file called my-evaluation-template.md. Then, tell it to read and apply that evaluation next time you have it implement multiple versions of a feature.

AI Labor understands design principles: Extensibility, Modularity, Reusability, …

  • Vấn đề ở cách chúng ta prompting, hãy tìm cách tạo template, nói với AI cách chúng “nên code” như thế nào, cách chúng ta đánh giá chất lượng code của chúng dựa trên cái gì. (SOLID, OOP, DRP, … )

  • Chat, Craft, Scale