code-review-loop

code-review-loop is a skill for Claude Code from zsutxz/ClaudeLearning. It costs 97 tokens per session (983 once invoked), scanned A, original, MIT.

A session-only automation that reviews uncommitted code changes every five minutes while the current coding session is running.

In plain words
What is it for?
It is for starting or stopping a timed review of git diff output and reporting findings by severity without changing the code.
Why use it?
It keeps checking the latest changes for bugs, security issues, and logic errors without requiring repeated manual review.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Good fit It is for starting or stopping a timed review of git diff output and reporting findings by severity without changing the code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zsutxz/claudelearning/code-review-loop
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zsutxz/ClaudeLearning --skill code-review-loop
Clone the repo
git clone --depth 1 https://github.com/zsutxz/ClaudeLearning

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-review-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/zsutxz/claudelearning/code-review-loop/github.svg)](https://agentmods.dev/skills/zsutxz/claudelearning/code-review-loop)
Your own site
<a href="https://agentmods.dev/skills/zsutxz/claudelearning/code-review-loop"><img src="https://agentmods.dev/badge/skills/zsutxz/claudelearning/code-review-loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-review-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/zsutxz/claudelearning/code-review-loop"><img src="https://agentmods.dev/badge/skills/zsutxz/claudelearning/code-review-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 983 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00097 $0.00983
Opus 5 $0.00048 $0.00491
Sonnet 5 $0.00019 $0.00197
Haiku 4.5 $0.00010 $0.00098

Measured 9d ago against content hash 5c33d2fb6d71, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

code-review-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/code-review-loop/SKILL.md · 77 lines

What it actually says

🔁 Code Review Loop — 定时代码审查循环

每 5 分钟审查一次当前的代码变更(git diff),在当前会话期间持续循环。 不持久化:会话结束或进程被杀,循环自动失效,不会跨会话残留。

触发时机

  • 用户说“定时审查代码 / 每 5 分钟审查一次 / 开始审查循环” → 启动
  • 用户说“停止审查 / 停止循环 / 结束审查” → 停止

执行流程

1. 启动循环

调用 CronCreate 创建一个 session-only 定时任务:

参数 说明
cron */5 * * * * 每 5 分钟触发一次
prompt 见下方「每轮审查 prompt」 每次触发时注入对话的指令
recurring true 周期性任务
durable false 关键:不写入 scheduled_tasks.json,进程结束即失效

创建后,向用户回报:

  • ✅ 循环已启动 + 返回的 job ID
  • 停止方式:关闭会话/杀进程即自动停止,或说“停止审查循环”主动停止

2. 每轮审查 prompt

将以下文本原样作为 CronCreateprompt 参数(cron 每次触发时注入对话):

[定时代码审查] 审查当前未提交的代码变更:
1. 先运行 `git status --short` 和 `git diff --stat` 判断是否有变更
2. 无变更 → 只回复“✅ 暂无新变更”,立即结束本轮(不空跑、不编造问题)
3. 有变更 → 运行 `git diff` 取出变更,审查 bug / 安全 / 逻辑错误,按 严重 / 中等 / 轻微 分级,每条格式:`文件:行 — 问题 — 建议`
4. 只审查、不修改代码

3. 停止循环

两种方式(都满足“用户终止即失效”):

  • 被动:关闭会话 / 杀掉 Claude Code 进程 → session-only 任务随之消失(因为 durable: false
  • 主动:调用 CronList 找到本循环的 job ID → CronDelete 删除

核心规则

  • 只读:审查循环绝不修改代码,只报告问题
  • 不空跑:无 diff 时必须立即结束本轮,避免浪费 token
  • durable 必须为 false:否则会落盘并跨会话残留,违反“终止即失效”要求
  • 7 天上限:Claude Code 的周期任务最多跑 7 天会自动过期(硬限制),需要长期运行时重新启动

注意事项

  • 审查范围默认是未提交的变更git status + git diff,含已暂存和未暂存,不含已 commit 的)
  • 触发受 REPL 空闲约束:你正在对话时不会打断,当前一轮结束后才 fire
  • 调整间隔改 cron 字段即可(如 */10 * * * * 为 10 分钟,0 * * * * 为每小时)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 77 lines · 97 tokens per session scan A 5c33d2fb6d71

Subscribe to this mod's changes

code-review-loop is a skill published in the GitHub repository zsutxz/ClaudeLearning (5 stars, last pushed 1mo ago), licensed MIT. It adds 97 tokens to every session and 983 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

review-implement-phase

Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.

prisma/orm · 38 tokens

github-pr-workflow

Prepare a GitHub pull request from a feature branch — branch hygiene, commit shape, title/body, verification notes, screenshots for UI work, and replies to review comments.

paperclipai/paperclip · 39 tokens

github-automation

GitHub workflow automation, PR management, issue tracking, and code review coordination. Integrates with GitHub Actions and repository management. Use when: PR creation, code review, issue management, release automation, workflow setup. Skip when: local-only changes, non-GitHub repositories.

ruvnet/ruflo · 61 tokens

review-delta

Review only changes since last commit using impact analysis. Token-efficient delta review with automatic blast-radius detection.

tirth8205/code-review-graph · 24 tokens

work-unit-commits

Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.

Gentleman-Programming/gentle-ai · 33 tokens

github-contributor

End-to-end playbook for shipping high-quality pull requests to open-source projects you don't maintain — discovery, CONTRIBUTING compliance, PR-size check, minimal-diff implementation, PR description with AI-assisted disclosure, conflict resolution, and post-submission maintainer interaction. Use whenever creating…

daymade/claude-code-skills · 133 tokens