Skip to content

Claude Code -- Getting Started

This guide walks you through using Claude Code with the networking-tools project. By the end, you will have scope configured, safety hooks verified, and your first AI-assisted scan complete.

The project includes a Claude Code Skill Pack that layers AI assistance on top of the existing tool scripts:

  • 28 slash commands that wrap every tool — no need to remember script paths or flags
  • 8 workflow skills that chain multiple tools into multi-step engagements
  • 3 subagent personas for offensive testing, defensive analysis, and report synthesis
  • Safety hooks that validate all targets against a scope file and log every invocation

Skills are instructions loaded into Claude when you invoke them. They do not modify the underlying scripts — everything still runs through the same bash wrappers with -j -x flags.

Before you begin, make sure you have:

  • Claude Code CLI installed and authenticated
  • This project cloned with tools installed (make check)
  • Docker lab running if you plan to test against local targets (make lab-up)
  • jq installed — required by the safety hooks and JSON output mode

The safety hooks require a scope file before any security tool will run. Initialize it with safe default targets:

/scope init

This creates .pentest/scope.json with localhost and 127.0.0.1 as allowed targets. Add more targets as needed:

/scope add 192.168.1.0/24

Run the health check to confirm everything is wired up:

/netsec-health

You should see five check categories, all passing:

  1. Hook Files — PreToolUse and PostToolUse scripts exist and are executable
  2. Hook Registration — hooks are registered in .claude/settings.json
  3. Scope Configuration.pentest/scope.json exists with valid targets
  4. Audit Infrastructure.pentest/ directory is writable and gitignored
  5. Dependenciesjq is installed and bash supports associative arrays

If any checks fail, the output explains what to fix.

With scope initialized, try a port scan against localhost:

/nmap localhost

Claude loads the nmap skill instructions, then runs:

Terminal window
bash scripts/nmap/identify-ports.sh localhost -j -x

The PreToolUse hook validates localhost against your scope file. The script runs and produces JSON output. The PostToolUse hook parses the JSON envelope and injects a structured summary back to Claude, so you get organized results instead of raw terminal output.

Each skill is a SKILL.md file in .claude/skills/<name>/ containing instructions for Claude. When you type /nmap, Claude reads the skill file and follows its instructions to run the appropriate wrapper script.

Key design points:

  • Zero context overhead — tool skills use disable-model-invocation: true, meaning they are not loaded until you invoke them
  • Wrapper scripts only — the PreToolUse hook blocks direct tool invocations (e.g., raw nmap), enforcing the use of wrapper scripts that produce structured output
  • Automatic JSON — skills instruct Claude to add -j -x to every command, so the PostToolUse hook always receives parseable output

All available slash commands, grouped by category:

SkillToolWhat It Does
/nmapnmapNetwork scanning and host discovery
/tsharktsharkPacket capture and traffic analysis
/metasploitmetasploitPenetration testing framework
/hashcathashcatGPU-accelerated password cracking
/johnjohnVersatile password cracker
/sqlmapsqlmapSQL injection detection
/niktoniktoWeb server vulnerability scanning
/hping3hping3Packet crafting and firewall testing
/aircrack-ngaircrack-ngWiFi security auditing
/skipfishskipfishWeb application scanning
/foremostforemostFile carving and data recovery
/ffufffufFast web fuzzing
/gobustergobusterDirectory and DNS brute-force
/curlcurlHTTP requests and endpoint testing
/digdigDNS record lookups
/netcatnetcatNetwork connections and listeners
/traceroutetracerouteRoute tracing and latency
SkillWhat It Does
/reconHost discovery, DNS enumeration, SSL inspection
/scanPort scanning, web vulnerabilities, SQL injection testing
/fuzzDirectory brute-force, parameter fuzzing, web scanning
/crackHash identification and password cracking
/sniffTraffic capture, credential extraction, file recovery
/diagnoseDNS, connectivity, and performance diagnostics
/reportGenerate structured findings report from session
/scopeManage target scope (add/remove/show/init/clear)
SkillWhat It Does
/check-toolsVerify which tools are installed
/labManage Docker lab targets (start/stop/status)
/netsec-healthSafety architecture health check
SkillWhat It Does
/pentesterOffensive testing with multi-tool workflow orchestration
/defenderDefensive analysis and remediation guidance (read-only)
/analystReport synthesis and finding correlation (write-capable)