Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

rate-limit-guard: detect an account switch and tell the model the new account's limits

未关闭
#6,445 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
shell

调研方向

Start from the rate-limit-guard plugin and how it records usage for a session (the prompt.submit hook context described in the issue). Read current Claude Code docs for auth/status/usage signals and which hook fires after a switch; also read docs/conventions/hook-precision for the stay-quiet test. Done means a switch notice with the new account's limits on the next turn, no old windows after the switch, and no notice when the account is unchanged.

由索引模型根据 Issue 内容生成。

描述

needs-human needs-triage

Problem

When the operator rotates to another Claude account mid-session, the model keeps acting on the
previous account's usage limits. rate-limit-guard's notices still report the old account's
windows, and nothing tells the model the account changed, so it throttles fan-out, defers work
"until the reset", or suggests handoffs that the new account does not need.

Observed 2026-10-05 in a session on feat/upstream-docs-cache (PR #6348): after the operator
switched accounts, the prompt.submit hook context still said "rate-limit-guard: 7-day window at
or above 90%, resets at 2026-10-07 03:00 UTC", and the session planned around that reset until the
operator corrected it by hand.

Ask

  1. Detect an account switch: the signed-in account identity (or organization) differs from the one
    the guard last recorded for this session or machine.
  2. On a switch, invalidate the cached usage snapshot and re-read the limits for the new account.
  3. Inject one notice into the session on the next turn, for example: "Account switched to
    ; current limits: 5-hour window N%, 7-day window N%, resets at ...; earlier limit
    notices in this session no longer apply."
  4. Stop emitting the previous account's numbers once the switch is seen.

Open questions

  • Which signal identifies the account reliably and locally (the auth state Claude Code exposes to
    hooks or mods, a status payload, the usage endpoint's response)? Needs a check against current
    Claude Code docs before design.
  • Which hook or mod event fires early enough after a switch (UserPromptSubmit, a status-line tick,
    SessionStart on resume)?
  • Should context-guard take the same notice, so the model can tell a context-size warning from a
    usage warning?

Acceptance

  • After an account switch, the next model turn carries a notice naming the switch and the new
    account's current limits.
  • No notice after the switch reports the old account's windows.
  • A stay-quiet test: no switch notice when the account is unchanged
    (docs/conventions/hook-precision).
主要语言
Shell
星标
22
派生
2
平均合并
8 小时 25 分钟
30 天内合并 PR
944

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

melodic-software/claude-code-plugins 的其他 Issue

查看 melodic-software/claude-code-plugins 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。