Skip to content

Throttle auto-update and remove duplicate fetch logic#120

Open
kbrock wants to merge 2 commits intoericbuess:mainfrom
kbrock:refactor-auto-update
Open

Throttle auto-update and remove duplicate fetch logic#120
kbrock wants to merge 2 commits intoericbuess:mainfrom
kbrock:refactor-auto-update

Conversation

@kbrock
Copy link
Copy Markdown

@kbrock kbrock commented Apr 4, 2026

Thank you for the great project

Summary

  • Add 3-hour throttle to auto_update() — matches the GitHub Actions update cadence
  • Replace duplicated inline fetch/pull in read_doc() with auto_update() call
  • /docs -t bypasses the throttle for explicit freshness checks
  • Installer removes the no-op PreToolUse hook instead of reinstalling it
  • hook-check case arm kept for backward compatibility

Reasoning

  • Decided to keep this check on /docs so we would only run if you are actively using the docs command.
  • If you don't use the docs command, it will not hit the server every 3 hours.
  • Since the docs repo job is every 3 hours, and we check every 3 hours, theoretically, the delay could be up to 6 hours. But there is always /docs -t when you update claude.exe
  • This only loads docs 1 time across all Claude shells.
  • I had trouble testing since it wanted to blow my code away from your repo.
  • Would be nice to only update the docs after Claude is updated, or on a restart.

Test plan

  • Run /docs hooks — should read instantly, fetch at most once per 3 hours
  • Run /docs -t — should always fetch
  • Run installer — should remove existing hook, not add a new one

kbrock and others added 2 commits April 3, 2026 21:52
- Add 3-hour throttle to auto_update() so docs fetch at most once per
  3 hours, matching the GitHub Actions update cadence
- Replace duplicated inline fetch/pull in read_doc() with auto_update() call
- Remove no-op PreToolUse hook from installer (auto_update handles freshness)
- Keep hook-check case arm for backward compatibility with existing installs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The -t flag means "check freshness" so it should always fetch,
bypassing the 3-hour throttle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant