{"id":35066667,"url":"https://github.com/spences10/cclog","last_synced_at":"2026-01-31T13:50:56.485Z","repository":{"id":328661142,"uuid":"1116278988","full_name":"spences10/cclog","owner":"spences10","description":"🔄️ Sync Claude Code transcripts to SQLite for analytics, uses bun:sqlite","archived":false,"fork":false,"pushed_at":"2026-01-17T20:54:18.000Z","size":53,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T07:20:40.740Z","etag":null,"topics":["bun-sqlite","claude-code","sqlite"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spences10.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-14T14:55:39.000Z","updated_at":"2026-01-17T20:54:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/spences10/cclog","commit_stats":null,"previous_names":["spences10/cclog"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/spences10/cclog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fcclog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fcclog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fcclog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fcclog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spences10","download_url":"https://codeload.github.com/spences10/cclog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fcclog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28944789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T13:02:32.153Z","status":"ssl_error","status_checked_at":"2026-01-31T13:00:07.528Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun-sqlite","claude-code","sqlite"],"created_at":"2025-12-27T11:31:46.885Z","updated_at":"2026-01-31T13:50:56.471Z","avatar_url":"https://github.com/spences10.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cclog\n\nSync Claude Code transcripts to SQLite for analytics.\n\n## Install\n\n### Binary (recommended)\n\n| File                                                                                                         | Platform                  |\n| ------------------------------------------------------------------------------------------------------------ | ------------------------- |\n| [`cclog-linux-x64`](https://github.com/spences10/cclog/releases/latest/download/cclog-linux-x64)             | Linux (Intel/AMD)         |\n| [`cclog-linux-arm64`](https://github.com/spences10/cclog/releases/latest/download/cclog-linux-arm64)         | Linux (ARM, Raspberry Pi) |\n| [`cclog-darwin-x64`](https://github.com/spences10/cclog/releases/latest/download/cclog-darwin-x64)           | macOS (Intel)             |\n| [`cclog-darwin-arm64`](https://github.com/spences10/cclog/releases/latest/download/cclog-darwin-arm64)       | macOS (Apple Silicon)     |\n| [`cclog-windows-x64.exe`](https://github.com/spences10/cclog/releases/latest/download/cclog-windows-x64.exe) | Windows                   |\n\nOr use curl:\n\n```bash\n# Linux (x64)\ncurl -fsSL https://github.com/spences10/cclog/releases/latest/download/cclog-linux-x64 -o ~/.local/bin/cclog \u0026\u0026 chmod +x ~/.local/bin/cclog\n\n# Linux (arm64)\ncurl -fsSL https://github.com/spences10/cclog/releases/latest/download/cclog-linux-arm64 -o ~/.local/bin/cclog \u0026\u0026 chmod +x ~/.local/bin/cclog\n\n# macOS (Apple Silicon)\ncurl -fsSL https://github.com/spences10/cclog/releases/latest/download/cclog-darwin-arm64 -o /usr/local/bin/cclog \u0026\u0026 chmod +x /usr/local/bin/cclog\n\n# macOS (Intel)\ncurl -fsSL https://github.com/spences10/cclog/releases/latest/download/cclog-darwin-x64 -o /usr/local/bin/cclog \u0026\u0026 chmod +x /usr/local/bin/cclog\n```\n\n### From source\n\nRequires [Bun](https://bun.sh) \u003e= 1.0:\n\n```bash\ngit clone https://github.com/spences10/cclog.git\ncd cclog\nbun install\nbun src/index.ts sync\n```\n\n## Usage\n\n```bash\n# Sync transcripts from ~/.claude/projects to SQLite\ncclog sync\n\n# Show stats\ncclog stats\n\n# Help\ncclog --help\n```\n\n### From source\n\n```bash\nbun src/index.ts sync\nbun src/index.ts stats\n```\n\n### Commands\n\n| Command | Description                                |\n| ------- | ------------------------------------------ |\n| `sync`  | Import transcripts and teams (incremental) |\n| `stats` | Show session/message/team/token counts     |\n\n### Options\n\n| Flag              | Description                                          |\n| ----------------- | ---------------------------------------------------- |\n| `-v, --verbose`   | Show files being processed                           |\n| `-d, --db \u003cpath\u003e` | Custom database path (default: `~/.claude/cclog.db`) |\n\n## Database Schema\n\n```mermaid\nerDiagram\n    sessions ||--o{ messages : contains\n    sessions ||--o{ tool_calls : contains\n    sessions ||--o{ tool_results : contains\n    sessions ||--o| teams : \"lead session\"\n    messages ||--o{ tool_calls : has\n    messages ||--o{ tool_results : has\n    tool_calls ||--o{ tool_results : produces\n    teams ||--o{ team_members : has\n    teams ||--o{ team_tasks : has\n\n    sessions {\n        text id PK\n        text project_path\n        text git_branch\n        text cwd\n        int first_timestamp\n        int last_timestamp\n        text summary\n    }\n\n    messages {\n        text uuid PK\n        text session_id FK\n        text parent_uuid\n        text type\n        text model\n        text content_text\n        text content_json\n        text thinking\n        int timestamp\n        int input_tokens\n        int output_tokens\n        int cache_read_tokens\n        int cache_creation_tokens\n    }\n\n    tool_calls {\n        text id PK\n        text message_uuid FK\n        text session_id FK\n        text tool_name\n        text tool_input\n        int timestamp\n    }\n\n    tool_results {\n        int id PK\n        text tool_call_id FK\n        text message_uuid FK\n        text session_id FK\n        text content\n        int is_error\n        int timestamp\n    }\n\n    teams {\n        text id PK\n        text name\n        text description\n        text lead_session_id FK\n        int created_at\n    }\n\n    team_members {\n        text id PK\n        text team_id FK\n        text name\n        text agent_type\n        text model\n        text prompt\n        text color\n        text cwd\n        int joined_at\n    }\n\n    team_tasks {\n        text id PK\n        text team_id FK\n        text owner_name\n        text subject\n        text description\n        text status\n        int created_at\n        int completed_at\n    }\n\n    sync_state {\n        text file_path PK\n        int last_modified\n        int last_byte_offset\n    }\n```\n\n### Team/Swarm Support\n\nSyncs team data from `~/.claude/teams/` when Claude Code's swarm mode\nis enabled.\n\n**Why track teams?**\n\n- Debug runaway agents: compare `prompt` (original instructions) vs\n  actual behavior\n- Link swarm runs to sessions and PRs\n- Track task assignments and completion\n\n## Example Queries\n\n```sql\n-- Token usage by project\nSELECT project_path, SUM(input_tokens + output_tokens) as tokens\nFROM sessions s\nJOIN messages m ON m.session_id = s.id\nGROUP BY project_path\nORDER BY tokens DESC;\n\n-- Daily message count\nSELECT DATE(timestamp/1000, 'unixepoch') as day, COUNT(*) as messages\nFROM messages\nGROUP BY day\nORDER BY day DESC;\n\n-- Most used models\nSELECT model, COUNT(*) as count\nFROM messages\nWHERE model IS NOT NULL\nGROUP BY model\nORDER BY count DESC;\n\n-- Tool usage breakdown\nSELECT tool_name, COUNT(*) as count\nFROM tool_calls\nGROUP BY tool_name\nORDER BY count DESC;\n\n-- Files read in a session\nSELECT tc.tool_name, json_extract(tc.tool_input, '$.file_path') as file\nFROM tool_calls tc\nWHERE tc.tool_name = 'Read' AND tc.session_id = 'your-session-id';\n\n-- Code changes (edits) with before/after\nSELECT\n  json_extract(tc.tool_input, '$.file_path') as file,\n  json_extract(tc.tool_input, '$.old_string') as old,\n  json_extract(tc.tool_input, '$.new_string') as new\nFROM tool_calls tc\nWHERE tc.tool_name = 'Edit';\n\n-- Session cost estimate (Opus 4.5)\nSELECT\n  s.project_path,\n  SUM(m.input_tokens) / 1000000.0 * 15 +\n  SUM(m.output_tokens) / 1000000.0 * 75 +\n  SUM(m.cache_read_tokens) / 1000000.0 * 1.5 +\n  SUM(m.cache_creation_tokens) / 1000000.0 * 18.75 as cost_usd\nFROM sessions s\nJOIN messages m ON m.session_id = s.id\nWHERE m.model LIKE '%opus%'\nGROUP BY s.id\nORDER BY cost_usd DESC;\n\n-- Teams with member count\nSELECT t.name, t.description, COUNT(tm.id) as members\nFROM teams t\nLEFT JOIN team_members tm ON tm.team_id = t.id\nGROUP BY t.id;\n\n-- Agent prompts for debugging (what were they told to do?)\nSELECT name, prompt FROM team_members WHERE team_id = 'your-team-id';\n\n-- Task status by team\nSELECT team_id, status, COUNT(*) as count\nFROM team_tasks\nGROUP BY team_id, status;\n\n-- Link Teammate tool calls to team configs\nSELECT tc.timestamp, t.name, t.description\nFROM tool_calls tc\nJOIN teams t ON json_extract(tc.tool_input, '$.team_name') = t.name\nWHERE tc.tool_name = 'Teammate';\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspences10%2Fcclog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspences10%2Fcclog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspences10%2Fcclog/lists"}