Discover Packages
github.com/zulerne/ccost
internal
parser
package
Version:
v0.8.6
Opens a new window with list of versions in this module.
Published: Mar 8, 2026
License: MIT
Opens a new window with license information.
Imports: 13
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Parse reads all JSONL files under ~/.claude/projects and returns deduplicated records and sessions.
type Entry struct {
Type string `json:"type"`
Timestamp string `json:"timestamp"`
CWD string `json:"cwd"`
Message Message `json:"message"`
}
type Message struct {
ID string `json:"id"`
Model string `json:"model"`
Usage Usage `json:"usage"`
}
Record is a deduplicated assistant entry with parsed time.
Session represents time spent in a main session file on a single day.
A session spanning multiple days produces one Session per day.
type Usage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
CacheCreationInputTokens int `json:"cache_creation_input_tokens"`
CacheReadInputTokens int `json:"cache_read_input_tokens"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.