setup

setup is a command for Claude Code from MadAppGang/claude-code. It costs 17 tokens per session (955 once invoked), scanned A, original, MIT.

A setup command for adding claudemem search rules to a project's CLAUDE.md file. It checks whether claudemem is installed and indexed before offering to document the project's search requirements.

In plain words
What is it for?
Use it to check installation and index status, initialize or index claudemem when needed, inspect CLAUDE.md, and add enforcement rules with the user's approval.
Why use it?
It helps ensure that code-search enforcement is configured and that the project has a usable claudemem index.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool.

Part of the code-analysis plugin — 12 skills, 2 commands, 1 agent shipped together

Good fit Use it to check installation and index status, initialize or index claudemem when needed, inspect CLAUDE.md, and add enforcement rules with the user's approval.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/madappgang/claude-code/setup
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.

Clone the repo
git clone --depth 1 https://github.com/MadAppGang/claude-code

Made for: Claude Code.

Or install code-analysis, the plugin that ships this one along with the rest of its 12 skills, 2 commands, 1 agent.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/madappgang/claude-code/setup/github.svg)](https://agentmods.dev/commands/madappgang/claude-code/setup)
Your own site
<a href="https://agentmods.dev/commands/madappgang/claude-code/setup"><img src="https://agentmods.dev/badge/commands/madappgang/claude-code/setup/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 setup

Your own site · 80×15
<a href="https://agentmods.dev/commands/madappgang/claude-code/setup"><img src="https://agentmods.dev/badge/commands/madappgang/claude-code/setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 955 The whole file, excluding the scripts and references it only reads on demand.
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.00017 $0.00955
Opus 5.5 $0.00007 $0.00382
Sonnet 5.5 $0.00003 $0.00191
Haiku 4.5 $0.00002 $0.00096

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

Security

Grade A, and why

setup 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 3mo 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.

plugins/code-analysis/commands/setup.md · 142 lines

How it starts

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

Setup Claudemem Enforcement

This command sets up claudemem semantic search enforcement for this project.

Steps

1. Check claudemem installation

which claudemem && claudemem --version

If not installed, guide user:

npm install -g claude-codemem
claudemem init

2. Check index status

claudemem status

If not indexed:

claudemem index

3. Check CLAUDE.md for existing rules

Read the project's CLAUDE.md and look for the marker: ## Code Search: CLAUDEMEM ENFORCED

4. If rules not present, ask user

AskUserQuestion({
  questions: [{
    question: "Add claudemem enforcement rules to CLAUDE.md?",
    header: "Setup",
    multiSelect: false,
    options: [
      { label: "Yes, add rules (Recommended)", description: "Adds documentation about Grep/Glob interception" },
      { label: "No, skip", description: "Hooks will still work, just no documentation in CLAUDE.md" }
    ]
  }]
})

5. Inject rules if user agrees

Append the following to CLAUDE.md:


## Code Search: CLAUDEMEM ENFORCED

> Added by `code-analysis` plugin v2.14.0

### Mandatory Enforcement Rules

**The hook system is INESCAPABLE when claudemem is indexed.**

| Tool | Behavior | Workaround Blocked? |
|------|----------|-------------------|
| **Grep** | BLOCKED - Results provided in block message | N/A (primary) |
| **Glob (code patterns)** | BLOCKED if pattern matches `**/*.ts` etc | YES |
| **Bash grep/rg/find** | BLOCKED - Pattern extracted and analyzed | YES |
| **Read (3+ files)** | WARNING at 3, BLOCKED at 5+ | YES |
| **Task (Explore)** | BLOCKED - Redirect to detective | YES |

### Evasion Detection

The hook system tracks blocked tools and detects workaround patterns:

- Grep blocked -> Glob attempted -> **EVASION BLOCKED**
- Grep blocked -> 5 Read calls -> **BULK READ BLOCKED**
- Explore blocked -> Bash search -> **EVASION BLOCKED**

**There is no workaround. Use claudemem or detective skills.**

### Required Response to Block

When you see a block message:

1. **READ** the provided claudemem results in the block message
2. **USE** those results if sufficient
3. **INVOKE** `code-analysis:claudemem-search` skill if more data needed
4. **NEVER** attempt Glob, bulk Read, or Bash search as alternatives

### Manual Commands

```bash
claudemem search "authentication flow"  # Semantic search
claudemem --agent symbol "UserService"  # Find definition
claudemem --agent callers "login"       # Impact analysis
claudemem status                        # Check index
claudemem index                         # Re-index project

Why This Exists

  1. Token Efficiency: claudemem ~500 tokens vs 5+ files ~5000+ tokens
  2. Semantic Ranking: Results ranked by relevance, not file order
  3. No Noise: Excludes node_modules, generated types, fixtures
  4. AST Analysis: Understands code structure, not just text patterns

Consequences of Ignoring

  • Workaround tools will be blocked
  • Evasion patterns are logged
  • Each block adds context overhead
  • Task fails to progress until compliance

Read the full file on GitHub · 142 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. 3mo ago First seen · 142 lines · 17 tokens per session scan A a05db8b5b4ad

Subscribe to this mod's changes

setup is a command published in the GitHub repository MadAppGang/claude-code (291 stars, last pushed 8mo ago), licensed MIT. It adds 17 tokens to every session and 955 once invoked, about $0.0001 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

setup compared with commands from other repositories

setup next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
setupMadAppGang/claude-codeCommand2918mo agoMITA17Claude Code
checklistgithub/spec-kitCommand154ktodayMITA13Claude Code
clarifygithub/spec-kitCommand154ktodayMITA27Claude Code
specifygithub/spec-kitCommand154ktodayMITA13Claude Code
analyzegithub/spec-kitCommand154ktodayMITA26Claude Code
convergegithub/spec-kitCommand154ktodayMITA35Claude Code
implementgithub/spec-kitCommand154ktodayMITA14Claude Code