RuView: Command for Claude Code

.claude/commands/hooks/setup.md

setup is a command for Claude Code from ruvnet/RuView. It costs 0 tokens per session (507 once invoked), scanned A, original, MIT.

A setup command that creates configuration for ruv-swarm hooks. Hooks are automatic actions that run when events such as editing a file or ending a session occur.

In plain words
What is it for?
Use it to initialize hook settings, test pre-edit and session-end behavior, or protect files with custom rules.
Why use it?
It gives you a starting configuration and lets you test or customize checks that can continue or block an action.

Command for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths.

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

About the project

RuView is a WiFi sensing platform that uses disturbances in radio signals, captured by low-cost ESP32 sensors, to detect presence, movement, breathing, and heart rate without cameras or wearables. It is intended for spatial monitoring and smart-home integrations. The catalogue add-ons support workflows for operating and integrating RuView.

ruvnet/RuView · 98,353 stars · on GitHub · cognitum.one

Reuse

Borrowing it

Nothing to install: this file belongs to ruvnet/RuView. 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/ruvnet/RuView/main/.claude/commands/hooks/setup.md
Clone the repo
git clone --depth 1 https://github.com/ruvnet/RuView

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 setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/ruvnet/ruview/setup/github.svg)](https://agentmods.dev/commands/ruvnet/ruview/setup)
Your own site
<a href="https://agentmods.dev/commands/ruvnet/ruview/setup"><img src="https://agentmods.dev/badge/commands/ruvnet/ruview/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/ruvnet/ruview/setup"><img src="https://agentmods.dev/badge/commands/ruvnet/ruview/setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 507 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.00000 $0.00507
Opus 5.5 $0.00000 $0.00203
Sonnet 5.5 $0.00000 $0.00101
Haiku 4.5 $0.00000 $0.00051

Measured 1mo ago against content hash d24b951e66c2, 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 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.

Origin

Copies of this mod

8 near-identical copies found in the catalogue:

  • setup — 100% identical, 0 lines differ
  • setup — 100% identical, 0 lines differ
  • setup — 100% identical, 0 lines differ
  • setup — 100% identical, 0 lines differ
  • setup — 100% identical, 41 lines differ
  • setup — 100% identical, 0 lines differ
  • setup — 100% identical, 0 lines differ
  • setup — 100% identical, 0 lines differ
.claude/commands/hooks/setup.md · 103 lines

What it actually says

Setting Up ruv-swarm Hooks

Quick Start

1. Initialize with Hooks

npx claude-flow init --hooks

This automatically creates:

  • .claude/settings.json with hook configurations
  • Hook command documentation
  • Default hook handlers

2. Test Hook Functionality

# Test pre-edit hook
npx claude-flow hook pre-edit --file test.js

# Test session summary
npx claude-flow hook session-end --summary

3. Customize Hooks

Edit .claude/settings.json to customize:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "^Write$",
        "hooks": [{
          "type": "command",
          "command": "npx claude-flow hook pre-write --file '${tool.params.file_path}'"
        }]
      }
    ]
  }
}

Hook Response Format

Hooks return JSON with:

  • continue: Whether to proceed (true/false)
  • reason: Explanation for decision
  • metadata: Additional context

Example blocking response:

{
  "continue": false,
  "reason": "Protected file - manual review required",
  "metadata": {
    "file": ".env.production",
    "protection_level": "high"
  }
}

Performance Tips

  • Keep hooks lightweight (< 100ms)
  • Use caching for repeated operations
  • Batch related operations
  • Run non-critical hooks asynchronously

Debugging Hooks

# Enable debug output
export CLAUDE_FLOW_DEBUG=true

# Test specific hook
npx claude-flow hook pre-edit --file app.js --debug

Common Patterns

Auto-Format on Save

Already configured by default for common file types.

Protected File Detection

{
  "matcher": "^(Write|Edit)$",
  "hooks": [{
    "type": "command",
    "command": "npx claude-flow hook check-protected --file '${tool.params.file_path}'"
  }]
}

Automatic Testing

{
  "matcher": "^Write$",
  "hooks": [{
    "type": "command",
    "command": "test -f '${tool.params.file_path%.js}.test.js' && npm test '${tool.params.file_path%.js}.test.js'"
  }]
}
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 · 103 lines · 0 tokens per session scan A d24b951e66c2

Subscribe to this mod's changes

setup is a command published in the GitHub repository ruvnet/RuView (98,353 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 507 tokens. 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.