r2-web CLAUDE.md

r2-web CLAUDE.md is an instructions file for coding agents from vikiboss/r2-web. It costs 1,653 tokens per session, scanned A, original, MIT.

A Chinese-language guide for R2 Web, a browser-based manager for Cloudflare R2 storage buckets. It describes the project, local startup commands, important files, and common code locations.

In plain words
What is it for?
Starting the site locally, changing uploads, file browsing, image compression, translations, themes, buttons, or Cloudflare R2 operations.
Why use it?
It helps an agent find the right file for a requested change instead of searching the whole project or relying on unfamiliar Chinese documentation.

Instructions file

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.

agentmods
npx agentmods add instructions/vikiboss/r2-web/claude-md
Clone the repo
git clone --depth 1 https://github.com/vikiboss/r2-web

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 r2-web CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/vikiboss/r2-web/claude-md.svg)](https://agentmods.dev/instructions/vikiboss/r2-web/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/vikiboss/r2-web/claude-md"><img src="https://agentmods.dev/badge/instructions/vikiboss/r2-web/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,653 This file is loaded in full into every session.
When invoked 1,653 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01653 $0.01653
Opus 5 $0.00826 $0.00826
Sonnet 5 $0.00331 $0.00331
Haiku 4.5 $0.00165 $0.00165

Measured 4d ago against content hash b479a7f58e4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

r2-web CLAUDE.md 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 4d 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.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

本文档为 Claude Code (claude.ai/code) 提供仓库开发指南。

项目速览

R2 Web — 纯客户端 Cloudflare R2 存储桶文件管理器,零构建、零框架、零后端。

核心特性 文件上传、目录浏览、文件预览、文件操作、图片压缩、PWA、多语言(zh/zh_TW/en/ja)、浅色/深色主题、多选批量操作。

快速启动

npx serve src
# 或
python3 -m http.server 5500 --directory src

代码地图

快速定位表

任务 文件
修改文件名模板逻辑 src/js/utils.jsapplyFilenameTemplate
修改图片压缩逻辑 src/js/upload-manager.jscompressFile
添加 i18n 文案 src/js/i18n.jsconst I18N
修改按钮样式 src/css/components.css.btn
添加设计 Token src/css/tokens.css
修改 R2 API 操作 src/js/r2-client.js
修改文件浏览逻辑 src/js/file-explorer.js
修改上传管理逻辑 src/js/upload-manager.js
多选批量操作逻辑 src/js/file-explorer.jstoggleSelect / selectAll / clearSelection

工具函数列表

以下函数定义在 src/js/utils.js,供各模块导入:

  • t(key, vars) — i18n 翻译(来自 src/js/i18n.js
  • applyFilenameTemplate(tpl, file) — 文件名模板处理,占位符:[name][ext][hash:N][date:FORMAT][timestamp][uuid]/
  • compressFile(file, config, onStatus) — 图片压缩(定义在 upload-manager.js
    • PNG 特殊处理:直接优化缓冲区,不重新编码
    • 自适应逻辑:压缩后更大则使用原文件

项目结构

r2-web/
├── readme.md          — 项目说明、使用指南
├── package.json       — 依赖声明(仅用于类型提示)
├── jsconfig.json      — JSDoc 类型检查配置
└── src/               — 源码目录(即部署目录)
     ├── index.html    — 应用外壳、import map、对话框模板
     ├── main.js       — 入口(仅 new App())
     ├── manifest.json — PWA 配置
     ├── style.css     — 样式主入口(仅导入 css 子目录)
     ├── js/           — 业务逻辑模块
     │    ├── app.js              — 主协调器
     │    ├── config-manager.js   — 配置持久化、Base64 分享
     │    ├── r2-client.js        — S3 API 客户端
     │    ├── ui-manager.js       — 主题、Toast、对话框、Tooltip
     │    ├── file-explorer.js    — 目录导航、排序、分页、缩略图
     │    ├── upload-manager.js   — 上传、文件名模板、图片压缩
     │    ├── file-preview.js     — 图片/视频/音频/文本预览
     │    ├── file-operations.js  — 重命名、复制、移动、删除
     │    ├── i18n.js             — 多语言(zh/zh_TW/en/ja)
     │    ├── constants.js        — 常量
     │    └── utils.js            — 工具函数
     └── css/          — 样式模块(CSS Layers)
          ├── reset.css       — CSS Reset
          ├── tokens.css      — 设计 Token(定义所有变量)
          ├── base.css        — 全局基础样式
          ├── layout.css      — 布局容器
          ├── components.css  — 通用 UI 组件
          ├── utilities.css   — 工具类
          └── animations.css  — 动画与过渡

Read the full file on GitHub · 138 lines

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. 4d ago First seen · 138 lines · 1,653 tokens per session scan A b479a7f58e4f

Subscribe to this mod's changes

r2-web CLAUDE.md is an instructions file published in the GitHub repository vikiboss/r2-web (455 stars, last pushed 2mo ago), licensed MIT. It adds 1,653 tokens to every session, about $0.0083 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-08-30.