Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Rewrite the home path in the share title when it is passed explicitly

Claude766633b5aa6f
diff --git a/pkg/asymptoteobserve/share.go b/pkg/asymptoteobserve/share.go
index f9d2ce16..a4c591aa 100644
--- a/pkg/asymptoteobserve/share.go
+++ b/pkg/asymptoteobserve/share.go
@@ -1402,12 +1402,9 @@ func ShareMetadataFromEventsWithOptions(events []Event, opts ShareOptions) Share
meta.RelationshipType = ShareRelationshipResume
}
}
- home := ""
- if !opts.NoHomeLookup {
- home = opts.HomeDirectory
- if home == "" {
- home, _ = os.UserHomeDir()
- }
+ home := opts.HomeDirectory
+ if home == "" && !opts.NoHomeLookup {
+ home, _ = os.UserHomeDir()
}
if firstPrompt != "" {
meta.Title = ShareTitle(newPathScrubber(firstNonEmptyString(opts.WorkingDirectory, workDir), home).text(firstPrompt))
diff --git a/pkg/asymptoteobserve/share_test.go b/pkg/asymptoteobserve/share_test.go
index a9738cd0..b5b5de7a 100644
--- a/pkg/asymptoteobserve/share_test.go
+++ b/pkg/asymptoteobserve/share_test.go
@@ -514,3 +514,12 @@ func TestBuildShareMessagesKeepsRepeatedPhaselessCallsApart(t *testing.T) {
t.Fatalf("parts = %v", got)
}
}
+
+func TestShareMetadataUsesExplicitHomeWithoutLookup(t *testing.T) {
+ prompt := shareEventAt("2026-10-01T10:00:00Z", "claude_code", CollectionMethodHook, "prompt.submitted", "prompt")
+ prompt.Prompt = &PromptInfo{Text: "look at /home/al/secret"}
+ meta := ShareMetadataFromEventsWithOptions([]Event{prompt}, ShareOptions{HomeDirectory: "/home/al", NoHomeLookup: true})
+ if meta.Title != "look at ~/secret" {
+ t.Fatalf("title = %q", meta.Title)
+ }
+}