Claude Gateway Onboarding

Thiết lập Claude Code cho Developer và BA

Kết nối qua gateway, cài bộ tối ưu token, kiểm tra khả năng đọc code/tài liệu, và dùng session history để tiếp tục công việc.

Gateway URL

https://claude.gateway.delfi.vn

Token cá nhân

Thay bằng token sk-gw do admin cấp.

Tiết kiệm token

RTK giảm tool output, Caveman giảm output trả lời.

Session history

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.

1Nhận token

Admin cấp token dạng sk-gw-....

2Cấu hình gateway

Set env hoặc sửa ~/.claude/settings.json.

3Cài tối ưu

RTK, CodeGraph, Caveman theo nhu cầu.

4Kiểm tra logs

So sánh In/Out/Cache trên Gateway dashboard.

Shell environment
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
~/.claude/settings.json
{
  "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

CodeGraphĐọc cấu trúc code nhanh hơn

Phù hợp khi hỏi kiến trúc, impact, class/function liên quan.

RTKGiảm tool-output tokens

Hook vào Bash tool. Dùng tốt với git, rg, test logs, file read.

CavemanGiảm output tokens

Ép câu trả lời ngắn hơn. Không giảm input/context/cache.

CodeGraph setup
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
codegraph install
cd <project>
codegraph init
RTK setup
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
Caveman setup
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.

Kiểm tra RTK trong project
cd <project>
rtk git status
rtk grep "Route::" .
rtk read routes/web.php
Prompt inspect repo

Dùng khi bắt đầu task trong repo mới hoặc module lạ.

Prompt
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?
Prompt sửa lỗi

Giữ phạm vi hẹp, bắt Claude đọc đúng file và chạy test cần thiết.

Prompt
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.

Prompt phân tích nghiệp vụ
Prompt BA
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.
Prompt tạo checklist UAT
Prompt UAT
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ầuPrompt nên dùngKết quả mong đợi
Hiểu moduleBA workflow promptActor, luồng, dữ liệu, màn hình
Review featureChecklist UATTest cases theo nhóm
Viết tài liệuYêu cầu output dạng markdown/tableTà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.

Prompt so sánh Caveman
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.
RTK giảm phần nào?

Giảm input do tool output dài được compact trước khi đưa vào context.

Caveman giảm phần nào?

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ỗiNguyên nhânCách xử lý
401 authentication_errorToken sai hoặc user bị khóaKiểm tra ANTHROPIC_AUTH_TOKEN, liên hệ admin
403 model not allowedModel ngoài danh sách gateway cho phépDùng claude --model claude-sonnet-4-6 hoặc đổi model trong /model
/caveman không cóPlugin chưa loadRestart Claude Code/VS Code, cài lại plugin nếu cần
Token lớn nhưng cost thấpCache-read/context lớnXem cột Cache. Gateway mặc định không chặn quota bằng cache-read.