Skip to content
charles-proxy-extract logo

Charles Proxy Session Extractor

charles-proxy-extract

Extracts HTTP/HTTPS request and response data from Charles Proxy session files (.chlsj format), including URLs, methods, status codes, headers, request bodies, and response bodies. Use when analyzing captured network traffic from Charles Proxy debug sessions, inspecting API calls, debugging HTTP ...

SKILL.md

Full skill instructions

Charles Proxy Session Extractor

Parses and extracts structured data from Charles Proxy session files (.chlsj format).

Prerequisites

  • Python 3.x (no external dependencies required)
  • Charles Proxy session file in .chlsj format

When to Use This Skill

Use this skill when the user:

  • Mentions "Charles Proxy" or "Charles session"
  • Asks to "extract", "analyze", or "inspect" .chlsj files
  • Wants to filter HTTP/​HTTPS requests by endpoint or method
  • Needs to examine API request/​response data from proxy logs
  • Wants to export network traffic data to JSON

How to Execute This Skill

When the user asks to extract, analyze, or inspect Charles Proxy session files, run the Python script using the Bash tool:

python3 ./​extract_responses.py <file.chlsj> <pattern> [options]

Required Parameters

  1. <file.chlsj> - Path to the Charles Proxy session file (use exact path provided by user)
  2. <pattern> - URL path pattern to match (e.g., "/​today", "/​logs", "/" for all)

Optional Flags

  • -m, --method METHOD - Filter by HTTP method (GET, POST, PUT, PATCH, DELETE)
  • -f, --first-only - Show only first matching request (for quick inspection)
  • -s, --summary-only - Show statistics without response bodies
  • -o, --output FILE - Save responses to JSON file
  • --no-pretty - Disable JSON pretty-printing

Execution Examples

Extract all /​today responses:

python3 ./​extract_responses.py session.chlsj "/​today"

Filter by POST method (automatically shows request bodies):

python3 ./​extract_responses.py session.chlsj "/​logs" --method POST

Quick peek (first result only):

python3 ./​extract_responses.py session.chlsj "/​users" --first-only

Summary without bodies:

python3 ./​extract_responses.py session.chlsj "/" --summary-only

Export to file:

python3 ./​extract_responses.py session.chlsj "/​items" --output items_data.json

User Request Patterns

When users say things like:

  • "Extract [endpoint] from [file]" → Use basic extraction with pattern matching
  • "Show POST/​PUT/​PATCH to [endpoint]" → Add --method flag (request bodies auto-shown)
  • "First [endpoint] response" → Add --first-only flag
  • "Summarize [file]" or "What's in [file]" → Add --summary-only flag
  • "Save [endpoint] to [output]" → Add --output flag
  • "Compare [endpoint] with model" → Extract first response, then analyze structure

Important Notes

  • Pattern matching is case-sensitive substring matching
  • Method filtering is case-insensitive
  • POST/​PUT/​PATCH methods automatically display request bodies when method filter is applied
  • Use "/" as pattern to match all requests

What This Skill Does

Extracts HTTP/​HTTPS request and response data from Charles Proxy session files, allowing you to:

  • Filter requests by URL pattern (substring matching)
  • Filter requests by HTTP method (GET, POST, PUT, PATCH, DELETE)
  • View request bodies for mutation operations (POST/​PUT/​PATCH)
  • Export extracted data to JSON files
  • Generate traffic summaries with statistics
  • Pretty-print JSON response bodies

Input Requirements

Required:

  • Path to Charles Proxy session file (.chlsj format)
  • URL pattern to match (use "/" to match all requests)

Optional:

  • HTTP method filter (GET, POST, PUT, PATCH, DELETE)
  • Output mode (full, first-only, summary-only)
  • Output file path for JSON export
  • Pretty-print toggle for JSON formatting

Output Format

Summary mode:

  • Pattern match statistics
  • Grouped paths with request counts
  • Method and status code distribution

Full mode:

  • Request details (method, path, status, timestamp)
  • Request body (for POST/​PUT/​PATCH when method filter applied)
  • Response body (JSON parsed or raw text)
  • Pretty-printed JSON by default

Export mode:

  • JSON file with structure:
    {
      "pattern": "/​api/​endpoint",
      "total_requests": 10,
      "extracted_at": "ISO8601 timestamp",
      "requests": [...]
    }
    

Common Usage Scenarios

"Extract all /​today responses from session.chlsj" → Shows all requests matching /​today pattern

"Show POST requests to /​logs with request bodies" → Filters by POST method and displays request bodies

"Export all /​items responses to items.json" → Saves filtered responses to JSON file

"Summarize requests in the Charles session" → Shows statistics without response bodies

Limitations

  • Only supports Charles Proxy JSON session format (.chlsj)
  • Pattern matching is case-sensitive substring matching
  • Method filtering is case-insensitive
  • Large response bodies may be truncated in display (not in exports)
  • Requires Python 3.x with standard library only (no external dependencies)

Error Handling

The skill handles:

  • Missing or inaccessible files (clear error message)
  • Invalid JSON in session files (decoding error details)
  • Empty result sets (informative message)
  • Malformed request/​response structures (graceful degradation)

Troubleshooting

"File not found" error:

  • Verify the .chlsj file path is correct
  • Use absolute paths or ensure the file is in the current directory

"Invalid JSON" error:

  • Ensure the file is a valid Charles Proxy session export
  • Re-export the session from Charles Proxy

No results found:

  • Pattern matching is case-sensitive - check capitalization
  • Try using "/" to match all requests first
  • Verify the endpoint exists in the session file using --summary-only

Python not found:

  • Ensure Python 3.x is installed and available in PATH
  • Try using python instead of python3 or vice versa

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View