Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

repo_conventions injects AGENTS.md and CLAUDE.md as two blocks — identical content is paid twice when CLAUDE.md is a symlink/copy of AGENTS.md

Đang mở Phù hợp với người mới
#12,503 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@tachytelicdetonation đang làm issue này rồi.

Từ ngày 18/9/2026.

  • #12475 của @tachytelicdetonation — đang mở
  • #12728 của @macodev00 — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
ai

Hướng nghiên cứu

Bắt đầu từ trường hợp repo_conventions trong trình tạo chính sách tạo văn bản và kiểm tra các lệnh gọi readRepositoryInstructions của nó đối với AGENTS.md và CLAUDE.md. Tái hiện vấn đề với CLAUDE.md dưới dạng symlink hoặc bản sao giống hệt, sau đó xác minh rằng prompt quy ước được tạo chỉ chứa nội dung dùng chung một lần.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

accepted bug via-triage

Summary

When generating commit messages / change-request descriptions, the repo_conventions text-generation policy appends the repository's AGENTS.md and CLAUDE.md as two separate blocks. A very common convention (recommended in the agents.md ecosystem and by Claude Code docs) is to keep CLAUDE.md as a symlink to (or byte-identical copy of) AGENTS.md. In that setup the same content is included twice in every such prompt — in our repo that is ~38k chars ≈ ~10k tokens, so ~20k tokens per generation for zero new information.

Where

Observed in the installed macOS app, T3 Code (Alpha) 0.0.42, app.asar (minified; the repo_conventions case of the text-generation policy builder):

case "repo_conventions": {
  const subjects = yield* readRecentCommitSubjects(cwd);
  const agentInstructions = yield* readRepositoryInstructions(cwd, "AGENTS.md");
  const claudeInstructions = settings.modelSelection.instanceId === "claudeAgent"
    || (yield* providerRegistry.getProviders).some((provider) =>
         provider.instanceId === settings.modelSelection.instanceId
         && provider.driver === "claudeAgent")
    ? yield* readRepositoryInstructions(cwd, "CLAUDE.md") : "";
  const examples = [
    ...subjects.length > 0 ? [["Recent commit subjects from this repository:", ...subjects].join("\n")] : [],
    ...agentInstructions ? [`Local AGENTS.md:\n${agentInstructions}`] : [],
    ...claudeInstructions ? [`Local CLAUDE.md:\n${claudeInstructions}`] : []
  ].join("\n\n");
  ...
}

readRepositoryInstructions reads through the symlink, so claudeInstructions ends up byte-identical to agentInstructions.

Repro

  1. Repo with a large AGENTS.md and CLAUDE.md -> AGENTS.md (symlink), Claude driver.
  2. Trigger commit-message / change-request generation.
  3. The conventions prompt contains Local AGENTS.md: and Local CLAUDE.md: blocks with the same content.

Proposed fix

Dedup by content after reading — cheapest form is a one-line guard:

...claudeInstructions && claudeInstructions !== agentInstructions
  ? [`Local CLAUDE.md:\n${claudeInstructions}`] : []

(String equality covers symlinks, hardlinks and manual copies alike; a content hash works too if the strings are large. Resolving symlinks alone would miss the copy case.)

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
2 giờ 58 phút
Pull request đã merge (30 ngày)
480

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.