You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(messages): detect pasted content in user messages #405
User messages in the archive frequently contain large paste content (prior chatlogs being handed forward, AI tool output, code blocks, command output). When trying to surface what the user actually wrote — e.g. extracting their original framing of a project or their captured intent across many sessions — these pastes dominate by byte volume and bury the typed prose.
Concrete example: dumping all user messages across 35 sessions in one project yielded 906 KB total. The top 10 messages accounted for 69 % of that and were chatlog pastes (> previous chatlog attached below, > showing you last chatlog, etc.). The remaining ~280 KB was real user prose.
A coarse heuristic filter (length > 4 KB + content-shape markers) caught the worst offenders, but doesn't solve the general case: small embedded code pastes, tool-output pastes, structured documents pasted into otherwise-typed messages.
What success looks like
Per-message metadata distinguishing typed-by-human content from pasted/inserted content. Enables:
A polylogue --typed-only filter that strips paste segments
A "what did the user actually write" query mode for analysis / retrospective intent extraction
Stats grouped by paste-ratio for understanding session shapes
Some providers (claude.ai web, codex) may also persist paste-event metadata on submit (timestamped paste actions, attachment vs typed). Worth checking what's in the raw conversation JSON before computing — if the provider already marks pastes, use that as ground truth.
For my own setup (Wayland + Hyprland + clipse + scribe-tap), I have stronger ground-truth signals available:
clipse history — verbatim match of message segments against recent clipboard entries gives high-precision paste detection
scribe-tap keylog — counting keystrokes during message-compose window gives the typed/pasted ratio directly
These are too idiosyncratic to integrate into polylogue itself, but a plugin / external-enrichment hook (polylogue enrich --plugin <path>) would let me layer them on locally without polluting the main project.
Activity
Sinity commentedon Apr 25, 2026
Detection method (portable)
Content-shape classifier as default — works on any provider's archive, no external data needed:
<task-notification>,● Bash(, claude-code tool-output prefixes, shell-prompt patterns (~ ❯,/realm/...), bracketed system reminders, fenced code with shell language hint.> previous chatlog,showing you last chatlog,tail end of,here's tail end of recent session.… +N lines (ctrl+o to expand), "### Key insight" headings.Produce per-message:
{ paste_likelihood: 0..1, paste_segments: [{start, end, source: 'shape', confidence}], shape_signals: {...} }.Some providers (claude.ai web, codex) may also persist paste-event metadata on submit (timestamped paste actions, attachment vs typed). Worth checking what's in the raw conversation JSON before computing — if the provider already marks pastes, use that as ground truth.
Sinity commentedon Apr 25, 2026
Personal-dataset side-channels (not for upstream)
For my own setup (Wayland + Hyprland + clipse + scribe-tap), I have stronger ground-truth signals available:
These are too idiosyncratic to integrate into polylogue itself, but a plugin / external-enrichment hook (
polylogue enrich --plugin <path>) would let me layer them on locally without polluting the main project.[-]Detect paste content in user messages[/-][+]feat(messages): detect pasted content in user messages[/+]fix(parser): reclassify claude tool_result-only user envelopes to Rol…
fix(parser): reclassify claude tool_result-only user envelopes to Rol…
feat(messages): detect pasted content with has_paste precomputed colu…