Borrowing it
Nothing to install: this file belongs to androidZzT/cc-statistics. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/androidZzT/cc-statistics/main/AGENTS.mdgit clone --depth 1 https://github.com/androidZzT/cc-statisticsWrote 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.
[](https://agentmods.dev/instructions/androidzzt/cc-statistics/agents-md)<a href="https://agentmods.dev/instructions/androidzzt/cc-statistics/agents-md"><img src="https://agentmods.dev/badge/instructions/androidzzt/cc-statistics/agents-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.
<a href="https://agentmods.dev/instructions/androidzzt/cc-statistics/agents-md"><img src="https://agentmods.dev/badge/instructions/androidzzt/cc-statistics/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00911 | $0.00911 |
| Opus 5.5 | $0.00364 | $0.00364 |
| Sonnet 5.5 | $0.00182 | $0.00182 |
| Haiku 4.5 | $0.00091 | $0.00091 |
Grade A, and why
cc-statistics AGENTS.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 27d 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.
What it actually says
AGENTS.md
This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
Project
cc-statistics — CLI 工具,用于统计 Codex 会话的 AI Coding 工程指标。
数据源:~/.Codex/projects/ 下的 JSONL 会话文件。
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
cc-stats --list # 列出所有项目
cc-stats # 分析当前目录项目
cc-stats <project-keyword> # 按关键词匹配项目
cc-stats <path/to/file.jsonl> # 分析指定 JSONL
cc-stats --all # 分析所有项目
cc-stats --last N # 只看最近 N 个会话
Architecture
cc_stats/parser.py— 解析 JSONL 为 Session/Message 数据结构cc_stats/analyzer.py— 从 Session 计算 5 项工程指标(指令数、工具调用、时长、代码行数、token)cc_stats/formatter.py— 将统计结果格式化为终端表格输出cc_stats/cli.py— argparse CLI 入口,负责文件发现和参数处理
Key conventions
- 纯 Python stdlib,无第三方依赖
- 用户消息判定:
type == "user"且is_tool_result == False且is_meta == False - 活跃时间:消息间隔 ≤ 5 分钟视为活跃
- 代码行数来自 Edit/Write 工具调用的 input 参数
Code Review 规范
所有代码变更(包括社区 PR)在合并前必须通过以下安全和性能检查。
安全检查清单
- Shell/Script 注入防护:所有拼接到 AppleScript、shell command、osascript 的字符串必须转义(反斜杠、双引号等特殊字符)。禁止直接字符串插值到脚本模板中
- 外部输入不可信:文件名、项目名、路径等来自用户或文件系统的值,不可直接拼入命令或脚本。必须经过清洗或转义
- JSONL 解析防御:解析外部 JSONL 文件时,对缺失字段、类型不匹配、格式异常做防御性处理,不可因单条脏数据导致整体崩溃
- 无硬编码敏感信息:代码中不包含 API key、token、密码等敏感信息
性能检查清单
- 禁止循环中同步子进程:不可在 for 循环内调用
Process()/subprocess等同步外部命令。如需批量执行,使用批处理或异步方式 - 时间复杂度评估:对遍历全量 sessions/messages 的逻辑,评估时间复杂度。避免 O(N²) 或更高复杂度的嵌套循环;优先使用单次遍历 + 分桶/索引
- IO 密集操作需异步或缓存:磁盘读取、文件遍历等 IO 操作应考虑缓存策略,避免重复读取。大量文件操作应在后台线程执行
- 避免不必要的全量重算:筛选条件变更时,如果数据源未变,应复用缓存而非重新加载
PR Review 流程
- 自动检查:PR 提交后,CI 必须通过编译检查
- 安全审查:涉及字符串拼接、外部输入处理、命令执行的变更,必须逐行确认转义和清洗
- 性能审查:涉及数据遍历、子进程调用、IO 操作的变更,必须评估大数据量下的表现
- 社区 PR 额外要求:社区贡献者的 PR 需项目维护者 approve 后方可合并,重点关注安全和性能两项
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.
- 27d ago First seen · 68 lines · 911 tokens per session scan A 46e4d5a876e3
cc-statistics AGENTS.md is an instructions file published in the GitHub repository androidZzT/cc-statistics (118 stars, last pushed 7d ago), licensed MIT. It adds 911 tokens to every session, about $0.0036 per session on Opus 5.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-10-01.
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).
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.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
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.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.