
Charles Proxy Extract
- 1 installs
- 51 repo stars
- Updated April 16, 2026
- eric861129/skills_all-in-one
Extract API requests and data from Charles Proxy captures for reverse-engineering and API integration.
About
Charles Proxy Extract parses Charles Proxy HTTP captures to extract API endpoints and request/response data. Use for understanding undocumented APIs and reverse-engineering integrations.
- Charles Proxy capture parsing.
- API endpoint and request extraction.
Charles Proxy Extract by the numbers
- 1 all-time installs (skills.sh)
- Ranked #488 of 596 Debugging skills by installs in the Skillselion catalog
- Data as of Jul 15, 2026 (Skillselion catalog sync)
npx skills add https://github.com/eric861129/skills_all-in-one --skill charles-proxy-extractAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 51 |
| Last updated | April 16, 2026 |
| Repository | eric861129/skills_all-in-one ↗ |
What it does
Extract API requests and data from Charles Proxy captures for reverse-engineering and API integration.
Files
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 POSTQuick peek (first result only):
python3 ./extract_responses.py session.chlsj "/users" --first-onlySummary without bodies:
python3 ./extract_responses.py session.chlsj "/" --summary-onlyExport to file:
python3 ./extract_responses.py session.chlsj "/items" --output items_data.jsonUser Request Patterns
When users say things like:
- "Extract [endpoint] from [file]" → Use basic extraction with pattern matching
- "Show POST/PUT/PATCH to [endpoint]" → Add
--methodflag (request bodies auto-shown) - "First [endpoint] response" → Add
--first-onlyflag - "Summarize [file]" or "What's in [file]" → Add
--summary-onlyflag - "Save [endpoint] to [output]" → Add
--outputflag - "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
pythoninstead ofpython3or vice versa
#!/usr/bin/env python3
"""
Charles Proxy Response Extractor
Usage:
python extract_responses.py <file.chlsj> <path_pattern> [options]
Examples:
# Extract all /today responses
python extract_responses.py file.chlsj "/today"
# Extract all /items responses
python extract_responses.py file.chlsj "/items"
# Filter by HTTP method (shows request body for POST/PUT/PATCH)
python extract_responses.py file.chlsj "/logs" --method POST
# Extract and save to file
python extract_responses.py file.chlsj "/logs-by-day" --output logs_responses.json
# Pretty print first response only
python extract_responses.py file.chlsj "/users" --first-only
# Show summary only (no response bodies)
python extract_responses.py file.chlsj "/today" --summary-only
"""
import argparse
import json
import sys
from datetime import datetime
from typing import Any, Dict, List, Optional
def load_charles_session(file_path: str) -> List[Dict[str, Any]]:
"""Load Charles session file."""
try:
with open(file_path, 'r') as f:
data = json.load(f)
return data
except FileNotFoundError:
print(f"❌ Error: File not found: {file_path}")
sys.exit(1)
except json.JSONDecodeError as e:
print(f"❌ Error: Invalid JSON in file: {e}")
sys.exit(1)
def filter_requests(requests: List[Dict], path_pattern: str, method_filter: Optional[str] = None) -> List[Dict]:
"""Filter requests by path pattern (contains) and optionally by HTTP method."""
filtered = [req for req in requests if path_pattern in req.get('path', '')]
if method_filter:
method_upper = method_filter.upper()
filtered = [req for req in filtered if req.get('method', '').upper() == method_upper]
return filtered
def extract_response_body(request: Dict) -> Any:
"""Extract and parse response body."""
response = request.get('response', {})
body = response.get('body', {})
text = body.get('text', '')
if not text:
return None
try:
return json.loads(text)
except json.JSONDecodeError:
return text # Return raw text if not JSON
def extract_request_body(request: Dict) -> Any:
"""Extract and parse request body."""
req = request.get('request', {})
body = req.get('body', {})
text = body.get('text', '')
if not text:
return None
try:
return json.loads(text)
except json.JSONDecodeError:
return text # Return raw text if not JSON
def print_summary(requests: List[Dict], path_pattern: str):
"""Print summary of filtered requests."""
print(f"\n{'='*80}")
print("CHARLES SESSION ANALYSIS")
print(f"{'='*80}")
print(f"Pattern: '{path_pattern}'")
print(f"Matching requests: {len(requests)}")
print(f"{'='*80}\n")
if not requests:
print("❌ No matching requests found.")
return
# Group by path
path_counts = {}
for req in requests:
path = req.get('path', 'unknown')
path_counts[path] = path_counts.get(path, 0) + 1
print("📊 Paths found:")
for path, count in sorted(path_counts.items()):
print(f" {path} ({count} request{'s' if count > 1 else ''})")
print()
def print_request_details(request: Dict, index: int, total: int, show_request_body: bool = False):
"""Print detailed information about a single request."""
path = request.get('path', 'unknown')
method = request.get('method', 'GET')
status = request.get('response', {}).get('status', 'N/A')
# Get timing info
times = request.get('times', {})
start_time = times.get('start', 'N/A')
print(f"\n{'─'*80}")
print(f"REQUEST {index + 1}/{total}")
print(f"{'─'*80}")
print(f"Method: {method}")
print(f"Path: {path}")
print(f"Status: {status}")
print(f"Time: {start_time}")
print(f"{'─'*80}")
# Show request body for mutation operations
if show_request_body and method.upper() in ['POST', 'PUT', 'PATCH']:
request_body = extract_request_body(request)
if request_body:
print("\nRequest Body:")
if isinstance(request_body, str):
print(request_body[:500])
if len(request_body) > 500:
print(f"... ({len(request_body) - 500} more characters)")
else:
print(json.dumps(request_body, indent=2))
print(f"{'─'*80}")
def print_response_body(body: Any, pretty: bool = True):
"""Print response body."""
if body is None:
print("⚠️ No response body")
return
if isinstance(body, str):
print("\nResponse (text):")
print(body[:500]) # Limit text responses
if len(body) > 500:
print(f"... ({len(body) - 500} more characters)")
else:
print("\nResponse (JSON):")
if pretty:
print(json.dumps(body, indent=2))
else:
print(json.dumps(body))
def save_responses(requests: List[Dict], output_file: str, path_pattern: str):
"""Save all responses to a file."""
results = {
'pattern': path_pattern,
'total_requests': len(requests),
'extracted_at': datetime.now().isoformat(),
'requests': []
}
for req in requests:
body = extract_response_body(req)
results['requests'].append({
'path': req.get('path'),
'method': req.get('method'),
'status': req.get('response', {}).get('status'),
'response': body
})
with open(output_file, 'w') as f:
json.dump(results, f, indent=2)
print(f"✅ Saved {len(requests)} responses to: {output_file}")
def main():
parser = argparse.ArgumentParser(
description='Extract responses from Charles Proxy session files',
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=__doc__
)
parser.add_argument('file', help='Charles session file (.chlsj)')
parser.add_argument('pattern', help='Path pattern to match (contains)')
parser.add_argument('-o', '--output', help='Output file to save responses')
parser.add_argument('-m', '--method', help='Filter by HTTP method (GET, POST, PUT, PATCH, DELETE)')
parser.add_argument('-f', '--first-only', action='store_true',
help='Show only the first matching request')
parser.add_argument('-s', '--summary-only', action='store_true',
help='Show summary only, no response bodies')
parser.add_argument('--no-pretty', action='store_true',
help='Disable pretty printing of JSON')
args = parser.parse_args()
# Load and filter requests
all_requests = load_charles_session(args.file)
filtered_requests = filter_requests(all_requests, args.pattern, args.method)
# Determine if we should show request bodies (for POST/PUT/PATCH)
show_request_body = args.method and args.method.upper() in ['POST', 'PUT', 'PATCH']
# Print summary
print_summary(filtered_requests, args.pattern)
if not filtered_requests:
sys.exit(1)
# Save to file if requested
if args.output:
save_responses(filtered_requests, args.output, args.pattern)
if args.summary_only:
return
# Print responses
if not args.summary_only:
requests_to_show = [filtered_requests[0]] if args.first_only else filtered_requests
for i, req in enumerate(requests_to_show):
print_request_details(req, i, len(requests_to_show), show_request_body=show_request_body)
body = extract_response_body(req)
print_response_body(body, pretty=not args.no_pretty)
if args.first_only and len(filtered_requests) > 1:
print(f"\n💡 Showing 1 of {len(filtered_requests)} matching requests.")
print(" Remove --first-only to see all responses.")
if __name__ == '__main__':
main()
MIT License
Copyright (c) 2025 Sergey Pronin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Charles Proxy Session Extractor
A Claude Code skill that extracts and analyzes HTTP/HTTPS request and response data from Charles Proxy session files (.chlsj format).
When debugging API integrations or analyzing network traffic, simply mention a .chlsj file and Claude will automatically use this skill to parse and present the data.
Zero dependencies - uses Python standard library only.
Features
- Pattern-based filtering - extract requests by URL pattern
- Method filtering - filter by HTTP method (GET, POST, PUT, PATCH, DELETE)
- Request body inspection - view request bodies for POST/PUT/PATCH operations
- JSON export - save filtered responses for further analysis
- Summary mode - get quick traffic overview without full response bodies
- Pretty-printed output - formatted JSON by default for readability
How It Works
1. Export a session from Charles Proxy in .chlsj (JSON) format 2. Reference the file when chatting with Claude Code 3. Claude automatically detects the file type and uses this skill 4. Get filtered, formatted request/response data instantly
Prerequisites
- Python 3.x (no external dependencies required)
- Charles Proxy session files exported in
.chlsjformat
Installation
For Claude Code Users
Clone this repository into your skills directory:
# User-level (available in all projects)
git clone https://github.com/yourusername/charles-proxy-extract ~/.claude/skills/charles-proxy-extract
# Project-level (available in specific project)
git clone https://github.com/yourusername/charles-proxy-extract .claude/skills/charles-proxy-extractThat's it! No additional dependencies to install.
Standalone Usage
If you want to use the script without Claude Code, just ensure Python 3.x is installed:
which python3Using with Claude Code
Once installed, Claude will automatically suggest this skill when you mention Charles Proxy files. Try phrases like:
- "Extract the /api/users responses from session.chlsj"
- "Show me POST requests to /logs in this Charles session"
- "Analyze the network traffic in debug-session.chlsj"
- "Export all /items responses to a JSON file"
- "Summarize what's in this Charles session file"
- "Show the first /api/auth request"
Claude will use this skill to parse the file and present the results in a clear, formatted way.
Standalone Usage
You can also use the script directly from the command line:
python3 ./extract_responses.py <file.chlsj> <path_pattern> [options]Arguments
file- Charles session file (.chlsjformat)pattern- String pattern to match in URL paths (case-sensitive)
Options
| Option | Description |
|---|---|
-m, --method METHOD | Filter by HTTP method (GET, POST, PUT, PATCH, DELETE) |
-f, --first-only | Show only the first matching request |
-s, --summary-only | Show summary stats without response bodies |
-o, --output FILE | Save all responses to a JSON file |
--no-pretty | Disable pretty-printing of JSON responses |
-h, --help | Show help message |
Note: When filtering by POST, PUT, or PATCH methods, request bodies are automatically displayed along with responses.
Workflow Examples
# Explore available endpoints
python3 ./extract_responses.py session.chlsj "/" --summary-only
# Inspect specific endpoint
python3 ./extract_responses.py session.chlsj "/logs" --method POST
# Quick peek at first result
python3 ./extract_responses.py session.chlsj "/api/users" --first-only
# Save all responses for analysis
python3 ./extract_responses.py session.chlsj "/items" -o items-response.json
# Filter POST requests with bodies
python3 ./extract_responses.py session.chlsj "/submit" --method POSTExample Output
Summary Mode
Found 145 total requests in session
Pattern '/api/logs' matched 12 requests
Matched paths:
/api/logs/submit (8 requests)
/api/logs/query (4 requests)
Methods: POST: 8, GET: 4
Status codes: 200: 11, 404: 1Full Mode
Request 1/12: POST /api/logs/submit
Status: 200 OK
Timestamp: 2025-12-28T10:15:23Z
Request Body:
{
"level": "error",
"message": "Connection timeout"
}
Response:
{
"id": "log_123",
"status": "recorded"
}Export Mode
Creates a JSON file with structure:
{
"pattern": "/api/logs",
"total_requests": 12,
"extracted_at": "2025-12-28T10:15:23Z",
"requests": [
{
"method": "POST",
"path": "/api/logs/submit",
"status": 200,
"timestamp": "2025-12-28T10:15:23Z",
"request_body": {...},
"response": {...}
}
]
}Tips
Pattern Matching
Patterns use simple substring matching (case-sensitive):
/historymatches/history/5fd95c39.../2025-12-04/itemsmatches both/items/...and/items-by-day/.../matches all requests (useful for summary mode)
Best Practices
1. Start with summary mode - Use --summary-only to understand what's in the session 2. Narrow down gradually - Start broad, then filter by method or pattern 3. Use first-only for inspection - Add --first-only when you just need a sample 4. Export for analysis - Use -o to save data for programmatic analysis
Troubleshooting
"File not found"
- Verify the
.chlsjfile path is correct - Use absolute paths or ensure you're in the right directory
"Invalid JSON"
- Ensure the file is a valid Charles Proxy session export
- Re-export the session from Charles Proxy in
.chlsjformat
No matching requests
- Pattern matching is case-sensitive - check capitalization
- Try broader pattern (e.g.,
/matches everything) - Use
--summary-onlyto see all available paths
Python not found
- Ensure Python 3.x is installed and available in PATH
- Try using
pythoninstead ofpython3or vice versa
Integration Use Cases
This skill is particularly useful for:
- Extracting sample data - Generate test fixtures from real API traffic
- Debugging integrations - Identify discrepancies between expected and actual API behavior
- Documenting APIs - Extract real-world examples for API documentation
- Model updates - Find new fields or enum values not yet in your models
- Regression testing - Compare API responses before and after changes
- Performance analysis - Identify slow endpoints or large payloads
Related Tools
- **Charles Proxy** - HTTP debugging proxy for macOS, Windows, and Linux
- **Claude Code** - AI-powered coding assistant
License
MIT License - see LICENSE.md for details.
Contributing
Contributions are welcome! Feel free to:
- Open issues for bugs or feature requests
- Submit pull requests for improvements
- Share your use cases and feedback