Skip to content
Security
Command

/pentest-exit

Close pentest session — summarizes findings, ensures outputs are saved, lifts isolation, and prompts for /clear

From plugin
claude-pentest
875 skills15 agents5 commands
Install
$ npx -y skills add Stickman230/claude-pentest --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/pentest-exit

Context preview

What this command does when you run it.

Close pentest session — summarizes findings, ensures outputs are saved, lifts isolation, and prompts for /clear

Command definition

pentest-exit.md
name: pentest-exit
description: Close pentest session — summarizes findings, ensures outputs are saved, lifts isolation, and prompts for /clear
disable-model-invocation: true
allowed-tools:
  - AskUserQuestion
  - Read
  - Write

Output the following closing banner verbatim:

============================================================
[PENTEST SESSION CLOSING]
============================================================

Step 1 — Identify Engagement

Use AskUserQuestion to ask:

"What is the engagement name for this session? (the name used in outputs/{name}/ — check your engagement summary or activity logs)"

Store the answer as {engagement_name}.

Step 2 — Findings Review

You MUST complete this step before outputting the session summary. Do not skip it even if the engagement folder appears empty.

First, try Schema A paths: Read all files matching: `outputs/{engagement_name}/findings/finding-*/description.md` Also read `outputs/{engagement_name}/pentest-report.json` if it exists.

If `outputs/{engagement_name}/findings/` is empty or does not exist, try Schema B paths: Read all files matching: `outputs/{engagement_name}/processed/findings/finding-*/description.md` Also read `outputs/{engagement_name}/report/pentest-report.json` if it exists.

Use the schema that produced findings. If both are empty, record: "No findings documented in outputs/{engagement_name}/"

From the files found:

  • Count findings by severity: Critical, High, Medium, Low, Info
  • Note the title or one-line description of each finding

Step 3 — Notes Flush

You MUST complete this step before outputting the session summary. Do not skip it.

Check whether any findings or notes are held in the current conversation context but NOT yet written to disk. This includes:

  • Any finding analysis discussed but not saved
  • Any vulnerability details drafted in conversation but without a corresponding description.md
  • Any activity summaries not yet appended to logs

If any such in-progress work exists, write it to disk now:

  • Findings go to: `outputs/{engagement_name}/findings/finding-{NNN}/description.md` (where NNN is the next sequential number)
  • Activity logs go to: `outputs/{engagement_name}/activity/`
  • Final report (if complete) goes to: `outputs/{engagement_name}/pentest-report.json`

If nothing is pending, continue to the next step.

Step 4 — Session Summary

After completing the findings review and notes flush, output the following block with real values substituted in:

============================================================
SESSION SUMMARY — {engagement_name}
============================================================
Target tested:   {target_from_report_or_logs}
Findings:        Critical: N | High: N | Medium: N | Low: N | Info: N
Top findings:    [list up to 3 highest-severity findings with one-line description each]
Outputs saved:   outputs/{engagement_name}/
============================================================

If `pentest-report.json` was found, use its data for the target and finding counts. If not, use whatever was found in the findings/ files. If nothing was found, set all counts to 0, set target to "unknown", and note "No findings documented."

Step 5 — Isolation Lift

Output the following instruction block verbatim:

============================================================
[PENTEST MODE — ISOLATION LIFTED]

The pentest session isolation constraint is now removed.
You may use agents and skills from all plugins again.
Normal operating mode restored.
============================================================

Step 6 — Scope and Attacks Reset

Try to Read `.pentest-scope.json`. If the file exists, write it back with the `"status"` field set to `"pending"` and all other fields unchanged. This marks the scope as no longer active so a future `/pentest:pentest` will ask whether to reuse it rather than assuming it is live.

Try to Read `.pentest-attacks.json`. If the file exists, write it back with the `"status"` field set to `"pending"` and all other fields unchanged. This marks the attack profile as no longer active so a future `/pentest:pentest` will ask whether to reuse it rather than assuming it is still valid.

Step 7 — Close Message

Output the following:

Pentest session closed. Engagement outputs remain in outputs/{engagement_name}/.

Run /clear to fully reset the context window and remove all session context (recommended before starting a new engagement or switching tasks).
Read more
Ships withclaude-pentest

An open source plugin for enabeling claude to gain offensive pentesting capabilities

Get the whole plugin, auto-invoked
Stats
87
Stars
0
Views
4
Forks
Maintained
Maintenance
Python
Language
MIT
License
2mo ago
Last commit
4mo ago
Created

Repo: Stickman230/claude-pentest