MCPcopy
hub / github.com/anthropics/claude-code / _scrub

Function _scrub

plugins/security-guidance/hooks/llm.py:1339–1343  ·  view source on GitHub ↗
(s: object)

Source from the content-addressed store, hash-verified

1337 # as data when embedding into pass-2's prompt: collapse newlines and
1338 # wrap in a delimited block the model is told to read as data only.
1339 def _scrub(s: object) -> str:
1340 cleaned = re.sub(r"\s+", " ", str(s or "")).strip()[:120]
1341 return (cleaned.replace("&", "&")
1342 .replace("<", "&lt;")
1343 .replace(">", "&gt;"))
1344
1345 excl = "\n".join(
1346 f"- {_scrub(c.get('category'))} at {_scrub(c.get('filePath'))}: "

Callers 1

agentic_reviewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected