PrivacySentry CLAUDE.md

PrivacySentry CLAUDE.md is an instructions file for coding agents from allenymt/PrivacySentry. It costs 1,561 tokens per session, scanned A, original, MIT.

Project instructions for PrivacySentry, an Android tool that checks privacy compliance by intercepting sensitive API calls during app building and runtime. It describes the project's architecture and key components.

In plain words
What is it for?
Use it when working on PrivacySentry's Gradle plugin, annotations, runtime hooks, proxy implementations, caching, or log collection.
Why use it?
It gives a coding agent the context needed to understand how PrivacySentry detects and logs sensitive operations.

Instructions file

About the project

PrivacySentry is an Android build-time privacy compliance tool that modifies application bytecode to detect calls to sensitive APIs and records the results. Android developers can use it to inspect privacy-related API usage and generate reports for application review.

allenymt/PrivacySentry · 2,290 stars · on GitHub

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/allenymt/privacysentry/claude-md
Clone the repo
git clone --depth 1 https://github.com/allenymt/PrivacySentry

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/allenymt/privacysentry/claude-md.svg)](https://agentmods.dev/instructions/allenymt/privacysentry/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/allenymt/privacysentry/claude-md"><img src="https://agentmods.dev/badge/instructions/allenymt/privacysentry/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,561 This file is loaded in full into every session.
When invoked 1,561 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.1 $0.01561 $0.01561
Opus 5 $0.00781 $0.00781
Sonnet 5 $0.00312 $0.00312
Haiku 4.5 $0.00156 $0.00156

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

Security

Grade A, and why

PrivacySentry 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 6d 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 · 169 lines

How it starts

The opening of the file, as written. The whole thing — 169 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.

项目概述

PrivacySentry 是一个 Android 隐私合规检测工具,通过 ASM 字节码插桩技术在编译期和运行期拦截敏感 API 调用,帮助开发者规避应用市场上架时的隐私合规检测问题。

核心架构

三层架构设计

  1. plugin-sentry (Gradle 插件层)

    • 基于 AGP 8.0+ 和 Booster 框架的 Gradle 插件
    • 负责在编译期进行字节码转换 (Transform)
    • 两阶段 Transform:
      • 第一阶段: 收集需要拦截的敏感函数 (MethodProxyCollectTransform, ClassProxyCollectTransform)
      • 第二阶段: 替换敏感函数调用 (MethodHookTransform, FieldProxyTransform, ClassProxyTransform)
    • 关键类: PrivacySentryPlugin.kt, PrivacyTransformTask.kt
  2. privacy-annotation (注解层)

    • 定义编译期注解用于声明需要拦截的方法和字段
    • 核心注解:
      • @PrivacyMethodProxy: 标记需要代理的方法
      • @PrivacyFieldProxy: 标记需要代理的字段
      • @PrivacyClassProxy: 标记包含代理方法的类
      • @PrivacyClassBlack: 标记不需要拦截的黑名单类
  3. hook-sentry (运行时 Hook 层)

    • 提供运行时的 SDK 初始化和日志收集功能
    • 支持三种缓存策略: 内存缓存 (MemoryCache)、时效性磁盘缓存 (TimeLessDiskCache)、永久磁盘缓存 (DiskCache)
    • 日志输出到文件 (.xls 格式)
    • 关键类: PrivacySentry.kt, PrivacySentryBuilder.kt
  4. privacy-proxy (预置代理实现)

    • 提供常用敏感 API 的拦截实现
    • 通过注解声明拦截规则,由插件在编译期自动收集
    • 关键类: PrivacyProxyCall.kt, PrivacyTelephonyProxy.kt, PrivacySensorProxy.kt

工作原理

  1. 编译期: 插件扫描所有 @PrivacyMethodProxy 注解,收集需要拦截的方法列表
  2. 字节码转换: 将目标方法调用替换为代理方法调用
  3. 运行期: 代理方法执行实际逻辑,并记录调用堆栈和时机到日志文件

常用命令

构建项目

./gradlew clean build

编译调试 (本地依赖模式)

修改 config.gradle:

build = [
    local_debug: true,
    local_debug_dir : "${rootProject.projectDir}/local"
]

发布到本地 Maven

./gradlew publishToMavenLocal

运行测试应用

./gradlew :app:installDebug

项目模块说明

  • app: 示例应用,演示如何集成和使用 PrivacySentry
  • plugin-sentry: Gradle 插件,负责字节码转换
  • hook-sentry: 运行时 SDK 核心库
  • privacy-annotation: 注解定义模块
  • privacy-proxy: 预置的敏感 API 拦截实现
  • privacy-replace: 类替换功能 (已废弃,不再维护)
  • privacy-test: 测试模块

版本兼容性

  • 当前版本 (1.3.7_v820_beta4): 支持 AGP 8.0+
  • 旧版本 (1.3.6): 支持 AGP 8.0 以下版本
  • 最低 Android SDK: minSdkVersion 19
  • 编译 SDK: compileSdkVersion 34
  • Kotlin: 1.8.10

Read the full file on GitHub · 169 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. 6d ago First seen · 169 lines · 1,561 tokens per session scan A 2866343b7206

Subscribe to this mod's changes

PrivacySentry CLAUDE.md is an instructions file published in the GitHub repository allenymt/PrivacySentry (2,290 stars, last pushed 8mo ago), licensed MIT. It adds 1,561 tokens to every session, about $0.0078 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

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 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

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

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