agentmask: Instructions file for Claude Code

CLAUDE.md

agentmask CLAUDE.md is an instructions file for Claude Code from adithyan-ak/agentmask. It costs 2,326 tokens per session, scanned A, original, MIT.

A security guide and integration layer for AI coding assistants that blocks access to secrets such as API keys, passwords, and connection strings. It supports Claude Code and Cursor and uses secret-scanning checks to detect exposed credentials.

In plain words
What is it for?
Use it to protect secrets while working with Claude Code or Cursor. It can scan code, block listed files or values, and catch passwords, credential-bearing connection strings, and several provider-specific token formats.
Why use it?
It helps prevent an AI assistant from reading, leaking, or committing sensitive values in a codebase. A shared blocklist and checks from more than one scanner cover different kinds of secret patterns.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions Claude Code.

This is adithyan-ak/agentmask's own configuration. It tells Claude Code how to work on agentmask 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 agentmask configures →

Reuse

Borrowing it

Nothing to install: this file belongs to adithyan-ak/agentmask. 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/adithyan-ak/agentmask/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/adithyan-ak/agentmask

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/adithyan-ak/agentmask/claude-md"><img src="https://agentmods.dev/badge/instructions/adithyan-ak/agentmask/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,326 This file is loaded in full into every session.
When invoked 2,326 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.02326 $0.02326
Opus 5.5 $0.00930 $0.00930
Sonnet 5.5 $0.00465 $0.00465
Haiku 4.5 $0.00233 $0.00233

Measured 1mo ago against content hash 336b257162b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agentmask 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 1mo 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 · 185 lines

How it starts

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

agentmask — Contributor Context

What This Is

agentmask is an open-source secrets firewall for AI coding agents. It prevents Claude Code, Cursor, and other AI assistants from reading, leaking, or committing secrets like API keys, tokens, passwords, and connection strings.

agentmask's value is the IDE integration layer — hooks, blocklist, MCP server, behavioral rules. Currently supports Claude Code and Cursor with auto-detection. Primary detection is delegated to gitleaks (150+ battle-tested rules). An agentmask scanner (src/scanner/tier2.ts) runs as a second pass to catch patterns gitleaks's generic-api-key rule deliberately excludes: password/passwd/pwd field assignments, connection strings with embedded credentials, and provider prefixes without dedicated gitleaks rules (whsec_, GOCSPX-).

Architecture

agentmask = IDE integration layer (Claude Code + Cursor)
  ├── Scanner backend: gitleaks (150+ rules, auto-downloaded if not installed)
  ├── agentmask scanner: complementary TS regex pass (password fields, conn strings, whsec_, GOCSPX-)
  ├── Blocklist manager (.agentmask/blocklist.json, shared between IDEs)
  ├── IDE adapters (src/ide/targets.ts — hook format, rules format, config paths per IDE)
  ├── Hooks (pre-read, pre-write, pre-bash, post-scan) with --format adapter
  ├── MCP server (safe_read, env_names, scan_file, scan_staged)
  └── Behavioral rules (per-IDE: .claude/rules/*.md, .cursor/rules/*.mdc)

Three Reinforcing Layers

Layer 1: BLOCK (PreToolUse hooks)
  → Pre-read: static path patterns + dynamic blocklist lookup (no subprocess, <5ms)
  → Pre-write: gitleaks + agentmask scan on content via temp file (~200ms)
  → Pre-bash: pattern match on commands + gitleaks scan on staged files for git commit
  → Post-scan: gitleaks + agentmask scan on tool output, warns + auto-adds to blocklist

Layer 2: REDIRECT (MCP server)
  → safe_read: reads file, uses merged gitleaks + agentmask findings to redact secrets
  → env_names: lists .env variable names without values
  → scan_file / scan_staged: explicit scans (scan_file also runs agentmask scanner)

Layer 3: INSTRUCT (.claude/rules/agentmask.md)
  → Behavioral rules telling the agent to prefer safe_read
  → Installed automatically by `agentmask init`

Read the full file on GitHub · 185 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. 1mo ago First seen · 185 lines · 2,326 tokens per session scan A 336b257162b8

Subscribe to this mod's changes

agentmask CLAUDE.md is an instructions file published in the GitHub repository adithyan-ak/agentmask (14 stars, last pushed 6mo ago), licensed MIT. It adds 2,326 tokens to every session, about $0.0093 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-08-30.

Related

Other instructions, from other repositories