# How to Perform a Dry Run with the install.sh Script

> Learn how to perform a dry run with the install.sh script in SnailSploit/Claude-Red. Preview file copies to your Claude skills directory without writing data.

- Repository: [SnailSploit | Kai Aizen/Claude-Red](https://github.com/SnailSploit/Claude-Red)
- Tags: how-to-guide
- Published: 2026-09-14

---

**Execute `./install.sh --dry-run` to preview which SKILL.md files will be copied to your Claude skills directory without writing any data to disk.**

The [`install.sh`](https://github.com/SnailSploit/Claude-Red/blob/main/install.sh) script in the SnailSploit/Claude-Red repository automates the installation of offensive-security skill files into Claude's configuration directory. Before executing the installation, you can perform a dry run to verify exactly which files will be transferred and confirm the destination paths are correct.

## How the Dry Run Logic Works

The dry-run functionality is implemented in the main installer script at [`install.sh`](https://github.com/SnailSploit/Claude-Red/blob/main/install.sh) (lines 41-109). When activated, this mode performs a complete read-only analysis of the source and target paths without invoking any write operations.

### Argument Parsing and Flag Detection

The script processes command-line options in a `while` loop spanning lines 41-50. When the `--dry-run` argument is detected, the script sets the internal variable `DRY_RUN=1` at line 45. This boolean flag acts as a guard that prevents all subsequent filesystem modifications.

### Preview Generation Without Modifications

After displaying the resolved source and destination paths (lines 85-88), the script evaluates the dry-run condition at line 89. If `DRY_RUN` equals 1, the script executes a dedicated preview block:

```bash
if [ "$DRY_RUN" -eq 1 ]; then
  echo "[dry-run] Would copy:"
  find "$SOURCE" -name SKILL.md | sed "s|^$SOURCE|  $DEST|"
  exit 0
fi

```

This block uses `find` to enumerate every [`SKILL.md`](https://github.com/SnailSploit/Claude-Red/blob/main/SKILL.md) file under the selected source directory (`$SOURCE`), then pipes the results through `sed` to transform the paths—replacing the source prefix with the destination prefix. Because the script calls `exit 0` immediately after printing the transformed list, no `mkdir`, `rsync`, or `cp` commands are ever executed.

## Command Examples for Dry Run Installations

You can combine the `--dry-run` flag with other installer options to preview specific installation scenarios before committing changes.

### Basic Dry Run with Interactive Selection

To preview the default installation without specifying a target directory:

```bash
./install.sh --dry-run

```

This prompts you to select a target directory (defaulting to `~/.claude/skills/claude-red`) and then lists the files that would be copied.

### Dry Run with Explicit Target Path

To verify files will be copied to a specific location:

```bash
./install.sh --target /tmp/claude-test --dry-run

```

### Category-Filtered Dry Run

To preview only the files within a specific skill category:

```bash
./install.sh --category web --dry-run

```

Each command outputs a formatted list showing the source and target paths followed by the transformed file locations:

```

Source:  /path/to/Claude-Red/Skills
Target:  /tmp/claude-test
[dry-run] Would copy:
  /tmp/claude-test/offensive-sqli/SKILL.md
  /tmp/claude-test/offensive-xss/SKILL.md

```

## Summary

- The `--dry-run` flag sets `DRY_RUN=1` in [`install.sh`](https://github.com/SnailSploit/Claude-Red/blob/main/install.sh) (line 45), triggering a read-only preview mode.
- The script uses `find` and `sed` to display transformed paths without executing `mkdir`, `rsync`, or `cp` commands.
- You can combine `--dry-run` with `--target` or `--category` flags to preview specific installation configurations.
- The dry run exits with code 0 immediately after printing the file list, guaranteeing no filesystem modifications occur.

## Frequently Asked Questions

### Does the dry run create any directories or temporary files?

No. According to the source code in [`install.sh`](https://github.com/SnailSploit/Claude-Red/blob/main/install.sh) lines 89-92, the script exits immediately after printing the preview list. The `exit 0` command at line 92 ensures that subsequent directory creation and file copy operations are never reached.

### Can I use --dry-run with the --category filter?

Yes. The argument parsing loop in [`install.sh`](https://github.com/SnailSploit/Claude-Red/blob/main/install.sh) processes all flags before executing the dry-run logic. You can execute `./install.sh --category web --dry-run` to preview only the SKILL.md files within the web category without installing them.

### What exit code does the script return during a dry run?

The script returns exit code 0 (success) during a dry run. Line 92 explicitly calls `exit 0` after displaying the file list, indicating that the preview operation completed successfully without errors.

### Does the dry run show the actual file contents that will be copied?

No, the dry run displays only the destination filenames and paths, not the contents. The `find` command at line 91 locates the files, and `sed` transforms the paths for display purposes, but no file read operations display the markdown content.