Skip to content
tinAI
Go back

Bug Claude Code: chuỗi `HERMES.md` trong git commit khiến request bị tính extra usage thay vì plan quota

Bài gốc: HERMES.md in git commit messages causes requests to route to extra usage billing instead of plan quota

Tác giả: sasha-id

Ngày đăng: Dịch ngày:

TL;DR

Một developer phát hiện bằng binary search rằng nếu git commit history chứa case-sensitive string `HERMES.md`, Claude Code route API request sang extra usage billing thay vì plan quota — đốt $200 credits trong khi dashboard vẫn hiện 86% capacity. Lỗi nằm ở server-side content-based routing, kích hoạt bởi đúng chuỗi này trong system prompt.

Tóm tắt

Khi git history của một repo chứa case-sensitive string HERMES.md, Claude Code route API request sang “extra usage” billing thay vì plan quota của Max plan. Lỗi này âm thầm đốt $200 extra usage credits của một user trong khi capacity weekly của Max 20x plan vẫn còn ~86%.

Môi trường

Cách reproduce

Reproduction tối thiểu — không cần project file nào:

# FAIL với "out of extra usage" (route sang extra usage billing)
mkdir /tmp/test-fail && cd /tmp/test-fail
git init && echo test > test.txt && git add . && git commit -m "add HERMES.md"
claude -p "say hello" --model "claude-opus-4-6[1m]"
# => API Error: 400 "You're out of extra usage..."

# WORK (route sang plan quota)
mkdir /tmp/test-pass && cd /tmp/test-pass
git init && echo test > test.txt && git add . && git commit -m "add hermes.md"
claude -p "say hello" --model "claude-opus-4-6[1m]"
# => "Hello!"

# Cleanup
rm -rf /tmp/test-fail /tmp/test-pass

Trigger là string HERMES.md trong commit message — không phải sự tồn tại của file tên đó trên disk. Claude Code include recent commit vào system prompt, và một thứ gì đó server-side route request khác đi khi string này có mặt.

Cái gì trigger vs không

Commit messageKết quả
"HERMES.md"Fail — route sang extra usage
"test HERMES.md test"Fail
"hermes.md" (chữ thường)OK
"HERMES" (không extension)OK
"HERMES.txt"OK
"AGENTS.md"OK
"README.md"OK
File HERMES.md trên disk, commit msg sạchOK
Cùng repo, orphan branch (no history)OK

Tác động

Hành vi expected

Billing cho API request không nên phụ thuộc vào nội dung commit message trong system prompt. Mọi request từ Max plan subscriber phải route sang plan quota trước.

Cách tìm ra

Binary search có hệ thống: clone affected repo, test orphan branch, sau đó cô lập từng commit message string đến khi HERMES.md được xác định là trigger chính xác.

Dev nên quan tâm vì

Nếu repo bạn đang làm có liên quan đến file tên HERMES.md hoặc commit history chứa chuỗi này, kiểm tra usage Anthropic ngay — bạn có thể đã bị bill nhầm. Vấn đề rộng hơn: API routing không nên dựa vào content match server-side mà không log lý do — đây là class bug khó debug và làm xói mòn niềm tin vào billing.


Read Original (EN) Quay lại Newsletter