agentleFS
ShulkwiSECShulkwiSEC/bb-huge/skills/curated/ai-pair-hunting-with-claude/SKILL.md

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

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
  1. Distinctive:

    When setting up Claude Code CLI to autonomously test a bug bounty target.

    line 25
  2. Distinctive:

    When running overnight / multi-hour autonomous hacking sessions.

    line 26
  3. Distinctive:

    When managing scope and context across multiple bug bounty programs.

    line 27
  4. Distinctive:

    When Claude is getting stuck in compaction loops or losing context mid-session.

    line 28
  5. Distinctive:

    When you need Claude to stay strictly within program scope.

    line 29
  6. Distinctive:

    Long context retention: After ~100k tokens, context degrades

    line 52
  7. Very specific:

    Why this works: When you run claude from inside programs/example-corp/, Claude automatically reads .claudemd and constrains itself to the …

    line 125
  8. Distinctive:

    What is compaction?: When Claude's context window fills up, it "compacts" by summarizing older conversation turns.

    line 171
  9. Distinctive:

    Break long sessions into phases: Run 1-hour focused sessions instead of 4-hour marathons

    line 197
  10. Very specific:

    Use the funnel: Write findings to disk immediately (see bug-bounty-workflow-funnel skill) so data survives compaction

    line 199
  11. Distinctive:

    Start fresh sessions: If compaction is occurring, start a new Claude session with a summary of progress

    line 200
  12. Very specific:

    When running autonomous sessions, the --dangerously-skip-permissions flag prevents Claude from asking for confirmation on every file write …

    line 243
  13. Very specific:

    Best practice: Run Claude in a sandboxed VPS user account with restricted network access (firewall to scope IPs only).

    line 254

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 encountered

Key considerations for overnight sessions:

FactorGuidance
Token usageThe session may cost $5-20+ in API tokens for 4 hours
Rate limitsEnforce in your scripts, not just in the prompt
Scope violationsThe .claudemd scope section is critical safety net
False positivesExpect ~30-50% of "interesting" results to be false positives — triage in morning
Tool permissionsPre-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 parallelism

Compaction 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:

  1. Break long sessions into phases: Run 1-hour focused sessions instead of 4-hour marathons
  2. Offload parallelism to scripts: TypeScript scripts handle concurrency, Claude orchestrates
  3. Use the funnel: Write findings to disk immediately (see bug-bounty-workflow-funnel skill) so data survives compaction
  4. 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 onlyPassword managers (1Password, Bitwarden)
Write to findings/notes/leads directoriesPersonal email clients
Execute scripts in the target workspaceSSH keys to production systems
Read source code directoriesCloud 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-PatternConsequenceFix
No .claudemd fileClaude tests out-of-scope targets → policy violation → banAlways create scope file first
5+ sub-agents at onceCompaction death spiral, lost contextMax 2-3 sub-agents; offload to scripts
No rate limitingTarget's WAF blocks you; program bans your accountEnforce in scripts + prompt
Hardcoded auth tokensTokens leaked if skill/prompt is sharedUse environment variables
No disk persistenceFindings lost when context compactsWrite to files immediately
Vague overnight promptClaude wanders, tests irrelevant thingsSpecific 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: ❌ None

Creativity 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.