setup-global-claude-md

setup-global-claude-md is a command for coding agents from anilcancakir/claude-code-plugin. It costs 25 tokens per session (2,879 once invoked), scanned D, original, MIT.

A command that interviews a developer and creates or updates a global CLAUDE.md file, which provides shared instructions to every Claude Code session.

In plain words
What is it for?
Use it to configure shared identity, technology-stack, skills, MCP, LSP, and rules information for Claude Code conversations.
Why use it?
It avoids manually maintaining the same basic setup across sessions while preserving selected user-specific settings during updates.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the ac plugin — 6 skills, 9 commands, 2 hooks shipped together

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 commands/anilcancakir/claude-code-plugin/setup-global-claude-md
Clone the repo
git clone --depth 1 https://github.com/anilcancakir/claude-code-plugin

Or install ac, the plugin that ships this one along with the rest of its 6 skills, 9 commands, 2 hooks.

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 setup-global-claude-md

README.md
[![agentmods](https://agentmods.dev/badge/commands/anilcancakir/claude-code-plugin/setup-global-claude-md.svg)](https://agentmods.dev/commands/anilcancakir/claude-code-plugin/setup-global-claude-md)
Your own site
<a href="https://agentmods.dev/commands/anilcancakir/claude-code-plugin/setup-global-claude-md"><img src="https://agentmods.dev/badge/commands/anilcancakir/claude-code-plugin/setup-global-claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,879 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 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.00025 $0.02879
Opus 5 $0.00013 $0.01439
Sonnet 5 $0.00005 $0.00576
Haiku 4.5 $0.00003 $0.00288

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

Security

Grade D, and why

setup-global-claude-md scanned grade D with 3 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat ~/.claude/.mcp.json 2>/dev/null; cat ~/.claude.json 2>/dev/null

Reads MCP configurationmediumAgent snooping

mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.

cat ~/.claude/.mcp.json 2>/dev/null; cat ~/.claude.json 2>/dev/null

Enumerates other installed skillsmediumAgent snooping

Other skills' SKILL.md files reveal prompts, capabilities and secrets that should be invisible to peers.

find ~/.claude/skills -name "SKILL.md" -maxdepth 3 2>/dev/null
plugins/ac/commands/setup-global-claude-md.md · 214 lines

How it starts

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

Setup Global CLAUDE.md

Generate or update ~/.claude/CLAUDE.md. Injected into every CC conversation as user-rules — main session AND plugin subagents.

Authoring knowledge: Section patterns, quality scoring, compression tactics, and dedup boundaries live in the claude-md-writer skill. Read it before writing any section content. The template at ${CLAUDE_PLUGIN_ROOT}/references/global-claude-md-template.md provides structural guidance.

Scope: This config is deliberately lightweight. It does NOT inject planning pipelines, Intent Gate, delegation directives, tier routing, or parallel subagent mandates. CC's native plan mode and default agent behavior stay in charge.

Section Ownership

Type Sections Update Behavior
Fixed defaults Identity bullets, Behavioral Guidelines, Rules defaults Always regenerated verbatim from template. Never preserved from existing file — users get the latest baseline every run
Plugin-managed Skills, MCP, LSP Regenerated from template every run
User-managed Identity opening line, Tech Stack, Rules extras Preserved across updates. Changed only via interview

The Identity bullet list, full Behavioral Guidelines block, and Rules default block are non-negotiable baselines — they are rewritten verbatim on every update, enhance, and overwrite run. Interview (Q3/Q5) can only APPEND rules, never remove or rewrite defaults. Q1 only tunes the opening sentence of Identity.


Phase 1: Discovery

  1. Check ~/.claude/settings.json → detect existing permissions.deny and hooks.PreToolUse entries. Store as EXISTING_SETTINGS for Phase 4 merge.

  2. Check ~/.claude/CLAUDE.md existence → determine mode:

    • Exists + $ARGUMENTS = "update" → extract user-managed sections (opening sentence, Tech Stack, Rules extras) verbatim, skip Phase 2. Fixed defaults and Behavioral Guidelines regenerate from template
    • Exists + $ARGUMENTS = "enhance" or no argument → pre-fill interview from existing content. Fixed defaults still rewritten verbatim
    • Exists + $ARGUMENTS = "overwrite" → fresh generation
    • Not exists → fresh generation

Read the full file on GitHub · 214 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. 4d ago First seen · 214 lines · 25 tokens per session scan D 92d484d1af40

Subscribe to this mod's changes

setup-global-claude-md is a command published in the GitHub repository anilcancakir/claude-code-plugin (2 stars, last pushed 4mo ago), licensed MIT. It adds 25 tokens to every session and 2,879 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it D with 3 findings (reads agent configuration directories, reads mcp configuration, enumerates other installed skills). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.