bili-rust CLAUDE.md

bili-rust CLAUDE.md is an instructions file for coding agents from chanmaoganda/bili-rust. It costs 1,927 tokens per session, scanned A, original, MIT.

Repository instructions for bili-rust, a desktop Bilibili app with a Rust backend and a Leptos WebAssembly interface. They document the project structure, Bilibili API reference, development commands, and build options.

In plain words
What is it for?
Use them when developing the app, adding Bilibili API methods, running it locally, creating release builds, or building Linux and Windows packages.
Why use it?
They give a coding agent the project-specific context needed to make changes consistently in a multi-part Rust and frontend codebase.

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/chanmaoganda/bili-rust/claude-md
Clone the repo
git clone --depth 1 https://github.com/chanmaoganda/bili-rust

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 bili-rust CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/chanmaoganda/bili-rust/claude-md.svg)](https://agentmods.dev/instructions/chanmaoganda/bili-rust/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/chanmaoganda/bili-rust/claude-md"><img src="https://agentmods.dev/badge/instructions/chanmaoganda/bili-rust/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,927 This file is loaded in full into every session.
When invoked 1,927 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.01927 $0.01927
Opus 5 $0.00963 $0.00963
Sonnet 5 $0.00385 $0.00385
Haiku 4.5 $0.00193 $0.00193

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

Security

Grade A, and why

bili-rust 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 5d 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 · 73 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

Tauri 2 desktop Bilibili client. Cargo workspace with two members:

  • src-tauri/ — Rust backend (Tauri host process, Bilibili API client)
  • ui/ — Leptos 0.8 + WASM frontend, built by Trunk

The release profile in the workspace Cargo.toml uses lto = true, codegen-units = 1, strip = true — first release build is slow, subsequent ones are cached.

Reference

Commands

Task Command
Dev (hot-reload UI + backend) cargo tauri dev
Release build (binary + bundles) cargo tauri build
Release binary, no installers cargo tauri build --no-bundle
Linux installers + binary tarball (deb/rpm → dist/) ./scripts/linux.sh
Cross-build Windows NSIS installer from Linux (→ dist/) ./scripts/windows.sh (needs mingw-w64-gcc + nsis)
UI alone (WASM → ui/dist/) cd ui && trunk build --release
UI dev server only cd ui && trunk serve --port 1420
Backend type-check cargo check -p bili-rust (or cd src-tauri && cargo check)
Live integration smoke test cargo test --test smoke -- --ignored --nocapture (requires valid cookies.json)
Refresh login cookies Launch the app and visit /login — the in-app QR flow writes cookies.json

cargo tauri dev/build auto-runs the Trunk step via tauri.conf.json's beforeDevCommand/beforeBuildCommand — don't run Trunk separately unless iterating on the UI in isolation.

Prereqs: rustup target add wasm32-unknown-unknown, cargo install trunk tauri-cli@^2.

Architecture

Backend (src-tauri/src/)

  • lib.rsrun() is the Tauri entry point. Loads cookies.json once at startup, builds an Arc<Bili> HTTP client, registers the bilistream:// and biliimg:// URI scheme handlers, and exposes commands.
  • api.rsBili struct wraps a singleton reqwest::Client + cookie jar. WBI keys cached in Arc<RwLock<Option<(WbiKeys, Instant)>>> with a 1-hour TTL. Shared to commands via Tauri State<Arc<Bili>>.
  • commands.rs#[tauri::command]s grouped by purpose: read (get_user_info, get_rcmd, get_related, get_play_info, get_view_info, get_danmaku, get_comments, get_action_state), write (like_video, coin_video, triple_video, follow_user, feed_dislike), and diagnostics (get_decoder_probe). All return Result<_, String> (errors stringified at the Tauri boundary). Register new commands in lib.rs's invoke_handler!.
  • wbi.rs — Bilibili WBI signature scheme (mixin-key permutation + wts/w_rid). Most endpoints reject unsigned requests with HTTP 412 — always sign via Bili's helpers, don't hand-build query strings.
  • stream.rs — Async URI scheme handler. Rewrites HTTPS DASH segment URLs to bilistream://seg/<base64> and image URLs to biliimg://img/<base64> so the frontend can embed them without CSP violations. The handler proxies the actual HTTPS fetch through Bili so Bilibili CDN's Referer/Origin requirements are met.
  • cookies.rs — Reads cookies.json at startup (path overridable via BILI_COOKIES). The in-app QR flow (commands::qr_login_pollBili::replace_cookies) writes cookies.json and swaps the in-memory session atomically, so re-login does not require an app restart.
  • danmaku.rs — Parses Bilibili's list.so XML response, auto-detecting raw deflate vs. pre-inflated payloads.

Read the full file on GitHub · 73 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. 5d ago First seen · 73 lines · 1,927 tokens per session scan A 4cc1d7c3c42e

Subscribe to this mod's changes

bili-rust CLAUDE.md is an instructions file published in the GitHub repository chanmaoganda/bili-rust (11 stars, last pushed 4mo ago), licensed MIT. It adds 1,927 tokens to every session, about $0.0096 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-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,733 tokens