From superhackers
Use when starting security work that needs isolation from current workspace, before executing engagement plans, or when testing exploits that could affect the working tree — creates isolated git worktrees with smart directory selection and safety verification
npx claudepluginhub narlyseorg/superhackers --plugin superhackersThis skill uses the workspace's default tool permissions.
| Tool | Required | Fallback | Install |
Retrieves texts, DMs, one-time codes, and inspects threads in ECC workflows. Provides evidence of exact sources checked for verification before replies.
Delivers expertise for HS tariff classification, customs documentation, duty optimization, restricted party screening, and trade compliance across jurisdictions.
Process documents with Nutrient API: convert formats (PDF, DOCX, XLSX, images), OCR scans (100+ languages), extract text/tables, redact PII, sign, fill forms.
| Tool | Required | Fallback | Install |
|---|---|---|---|
| git | ✅ Yes | No fallback — essential | Usually pre-installed |
| ripgrep (rg) | ⚡ Optional | grep → find | brew install ripgrep / cargo install ripgrep |
Cross-Platform Notes:
- macOS: Install GNU coreutils for
timeoutcommand:brew install coreutils(providesgtimeout)- Linux/WSL:
timeoutcommand is available by default
Add these functions to your shell session for cross-platform compatibility:
# Cross-platform timeout wrapper
run_with_timeout() {
local seconds="$1"
shift
if command -v timeout >/dev/null 2>&1; then
timeout "$seconds" "$@"
elif command -v gtimeout >/dev/null 2>&1; then
gtimeout "$seconds" "$@"
else
# Perl fallback for macOS without coreutils
perl -e 'use POSIX qw(SIGALRM); alarm shift; exec @ARGV or die "$!"' "$seconds" "$@"
fi
}
# Cross-platform grep wrapper
search_text() {
if command -v rg >/dev/null 2>&1; then
rg "$@"
else
grep -E "$@"
fi
}
# Cross-platform PIPESTATUS alternative
# Usage: run_and_capture command arg1 arg2; EXIT_CODE=$?
run_and_capture() {
"$@"
return $?
}
if [ $EXIT_CODE -eq 0 ]; then echo "SUCCESS: Worktree created at $WORKTREE_PATH" elif search_text -q "already exists" worktree_creation.log; then echo "INFO: Worktree branch already exists, removing old worktree" git worktree remove "$WORKTREE_PATH" 2>/dev/null # Retry creation git worktree add "$WORKTREE_PATH" -b "$BRANCH_NAME" else echo "TOOL_FAILURE: Failed to create worktree" echo "Diagnosis: $(cat worktree_creation.log)" echo "" echo "Possible causes:" echo "- Branch name already exists elsewhere" echo "- Filesystem permissions" echo "- Corrupted git repository" exit 1 fi
4. **Safety verification with retry**
```bash
# Check .gitignore with retry
if ! git check-ignore -q .worktrees 2>/dev/null; then
echo "WARNING: .worktrees is NOT ignored in .gitignore"
echo "Fixing immediately..."
# Add to .gitignore
echo ".worktrees/" >> .gitignore 2>/dev/null
# Verify fix
if git check-ignore -q .worktrees 2>/dev/null; then
echo "SUCCESS: .worktrees now ignored"
# Stage and commit
git add .gitignore
git commit -m "chore: add .worktrees to .gitignore"
else
echo "TOOL_FAILURE: Could not add .worktrees to .gitignore"
echo "Manual intervention required"
fi
fi
# Run project setup with validation
cd "$WORKTREE_PATH"
# Detect project type
if [ -f package.json ]; then
echo "Detected: Node.js project"
echo "Running: npm install"
run_with_timeout 120 npm install 2>&1 | tee npm_install.log
if [ $? -eq 0 ]; then
echo "SUCCESS: Dependencies installed"
else
echo "WARNING: npm install had issues"
echo "Check: npm_install.log"
fi
elif [ -f Cargo.toml ]; then
echo "Detected: Rust project"
echo "Running: cargo build"
run_with_timeout 300 cargo build 2>&1 | tee cargo_build.log
if [ $? -eq 0 ]; then
echo "SUCCESS: Project built successfully"
else
echo "WARNING: Build had errors or warnings"
echo "Check: cargo_build.log"
fi
else
echo "INFO: No package manager detected (manual project)"
fi
# Verify clean baseline
if [ -f package.json ]; then
run_with_timeout 60 npm test 2>&1 | tee npm_test.log
if [ $? -eq 0 ]; then
echo "BASELINE: All tests passing"
else
echo "WARNING: Baseline tests not passing"
echo "This may not be a clean checkout"
fi
fi
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple engagements or exploit branches simultaneously without switching.
Core principle: Systematic directory selection + safety verification = reliable isolation.
Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."
Follow this priority order:
# Check in priority order
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative
If found: Use that directory. If both exist, .worktrees wins.
rg -i "worktree.*director" CLAUDE.md 2>/dev/null
If preference specified: Use it without asking.
If no directory exists and no CLAUDE.md preference:
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. ~/.config/superhackers/worktrees/<project-name>/ (global location)
Which would you prefer?
MUST verify directory is ignored before creating worktree:
# Check if directory is ignored (respects local, global, and system gitignore)
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
If NOT ignored:
Fix broken things immediately:
Why critical: Prevents accidentally committing worktree contents (especially exploit code, scan results, or engagement evidence) to the repository.
No .gitignore verification needed — outside project entirely.
project=$(basename "$(git rev-parse --show-toplevel)")
# Determine full path
case $LOCATION in
.worktrees|worktrees)
path="$LOCATION/$BRANCH_NAME"
;;
~/.config/superhackers/worktrees/*)
path="~/.config/superhackers/worktrees/$project/$BRANCH_NAME"
;;
esac
# Create worktree with new branch
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"
Auto-detect and run appropriate setup:
# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi
Run scans or checks to ensure worktree starts clean:
# Verify the workspace is functional
# Use project-appropriate verification command
npm test # Node.js projects
cargo test # Rust projects
pytest # Python projects
go test ./... # Go projects
If checks fail: Report failures, ask whether to proceed or investigate.
If checks pass: Report ready.
Worktree ready at <full-path>
Baseline checks passing (<N> checks, 0 failures)
Ready to begin <engagement-name / exploit-branch / target-analysis>
| Situation | Action |
|---|---|
.worktrees/ exists | Use it (verify ignored) |
worktrees/ exists | Use it (verify ignored) |
| Both exist | Use .worktrees/ |
| Neither exists | Check CLAUDE.md → Ask user |
| Directory not ignored | Add to .gitignore + commit |
| Checks fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
git check-ignore before creating project-local worktreeYou: I'm using the using-git-worktrees skill to set up an isolated workspace.
[Check .worktrees/ - exists]
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
[Create worktree: git worktree add .worktrees/exploit-cve-2024-1234 -b exploit/cve-2024-1234]
[Run pip install -r requirements.txt]
[Run pytest - 12 passing]
Worktree ready at /Users/hacker/pentest-tools/.worktrees/exploit-cve-2024-1234
Baseline checks passing (12 tests, 0 failures)
Ready to develop exploit for CVE-2024-1234
You: I'm using the using-git-worktrees skill to set up isolated workspaces for parallel testing.
[Create worktree: git worktree add .worktrees/target-webapp -b engagement/webapp-assessment]
[Create worktree: git worktree add .worktrees/target-api -b engagement/api-assessment]
[Create worktree: git worktree add .worktrees/target-infra -b engagement/infra-assessment]
Worktrees ready:
- .worktrees/target-webapp → webapp assessment workspace
- .worktrees/target-api → API assessment workspace
- .worktrees/target-infra → infrastructure assessment workspace
Ready to dispatch parallel agents (see superhackers:dispatching-parallel-agents)
Never:
Always:
Called by:
Pairs with: