How to Perform a Dry Run with the install.sh Script
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 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 (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:
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 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:
./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:
./install.sh --target /tmp/claude-test --dry-run
Category-Filtered Dry Run
To preview only the files within a specific skill category:
./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-runflag setsDRY_RUN=1ininstall.sh(line 45), triggering a read-only preview mode. - The script uses
findandsedto display transformed paths without executingmkdir,rsync, orcpcommands. - You can combine
--dry-runwith--targetor--categoryflags 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 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 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.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →