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. --- server/server_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'server/server_test.go') diff --git a/server/server_test.go b/server/server_test.go index 72f5b9c..d19c5e8 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -117,6 +117,16 @@ func TestCreateAndRead(t *testing.T) { } } +func TestCompactionBlock(t *testing.T) { + h := newHarness(t, nil) + withC := strings.Replace(session, `"c":[`, `"c":[{"r":"c","x":"earlier summary"},`, 1) + r := h.create(`{"payload":` + payload(withC) + `}`) + txt := h.do("GET", "/share/"+r.ID+".txt", "", "").Body.String() + if !strings.Contains(txt, "--- context compacted here ---") || strings.Contains(txt, "earlier summary") { + t.Fatalf("txt: %s", txt) + } +} + func TestUpdateAndDeleteNeedTheSecret(t *testing.T) { h := newHarness(t, nil) r := h.create(`{"payload":` + payload() + `}`) -- cgit v1.2.3