https://claude.gateway.delfi.vn
Thay bằng token sk-gw do admin cấp.
RTK giảm tool output, Caveman giảm output trả lời.
Xem lại chat và copy prompt tiếp tục tại /sessions.
Bắt đầu nhanh
Dùng phần này cho máy đã có Claude Code. Chọn một trong hai cách cấu hình gateway.
Admin cấp token dạng sk-gw-....
Set env hoặc sửa ~/.claude/settings.json.
RTK, CodeGraph, Caveman theo nhu cầu.
So sánh In/Out/Cache trên Gateway dashboard.
export ANTHROPIC_BASE_URL="https://claude.gateway.delfi.vn"
export ANTHROPIC_AUTH_TOKEN="sk-gw-token-cua-ban"
curl -s https://claude.gateway.delfi.vn/health
claude --model claude-sonnet-4-6
{
"env": {
"ANTHROPIC_BASE_URL": "https://claude.gateway.delfi.vn",
"ANTHROPIC_AUTH_TOKEN": "sk-gw-token-cua-ban"
}
}
Trên Windows, dùng biến môi trường User hoặc file C:\Users\<ten>\.claude\settings.json. Sau khi đổi cấu hình, restart Claude Code hoặc VS Code.
Công cụ cần cài
Phù hợp khi hỏi kiến trúc, impact, class/function liên quan.
Hook vào Bash tool. Dùng tốt với git, rg, test logs, file read.
Ép câu trả lời ngắn hơn. Không giảm input/context/cache.
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
codegraph install
cd <project>
codegraph init
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"
rtk --version
rtk init -g
rtk gain
node -v
claude plugin marketplace add JuliusBrussee/caveman
claude plugin install caveman@caveman
# Fallback installer if plugin install fails
curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/main/install.sh | bash
RTK chỉ auto-hook lệnh chạy qua Bash tool. Claude Code built-in Read/Grep/Glob không đi qua RTK, nên hãy yêu cầu dùng Bash + RTK khi cần tiết kiệm token.
Workflow cho Developer
Mục tiêu là đọc code có kiểm soát: hỏi cấu trúc trước, đọc file sau, chạy command qua RTK khi output có thể dài.
cd <project>
rtk git status
rtk grep "Route::" .
rtk read routes/web.php
Dùng khi bắt đầu task trong repo mới hoặc module lạ.
Dung CodeGraph va Bash + RTK truoc. Khong dung Read/Grep built-in neu khong can.
Hay inspect repo nay: chay rtk git status, rtk grep "Route::" . va rtk read routes/web.php.
Tra loi ngan: app nay co cac module chinh nao?
Giữ phạm vi hẹp, bắt Claude đọc đúng file và chạy test cần thiết.
Dung CodeGraph de tim code lien quan truoc. Sau do dung Bash + RTK de doc file/log can thiet. Sua dung pham vi loi, chay test nho nhat co the, bao ro file da doi.
Workflow cho BA
BA không cần đọc toàn bộ source. Hãy yêu cầu Claude chuyển code/tài liệu thành actor, luồng nghiệp vụ, dữ liệu và màn hình liên quan.
Doc repo va tai lieu hien co. Giai thich bang ngon ngu BA:
- Cac actor chinh
- Luong nghiep vu quan trong
- Du lieu nao duoc tao/sua/xoa
- Man hinh nao lien quan
Tra loi ngan, co bullet ro rang.
Tu repo va tai lieu hien co, tao checklist UAT cho module dang xet. Nhom theo happy path, validation, permission, edge cases. Ghi ro du lieu test can tao.
| Nhu cầu | Prompt nên dùng | Kết quả mong đợi |
|---|---|---|
| Hiểu module | BA workflow prompt | Actor, luồng, dữ liệu, màn hình |
| Review feature | Checklist UAT | Test cases theo nhóm |
| Viết tài liệu | Yêu cầu output dạng markdown/table | Tài liệu dễ gửi team |
Test so sánh token
Chạy cùng một câu hỏi trước/sau khi bật RTK hoặc Caveman, sau đó xem Gateway Web GUI phần logs để so sánh IN, OUT, CW, CR.
Lan 1 khong Caveman:
Giai thich module lease/rental cua repo nay, noi ro model, route, component lien quan.
Lan 2 co Caveman:
/caveman lite
Giai thich module lease/rental cua repo nay, noi ro model, route, component lien quan.
Sau do xem Gateway logs de so sanh OUT tokens.
Giảm input do tool output dài được compact trước khi đưa vào context.
Giảm output do Claude trả lời ngắn hơn. Không xử lý cache/context lớn.
Lỗi thường gặp
| Lỗi | Nguyên nhân | Cách xử lý |
|---|---|---|
401 authentication_error | Token sai hoặc user bị khóa | Kiểm tra ANTHROPIC_AUTH_TOKEN, liên hệ admin |
403 model not allowed | Model ngoài danh sách gateway cho phép | Dùng claude --model claude-sonnet-4-6 hoặc đổi model trong /model |
/caveman không có | Plugin chưa load | Restart Claude Code/VS Code, cài lại plugin nếu cần |
| Token lớn nhưng cost thấp | Cache-read/context lớn | Xem cột Cache. Gateway mặc định không chặn quota bằng cache-read. |