ai-pair-hunting-with-claude
Skill22 starsChanged 6 months agoMITView on GitHub
Configure Claude as a "Pair Hunter" — autonomous overnight hacking, context management via per-target .claudemd files, sub-agent compaction avoidance, and scope enforcement. Based on Critical Thinking Bug Bounty Podcast Episode 166.
- Reads credentials
In this repository353 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bb-hugeSkill
- 2fa-multi-factor-bypassSkill
- 401-403-bypass-techniquesSkill
- Access Control — Complete Deep DiveSkill
- active-directory-acl-abuseSkill
- active-directory-asreproastingSkill
- active-directory-certificate-servicesSkill
- active-directory-dcsync-attackSkill
- active-directory-full-attack-chainSkill
- active-directory-golden-ticketSkill
- active-directory-kerberoastingSkill
- active-directory-kerberos-attacksSkill
- ad-asreproast-attackSkill
- ad-assessmentSkill
- ad-cs-esc1-abuseSkill
- ad-dcsync-attackSkill
- ad-pass-the-hashSkill
- advanced-sql-injection-sqliSkill
- ai-agent-tool-abuse-and-privilege-escalationSkill
- ai-data-extraction-via-ssrfSkill
- ai-data-poisoning-model-skewingSkill
- ai-data-poisoningSkill
- ai-jailbreak-obfuscation-ciphersSkill
- ai-jailbreak-prompt-injectionSkill
- ai-jailbreak-system-promptsSkill
- aikido-triageSkill
- ai-ml-securitySkill
- ai-prompt-leakingSkill
- ai-redteamSkill
- ai-report-writing-guardrailsSkill
- amend-skillSkill
- amsi-bypassSkill
- analyze-cveSkill
- android-apk-reverse-engineeringSkill
- android-pentesting-tricksSkill
- anti-debugging-techniquesSkill
- api-auth-and-jwt-abuseSkill
- api-authentication-bypassSkill
- api-authorization-and-bolaSkill
- api-enumeration-fuzzing-discoverySkill
- api-mass-assignment-exploitationSkill
- api-rate-limit-bypass-techniquesSkill
- api-recon-and-docsSkill
- api-secSkill
- api-securitySkill
- API Testing — Deep DiveSkill
- arbitrary-write-to-rceSkill
- authbypass-authentication-flawsSkill
- auth-bypassSkill
- Authentication — Complete Deep DiveSkill
- auth-secSkill
- authz-bypassSkill
- av-edr-evasion-techniquesSkill
- aws-cloud-penetration-testingSkill
- aws-cognito-abuseSkill
- aws-iam-privilege-escalationSkill
- aws-imdsv2-ssrf-bypassSkill
- aws-metadata-ssrf-exploitationSkill
- aws-metadata-ssrfSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
When setting up Claude Code CLI to autonomously test a bug bounty target.
- Distinctive: line 26
When running overnight / multi-hour autonomous hacking sessions.
- Distinctive: line 27
When managing scope and context across multiple bug bounty programs.
- Distinctive: line 28
When Claude is getting stuck in compaction loops or losing context mid-session.
- Distinctive: line 29
When you need Claude to stay strictly within program scope.
- Distinctive: line 52
Long context retention: After ~100k tokens, context degrades
- Very specific: line 125
Why this works: When you run claude from inside programs/example-corp/, Claude automatically reads .claudemd and constrains itself to the …
- Distinctive: line 171
What is compaction?: When Claude's context window fills up, it "compacts" by summarizing older conversation turns.
- Distinctive: line 197
Break long sessions into phases: Run 1-hour focused sessions instead of 4-hour marathons
- Very specific: line 199
Use the funnel: Write findings to disk immediately (see bug-bounty-workflow-funnel skill) so data survives compaction
- Distinctive: line 200
Start fresh sessions: If compaction is occurring, start a new Claude session with a summary of progress
- Very specific: line 243
When running autonomous sessions, the --dangerously-skip-permissions flag prevents Claude from asking for confirmation on every file write …
- Very specific: line 254
Best practice: Run Claude in a sandboxed VPS user account with restricted network access (firewall to scope IPs only).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Pair Hunting with Claude
When to Use
- When setting up Claude Code CLI to autonomously test a bug bounty target.
- When running overnight / multi-hour autonomous hacking sessions.
- When managing scope and context across multiple bug bounty programs.
- When Claude is getting stuck in compaction loops or losing context mid-session.
- When you need Claude to stay strictly within program scope.
Prerequisites
- Claude Code CLI installed and authenticated
- A defined bug bounty target with program policy
- Separate workspace directory per target program
- Understanding of Claude's context window limitations
Core Concept: Claude as a Pair Hunter
"AI is not your replacement. It is your Pair Hunter — it brings determinism (accuracy) and speed." — Critical Thinking Podcast, Ep. 166
Claude excels at:
- Deterministic tasks: Testing every parameter in a 200-param API
- Speed: Fuzzing/enumerating faster than manual testing
- Pattern recognition: Spotting anomalies in large response sets
- Documentation: Auto-generating reports from findings
Claude struggles with:
- Creative intuition: "This feels wrong" — that is YOUR job
- Out-of-scope judgment: Without explicit policy, Claude will test everything
- Long context retention: After ~100k tokens, context degrades
Workflow
Phase 1: Per-Target Context Management
"For every target, create a separate folder. Put a .claudemd file in it with the program's policy and scope." — Episode 166 [51:20]
Directory structure:
programs/
├── example-corp/
│ ├── .claudemd # ← THIS IS THE KEY FILE
│ ├── notes/
│ ├── leads/
│ ├── findings/
│ └── scripts/
├── another-target/
│ ├── .claudemd
│ └── ....claudemd template:
# Target: Example Corp Bug Bounty Program
## Program URL
https://hackerone.com/example-corp
## Scope — IN
- *.example.com
- api.example.com
- app.example.com (authenticated testing allowed)
- mobile-api.example.com
## Scope — OUT (DO NOT TEST)
- blog.example.com (third-party WordPress)
- status.example.com (StatusPage hosted)
- *.example.dev (staging — explicitly excluded)
- Any domain not listed above
## Rules of Engagement
- NO denial of service testing
- NO social engineering of employees
- NO accessing other users' data beyond proof of concept (read 1 record, stop)
- Rate limit: Max 10 requests/second
- Report vulnerabilities within 24 hours of confirmation
## Authentication
- Test account 1: testuser@example.com / [use env var AUTH_TOKEN_1]
- Test account 2: testadmin@example.com / [use env var AUTH_TOKEN_2]
- API Key: [use env var EXAMPLE_CORP_API_KEY]
## Tech Stack (Known)
- Frontend: React 18 + Next.js
- Backend: Node.js + Express
- Database: PostgreSQL (inferred from error messages)
- CDN: Cloudflare
- Auth: OAuth 2.0 + JWT
## Priority Targets
1. `/api/v2/users/*` — IDOR testing
2. `/api/v2/billing/*` — Payment logic flaws
3. `/upload/*` — File upload vulnerabilities
4. `/auth/*` — Authentication bypass
## Previous Findings (to avoid duplicates)
- XSS in /search — reported 2024-12, resolved
- IDOR in /api/v1/users/{id} — reported 2025-01, resolved (v2 untested)Why this works: When you run claude from inside programs/example-corp/, Claude
automatically reads .claudemd and constrains itself to the defined scope.
Phase 2: Autonomous Overnight Hacking
"I am going to bed. Don't ask for input. Keep hacking." — Episode 166 [40:01]
The overnight prompt:
I am going to sleep. Do not ask me for input or confirmation.
Your mission for the next 4 hours:
1. Read the .claudemd file for scope and rules.
2. Map all API endpoints on api.example.com using the scripts in scripts/.
3. For each endpoint, test the following:
- IDOR: Replace user IDs / resource IDs with other values.
- Broken auth: Access endpoints without auth token, with expired token, with wrong role.
- Input validation: Fuzz all parameters with payloads from scripts/fuzz-payloads.ts.
4. Log ALL findings to findings/ using the finding template.
5. Log all interesting observations to notes/.
6. Do NOT exceed 10 requests per second.
7. Do NOT test anything outside the scope defined in .claudemd.
When you finish, write a summary to overnight-report-[date].md with:
- Endpoints tested (count)
- Findings discovered (count + severity)
- Areas that need manual follow-up
- Errors encounteredKey considerations for overnight sessions:
| Factor | Guidance |
| Token usage | The session may cost $5-20+ in API tokens for 4 hours |
| Rate limits | Enforce in your scripts, not just in the prompt |
| Scope violations | The .claudemd scope section is critical safety net |
| False positives | Expect ~30-50% of "interesting" results to be false positives — triage in morning |
| Tool permissions | Pre-approve network access and file write permissions before sleeping |
Phase 3: Compaction Avoidance
"If you use too many sub-agents (4+), Claude gets stuck in a compacting loop. Keep it to 2-3 sub-agents max." — Episode 166 [41:11]
What is compaction? When Claude's context window fills up, it "compacts" by summarizing older conversation turns. If too many sub-agents are running, the compaction process itself fills the context, creating a death spiral.
Rules:
❌ BAD: Spawning 5+ parallel sub-agents
"Run these 5 separate tasks simultaneously..."
Result: Context fills → compaction loops → Claude freezes
✅ GOOD: Sequential tasks with 2-3 sub-agents max
"First enumerate endpoints, then test the top 10 for IDOR"
Result: Clean context, focused execution
✅ GOOD: Use scripts instead of sub-agents for parallel work
"Run scripts/parallel-fuzz.ts which handles 50 endpoints internally"
Result: Claude manages 1 task; the script handles parallelismCompaction warning signs:
- Claude starts repeating itself
- Responses become shorter and lose detail
- Claude "forgets" earlier findings in the same session
- Session time between responses increases dramatically
Mitigation strategies:
- Break long sessions into phases: Run 1-hour focused sessions instead of 4-hour marathons
- Offload parallelism to scripts: TypeScript scripts handle concurrency, Claude orchestrates
- Use the funnel: Write findings to disk immediately (see
bug-bounty-workflow-funnelskill) so data survives compaction - Start fresh sessions: If compaction is occurring, start a new Claude session with a summary of progress
Phase 4: Effective Prompting Patterns
Directive prompts (high autonomy):
Test all endpoints in api.example.com/v2/ for IDOR vulnerabilities.
Use the authenticated tokens from .claudemd. Log findings to findings/.
Do not stop until all endpoints are tested.Constraint prompts (safety rails):
You are ONLY allowed to test the following 3 endpoints:
- GET /api/v2/users/{id}
- POST /api/v2/users/{id}/update
- DELETE /api/v2/users/{id}
Do NOT test any other endpoint. Do NOT make more than 100 total requests.
After each test, write the result to notes/idor-test-results.md.Chain prompts (multi-step):
Phase 1: Enumerate all JavaScript files on app.example.com. Extract API endpoints,
secrets, and interesting variables. Save to notes/js-analysis.md.
Phase 2: For each API endpoint found in Phase 1, test for:
- Missing authentication
- IDOR via ID manipulation
- SQL injection via single-quote test
Save results to leads/.
Phase 3: For any confirmed vulnerability from Phase 2, create a full finding
document in findings/ with PoC.Phase 5: Security & Permissions
"We use
dangerouslySkipPermissions— but Claude has NO access to 1Password or personal email." — Episode 166
When running autonomous sessions, the --dangerously-skip-permissions flag prevents
Claude from asking for confirmation on every file write and network request. However,
you MUST harden the environment:
| ✅ Allow | ❌ Block |
| Network access to in-scope targets only | Password managers (1Password, Bitwarden) |
| Write to findings/notes/leads directories | Personal email clients |
| Execute scripts in the target workspace | SSH keys to production systems |
| Read source code directories | Cloud provider admin CLIs |
Best practice: Run Claude in a sandboxed VPS user account with restricted
network access (firewall to scope IPs only). See the remote-hunting-workflow
skill for full VPS setup, Discord bot, and tmux multi-target configurations.
Decision Point 🔀
flowchart TD
A[Starting a new target] --> B[Create target directory]
B --> C[Write .claudemd with scope + policy]
C --> D{How long will you hunt?}
D -->|"< 1 hour"| E[Interactive session with constraint prompts]
D -->|"1-4 hours"| F[Focused directive prompt, 2-3 sub-agents max]
D -->|"Overnight"| G[Overnight prompt with full autonomy]
E --> H{Claude losing context?}
F --> H
G --> H
H -->|Yes| I[Start new session with progress summary]
H -->|No| J[Continue hunting]
J --> K{Findings discovered?}
K -->|Yes| L[Promote through Funnel stages]
K -->|No| M[Expand test surface or switch targets]Anti-Patterns
| Anti-Pattern | Consequence | Fix |
No .claudemd file | Claude tests out-of-scope targets → policy violation → ban | Always create scope file first |
| 5+ sub-agents at once | Compaction death spiral, lost context | Max 2-3 sub-agents; offload to scripts |
| No rate limiting | Target's WAF blocks you; program bans your account | Enforce in scripts + prompt |
| Hardcoded auth tokens | Tokens leaked if skill/prompt is shared | Use environment variables |
| No disk persistence | Findings lost when context compacts | Write to files immediately |
| Vague overnight prompt | Claude wanders, tests irrelevant things | Specific objectives + strict scope |
Output Format
Pair Hunting Session Report
===========================
Target: example-corp
Duration: 3h 45m
Mode: Overnight autonomous
Endpoints Tested: 47
Requests Made: 1,842
Findings:
- [HIGH] IDOR in GET /api/v2/users/{id} — any user profile accessible
- [MEDIUM] Missing rate limit on POST /api/v2/auth/login — brute force possible
- [LOW] Verbose error messages on /api/v2/billing/charge with invalid card
Leads Requiring Manual Follow-up: 5
Notes Generated: 12 files
Context Health: ✅ No compaction issues
Scope Violations: ❌ NoneCreativity Directive
IMPORTANT: The instructions above are a STARTING POINT, not a boundary. You are expected to go beyond these steps:
- Develop your own prompting patterns for specific vulnerability classes.
- Create meta-skills that orchestrate other skills in sequence.
- Build monitoring scripts that alert you when Claude finds something critical overnight.
- Experiment with different context management strategies.
Think like an attacker. Adapt. Improvise.
🔵 Blue Team
- Deploy robust WAF rules to detect anomalies.
- Monitor logs for unusual access patterns.
📚 Shared Resources
For cross-cutting methodology applicable to all vulnerability classes, see:
_shared/references/elite-chaining-strategy.md— Exploit chaining methodology and high-payout chain patterns_shared/references/elite-report-writing.md— HackerOne-optimized report writing, CWE quick reference_shared/references/real-world-bounties.md— Verified disclosed bounties by vulnerability class
References
- Source Video: Building Claude Skills as a Bug Bounty Hunter — Critical Thinking Ep. 166 [40:01, 41:11, 51:20]
- Claude Code CLI Docs: https://docs.anthropic.com/en/docs/claude-code
- HackerOne Program Policies: https://docs.hackerone.com/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

