Class: ClaudeMemory::Ingest::ContentSanitizer

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_memory/ingest/content_sanitizer.rb

Overview

Strips privacy tags from transcript content before ingestion.

Note: No tag count limit is enforced. The regex pattern /<tag>.*?</tag>/m is provably safe from ReDoS (non-greedy matching with clear delimiters). Performance is O(n) and excellent even with 1000+ tags (~0.6ms). Long Claude sessions legitimately accumulate many tags (100-200+).

Defined Under Namespace

Modules: Pure

Constant Summary collapse

SYSTEM_TAGS =
[
  "claude-memory-context",
  "system-reminder",
  "local-command-caveat",
  "command-message",
  "command-name",
  "command-args"
].freeze
USER_TAGS =
["private", "no-memory", "secret"].freeze

Class Method Summary collapse

Class Method Details

.strip_tags(text) ⇒ Object



22
23
24
25
# File 'lib/claude_memory/ingest/content_sanitizer.rb', line 22

def self.strip_tags(text)
  tags = Pure.all_tags
  Pure.strip_tags(text, tags)
end