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.
# PowerShell
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://claude.gateway.delfi.vn", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-gw-token-cua-ban", "User")
# Close all PowerShell/CMD/Windows Terminal/VS Code windows, then open a new terminal.
$env:ANTHROPIC_BASE_URL
$env:ANTHROPIC_AUTH_TOKEN
claude
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, ưu tiên biến môi trường User. Nếu dùng file cấu hình, đặt tại C:\Users\<ten>\.claude\settings.json. Sau khi đổi cấu hình, đóng toàn bộ terminal/VS Code rồi mở lại.
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.
# PowerShell: install prerequisites for native Windows
winget install --id Git.Git -e
winget install --id OpenJS.NodeJS.LTS -e
# Tell Claude Code where Git Bash is, then restart terminal / VS Code
[Environment]::SetEnvironmentVariable("CLAUDE_CODE_GIT_BASH_PATH", "C:\Program Files\Git\bin\bash.exe", "User")
# Git Bash: install CodeGraph
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
codegraph install
cd <project>
codegraph init
# Git Bash: install RTK
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"
rtk --version
rtk init -g
rtk gain
# PowerShell or Git Bash: install Caveman plugin
claude plugin marketplace add JuliusBrussee/caveman
claude plugin install caveman@caveman
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
Trên Windows native, hãy cài Git for Windows để Claude Code dùng Bash tool; RTK hook tốt nhất khi command chạy qua Bash. Nếu Claude Code đang dùng PowerShell tool, yêu cầu dùng Bash + RTK hoặc chạy trong Git Bash/WSL.
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.
# Git Bash inside your project
cd /c/path/to/project
rtk git status
rtk grep "Route::" .
rtk read routes/web.php
# In Claude Code prompt:
Dung Bash + RTK de inspect repo. Chay git status, tim "Route::" va doc routes/web.php bang rtk. Tra loi ngan: cac route chinh la gi?
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. |