SJTU_CLI: Instructions file for Claude Code

CLAUDE.md

SJTU_CLI CLAUDE.md is an instructions file for Claude Code from wuyutanhongyuxin-cell/SJTU_CLI. It costs 6,380 tokens per session, scanned A, original, MIT.

A project guide for SJTU-CLI, a Rust terminal program for students and staff at Shanghai Jiao Tong University. It describes how the tool logs in and retrieves timetables, grades, campus-card data, notices, and Canvas information.

In plain words
What is it for?
Building, testing, formatting, and extending a university-services command-line client, including login, browser automation, web requests, and structured output.
Why use it?
It gives coding agents the project’s technology choices, data formats, testing rules, and command structure in one place. This helps them make changes that fit the existing Rust application.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

This is wuyutanhongyuxin-cell/SJTU_CLI's own configuration. It tells Claude Code how to work on SJTU_CLI itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything SJTU_CLI configures →

Reuse

Borrowing it

Nothing to install: this file belongs to wuyutanhongyuxin-cell/SJTU_CLI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/wuyutanhongyuxin-cell/SJTU_CLI/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/wuyutanhongyuxin-cell/SJTU_CLI

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 SJTU_CLI CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wuyutanhongyuxin-cell/sjtu_cli/claude-md/github.svg)](https://agentmods.dev/instructions/wuyutanhongyuxin-cell/sjtu_cli/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/wuyutanhongyuxin-cell/sjtu_cli/claude-md"><img src="https://agentmods.dev/badge/instructions/wuyutanhongyuxin-cell/sjtu_cli/claude-md/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 SJTU_CLI CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/wuyutanhongyuxin-cell/sjtu_cli/claude-md"><img src="https://agentmods.dev/badge/instructions/wuyutanhongyuxin-cell/sjtu_cli/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,380 This file is loaded in full into every session.
When invoked 6,380 The same file — it is already loaded in full.
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.06380 $0.06380
Opus 5 $0.03190 $0.03190
Sonnet 5 $0.01276 $0.01276
Haiku 4.5 $0.00638 $0.00638

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

Security

Grade A, and why

SJTU_CLI 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 11d 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 · 347 lines

How it starts

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

CLAUDE.md — SJTU-CLI 项目规范

本文件是 SJTU-CLI 项目的 Claude Code 指令,基于"通用 AI 编程规范"填充项目专属区域。 Claude Code 每次启动自动读取。


[项目专属区域]

项目名称

SJTU-CLI —— 上海交通大学"交我办"命令行工具

一句话描述

给 SJTU 师生用的终端 CLI,通过 JAccount 扫码登录后,一行命令查课表 / 成绩 / 一卡通 / 通知 / Canvas,输出支持 YAML/JSON,方便 AI Agent 调用。

技术栈(Rust 实现)

  • 语言:Rust(stable, edition 2021)
  • 包管理 / 构建:cargo
  • CLI 框架:clap 4(derive API)
  • HTTP 客户端:reqwest(features: cookies / json / rustls-tls / gzip
  • 异步运行时:tokio(rt-multi-thread + macros
  • 浏览器自动化:headless_chrome(纯 Rust CDP 驱动)
  • Cookie 提取兜底:rookie(browser-cookie3 的 Rust 等价)
  • HTML 解析:scraper(html5ever)
  • QR 终端显示:qrcode + ANSI 色块
  • 序列化:serde + serde_json + serde_yml + toml
  • 表格 / 颜色:comfy-table + owo-colors
  • TTY 检测:is-terminal
  • 时间:chrono(含 serde feature)
  • 路径:directories(跨平台 ~/.sjtu-cli/ 定位)
  • 金额:rust_decimal(一卡通消费金额,禁用 f64)
  • 错误:anyhow(bin 层)+ thiserror(lib 层)
  • 日志:tracing + tracing-subscriber
  • 测试:内置 #[test] + tokio-test + mockito
  • Lint:cargo clippy + cargo fmt
  • CI:GitHub Actions(stable × windows / ubuntu / macos)

项目结构

sjtu-cli/
├── Cargo.toml                       # 依赖 + 构建配置
├── Cargo.lock
├── rust-toolchain.toml              # 固定 stable
├── README.md
├── SKILL.md                         # AI Agent 使用指南
├── SCHEMA.md                        # 输出信封契约
├── CLAUDE.md                        # 本文件
├── .env.example
├── config.example.toml
├── src/
│   ├── main.rs                      # 二进制入口,调用 cli::run
│   ├── lib.rs                       # 模块 re-export;VERSION 常量
│   ├── cli.rs                       # clap 命令枚举 + 派发
│   ├── config.rs                    # ~/.sjtu-cli/ 路径管理
│   ├── cookies/                     # Cookie 模型 + 文件 I/O(S2 瑕疵修复时拆分)
│   │   ├── mod.rs                   # Cookie / Session struct + redacted 三元组键
│   │   ├── io.rs                   # load / save / clear(主 + 子 session)
│   │   └── tests.rs                 # redacted + path 防覆盖单测
│   ├── error.rs                     # thiserror 统一异常
│   ├── output.rs                    # Envelope + TTY 检测 + YAML/JSON/Table 切换
│   ├── auth/                        # 登录模块
│   │   ├── mod.rs
│   │   ├── qr_login.rs              # ★ headless_chrome QR 扫码
│   │   ├── qr_render.rs             # 终端 ANSI QR 重绘
│   │   ├── browser_extract.rs       # rookie cookie 兜底
│   │   └── cas/                     # 子系统 CAS 跳转(S2 拆分)
│   │       ├── mod.rs               # cas_login + follow_redirect_chain
│   │       ├── client.rs            # 注入主 session 构造 reqwest Client
│   │       └── tests.rs             # mockito 跳转链单测
│   ├── apps/                        # 每个子系统一个文件
│   │   ├── mod.rs
│   │   ├── jwc.rs                   # 教务(课表/成绩)
│   │   ├── library/                 # 图书馆借阅(weijieyue.lib.sjtu.edu.cn:8080)
│   │   │   ├── mod.rs
│   │   │   ├── client.rs            # OAuth dance + Client + 3 业务方法
│   │   │   ├── http.rs              # cookie 注入 + fetch_json
│   │   │   ├── models.rs            # Loan / HistoryRow / Fine serde struct
│   │   │   ├── throttle.rs          # 300ms 节流
│   │   │   └── tests_parse.rs       # fixture + mockito e2e
│   │   ├── mail/                    # 邮箱(mail.sjtu.edu.cn Zimbra SOAP)
│   │   │   ├── mod.rs               # re-export + MailClient 入口
│   │   │   ├── client.rs            # SSO 跟链 + ZM_AUTH_TOKEN + 4 只读方法
│   │   │   ├── http.rs              # build_client + SOAP POST + token 抽取
│   │   │   ├── soap.rs              # SOAP envelope builder(只读 4 类,红线注入 read=0)
│   │   │   ├── parser.rs            # quick-xml 流式解析 SearchResponse / GetMsgResponse
│   │   │   ├── extract.rs           # ZM_AUTH_TOKEN 从 Set-Cookie / SOAP body 提取
│   │   │   ├── models.rs            # Mail / MailFull / Address struct
│   │   │   ├── throttle.rs          # 300ms 节流
│   │   │   └── tests_parse.rs       # fixture parse 单测 + mockito e2e
│   │   ├── card.rs                  # 一卡通
│   │   ├── notifications.rs         # 交我办通知
│   │   └── canvas.rs                # Canvas LMS
│   ├── commands/                    # CLI 子命令实现
│   │   ├── mod.rs
│   │   ├── auth_cmds.rs             # login/logout/status/whoami
│   │   ├── schedule.rs              # schedule/today/week/next
│   │   ├── grades.rs                # grades/gpa
│   │   ├── card.rs                  # card/card history
│   │   ├── library/                 # 图书馆借阅命令
│   │   │   ├── mod.rs
│   │   │   ├── data.rs
│   │   │   └── handlers.rs
│   │   ├── mail/                    # 邮箱命令
│   │   │   ├── mod.rs
│   │   │   ├── data.rs              # MailListData / MailListRow / MailReadData
│   │   │   └── handlers.rs          # cmd_mail_list / cmd_mail_read
│   │   ├── notifications.rs
│   │   └── canvas.rs
│   └── models/                      # struct(derive Serialize/Deserialize)
│       ├── mod.rs
│       ├── course.rs
│       ├── grade.rs
│       ├── card_record.rs
│       └── notification.rs
├── tests/                           # 集成测试
├── tasks/
│   ├── todo.md                      # 任务清单
│   └── lessons.md                   # 经验积累
└── .github/workflows/ci.yml

Read the full file on GitHub · 347 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. 11d ago First seen · 347 lines · 6,380 tokens per session scan A ba61bfb77e3d

Subscribe to this mod's changes

SJTU_CLI CLAUDE.md is an instructions file published in the GitHub repository wuyutanhongyuxin-cell/SJTU_CLI (49 stars, last pushed 3mo ago), licensed MIT. It adds 6,380 tokens to every session, about $0.0319 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.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 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,153 tokens

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

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

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