ctx-profiler

v0.1.1
io.github.cuhawk/ctx-profiler Checked 4 days ago Published 6 days ago

MECE token waste profiler and compaction simulator for Claude Code, Codex, Cline & OpenClaw logs.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

analyze_session_log

Parse a coding-agent session log file or directory (Claude Code, Codex, Cline/Roo, OpenClaw, OpenAI trace) and return exact MECE 6-category token attribution, waste ratio %, and estimated dollar cost.

ParameterTypeDescription
path *stringAbsolute or relative path to a session log file (.jsonl/.json) or directory.
agentstringAgent log format (defaults to auto-detection).
cached_pricenumber
input_pricenumber
modelstringPricing profile used for cost estimation.
output_pricenumber
tool_bloat_thresholdintegerToken threshold above which non-file-read tool output is counted as bloat.

simulate_compaction

Simulate 5 deterministic context-compaction policies (dedup-rereads, cap-tool-output-2k, strip-think-replay, lazy-mcp-schemas, combined-all) on coding-agent logs and return exact before/after token counts, reduction %, and estimated USD savings per 100 sessions.

ParameterTypeDescription
path *stringAbsolute or relative path to a session log file (.jsonl/.json) or directory.
agentstring
cached_pricenumber
input_pricenumber
modelstring
output_pricenumber
tool_bloat_thresholdinteger