claudetranscript

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package claudetranscript reads a Claude Code session transcript to learn how large the main session's context is. The transcript format is internal to Claude Code and undocumented, so this reader recognizes only the versions listed in supportedVersions and reports nothing for anything else.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextTokens

func ContextTokens(path string) (tokens int64, ok bool)

ContextTokens returns the main session's current context size: the input, cache-creation and cache-read tokens of its latest assistant entry, output tokens excluded and subagent (sidechain) entries ignored. ok is false when the file is unreadable, holds no main-session assistant entry in its tail, or that latest entry is from an unrecognized version or lacks the usage fields.

func Recognized

func Recognized(version string) bool

Recognized reports whether version is one this reader was checked against.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL