From a5896fe2e28eb1e9ff9affe5d47ccd443bee5fc2 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 3 Oct 2026 19:47:45 -0300 Subject: Use the /rename title, mark compactions, count active time A title set with /rename (custom-title) now wins over Claude's. The summary Claude Code leaves when the context is compacted is a block of its own ("c"), shown as a "context compacted here" mark instead of a message of yours, and not counted. Duration is active time: pauses over 30 minutes between messages are left out. --- claude_logbook/terminal.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'claude_logbook/terminal.py') diff --git a/claude_logbook/terminal.py b/claude_logbook/terminal.py index 65af046..61d05d8 100644 --- a/claude_logbook/terminal.py +++ b/claude_logbook/terminal.py @@ -214,6 +214,16 @@ def print_chat(s, st, out, show_tools=True, width=None): first = True for m in s["c"]: + if m["r"] == "c": + # The summary is long and Claude's, not part of the dialogue: + # only the mark of where the earlier context was folded. + if not first: + print(file=out) + first = False + label = " context compacted here " + side = max(3, (min(width, 80) - len(label)) // 2) + print(f"{st.faint}{'─' * side}{label}{'─' * side}{st.reset}", file=out) + continue if m["r"] == "t": if show_tools: print(f" {st.faint}⚒ {clip(m['x'], body - 4)}{st.reset}", file=out) -- cgit v1.2.3