File Locations
| File | Location | Purpose |
|---|---|---|
| Session | ~/.claude/projects/{hash}/{session}.jsonl | Conversation history |
| History | ~/.claude/projects/{hash}/history.jsonl | Session metadata |
Session File Format
Each line in the session file is a JSON object representing a message or event.Message Types
User Message
Assistant Message
Tool Use
Tool Result
Thinking (Extended Thinking)
History File Format
The history file tracks session metadata:Parsing Sessions
Python
JavaScript
Tool Types
Common tool types in Claude Agent SDK:| Tool | Purpose | Input |
|---|---|---|
read_file | Read file contents | { path: string } |
write_file | Write/create file | { path: string, content: string } |
edit_file | Edit file | { path: string, edits: [...] } |
run_command | Execute shell command | { command: string } |
search_files | Search for files | { pattern: string, path?: string } |
list_directory | List directory | { path: string } |