paste
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/paste — Clean content for any destination
/paste — 为任意目标平台清理内容
Cleans terminal output (ANSI, box-drawing, prompt artifacts, etc.) and reformats per destination rules. Reads clipboard by default, writes back to clipboard + previews in chat.
清理终端输出(ANSI代码、方框绘制字符、提示符痕迹等),并根据目标平台规则重新格式化。默认读取剪贴板内容,处理后写回剪贴板并在聊天中展示预览。
Step 1 — Get the content
步骤1 — 获取内容
In order:
- If the user included content in the prompt (pasted, or referenced from earlier in the conversation), use that.
- Else, read clipboard:
pbpaste - If both empty, ask the user what to paste.
优先级顺序:
- 如果用户在提示中包含了内容(粘贴的内容,或对话中之前提及的内容),则使用该内容。
- 否则,读取剪贴板内容:
pbpaste - 如果两者均为空,询问用户需要处理的内容。
Step 2 — Parse destination
步骤2 — 解析目标平台
| Invocation | Destination |
|---|---|
| plain (default) |
| plain |
| slack |
| notion |
| |
| |
| email (plain) |
| email (rich/HTML) |
| github |
| markdown render |
| render to HTML file + open in browser |
If ambiguous, ask. Per-destination rules live in .
references/destinations.md| 触发指令 | 目标平台 |
|---|---|
| plain(默认) |
| plain(纯文本) |
| Slack |
| Notion |
| Twitter/X |
| |
| 邮件(纯文本) |
| 邮件(富文本/HTML) |
| GitHub |
| Markdown渲染 |
| 渲染为HTML文件并在浏览器中打开 |
如果目标平台不明确,询问用户。各平台专属规则存于。
references/destinations.mdStep 3 — Scan for secrets
步骤3 — 扫描敏感信息
Before any cleaning or copying, scan against patterns in .
references/secret-patterns.mdIf any match:
- Stop. Don't copy yet.
- Report what was detected with the value masked (first 4 + last 4 chars only — e.g. ).
sk-12...wxyz - Ask: "Spotted [type] in the content. Continue, redact (replace with ), or abort?"
[REDACTED] - Default to abort if no clear answer.
在进行任何清理或复制操作前,根据中的规则扫描内容。
references/secret-patterns.md如果检测到敏感信息:
- 立即停止,暂不执行复制操作。
- 报告检测到的敏感信息类型,并对值进行掩码处理(仅保留前4位和后4位字符,例如:)。
sk-12...wxyz - 询问用户:"在内容中检测到[敏感信息类型]。是否继续、脱敏(替换为)或终止操作?"
[REDACTED] - 如果用户未给出明确答复,默认执行终止操作。
Step 4 — Universal cleaning
步骤4 — 通用清理
Strip from the content:
- ANSI escape codes — and related (color codes, cursor movement, screen control)
\x1b\[[0-9;]*[a-zA-Z] - Box-drawing chars — etc. Replace with simpler equivalents (
╭ ─ ╮ │ ╰ ╯ ╞ ╡ ╤ ╧ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ ━ ┃ ┏ ┓ ┗ ┛,-) or remove entirely depending on context.| - Terminal prompt artifacts — leading ,
$,>,❯,%(when first non-whitespace on a line that looks like a shell prompt)# - Carriage returns () — replace with
\ror delete\n - Trailing whitespace per line
- Excess blank lines — collapse 3+ consecutive blank lines to 2
从内容中移除以下元素:
- ANSI转义码 — 及相关代码(颜色代码、光标移动指令、屏幕控制指令)
\x1b\[[0-9;]*[a-zA-Z] - 方框绘制字符 — 等。根据上下文替换为更简单的等效字符(如
╭ ─ ╮ │ ╰ ╯ ╞ ╡ ╤ ╧ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ ━ ┃ ┏ ┓ ┗ ┛、-)或直接移除。| - 终端提示符痕迹 — 行首的、
$、>、❯、%(当这些字符是行中首个非空白字符且看起来像Shell提示符时)# - 回车符 () — 替换为
\r或直接删除\n - 行尾空白字符
- 过多空行 — 将3行及以上连续空行合并为2行
Step 5 — Apply destination rules
步骤5 — 应用目标平台规则
Read and apply the relevant transform.
references/destinations.md读取并应用对应的转换规则。
references/destinations.mdStep 6 — Output
步骤6 — 输出
| Destination | Output behavior |
|---|---|
| plain / slack / notion / twitter / linkedin / email / github | (a) Show preview in a code fence in chat. (b) Copy clean version to clipboard via |
| email rich | Render to HTML, write to |
| markdown | Render the cleaned markdown directly in chat (Claude Code renders it). Also copy raw markdown to clipboard. Offer: "Open as HTML too?" — if yes, write and open. |
| html | Render to HTML, write to |
After output, report a one-line summary of what was cleaned (e.g., "Stripped 12 ANSI codes, 4 box-drawing chars, 1 prompt artifact. Character count: 248 / 280 (X).").
| 目标平台 | 输出行为 |
|---|---|
| plain / slack / notion / twitter / linkedin / email / github | (a) 在聊天中以代码块形式展示预览。(b) 通过 |
| email rich | 渲染为HTML,写入 |
| markdown | 在聊天中直接渲染清理后的Markdown(Claude Code支持渲染)。同时将原始Markdown复制到剪贴板。询问用户:"是否也以HTML形式打开?" — 如果用户同意,则生成并打开HTML文件。 |
| html | 渲染为HTML,写入 |
输出完成后,输出一行清理总结(例如:"已剥离12个ANSI代码、4个方框绘制字符、1个提示符痕迹。字符数:248 / 280(X平台)。")。
Length warnings
长度警告
Twitter and LinkedIn have practical limits. the user said "let me trim" — don't refuse or auto-truncate.
- Twitter/X: warn if >280 chars. Note the overage.
- LinkedIn: warn if >400 chars (comfort line, not hard limit).
- Other destinations: no length warning.
Twitter和LinkedIn有实际长度限制。如果用户表示"let me trim"(让我修剪),请勿拒绝或自动截断。
- Twitter/X:如果字符数>280,发出警告并说明超出的字符数。
- LinkedIn:如果字符数>400,发出警告(此为舒适阈值,非硬性限制)。
- 其他目标平台:不进行长度警告。
URL handling for social destinations
社交平台的URL处理规则
If the content has URLs and destination is twitter or linkedin:
- Surface the URLs separately (don't include them in the body)
- Remind the user: links go in a first comment (LinkedIn) or reply (X), not the body
- See and
makerskills:jab-hook~/.claude/memory/feedback_social_link_placement.md
如果内容包含URL且目标平台为twitter或linkedin:
- 将URL单独列出(不包含在正文中)
- 提醒用户:链接应放在第一条评论(LinkedIn)或回复(X平台)中,而非正文内
- 参考和
makerskills:jab-hook~/.claude/memory/feedback_social_link_placement.md
Examples
示例
/paste slack→ Reads clipboard, strips ANSI, converts to , copies to clipboard, shows preview.
**bold***bold*/paste twitter
[pasted error log]→ Uses pasted content (ignores clipboard), strips everything, warns at 412/280 chars, copies, asks if the user wants to trim or pick a different destination.
/paste html
[pasted markdown table]→ Renders table as HTML, opens in browser. the user selects + copies into Notion/email with formatting preserved.
/paste
[pasted output with sk-anthropic-key in it]→ Stops. "Spotted what looks like an Anthropic API key: . Continue, redact, or abort?"
sk-an...3kf9/paste slack→ 读取剪贴板内容,剥离ANSI代码,将转换为,复制到剪贴板并展示预览。
**bold***bold*/paste twitter
[pasted error log]→ 使用粘贴的内容(忽略剪贴板),剥离所有无关格式,因字符数412/280发出警告,复制内容并询问用户是否需要修剪或更换目标平台。
/paste html
[pasted markdown table]→ 将表格渲染为HTML并在浏览器中打开。用户可选择复制内容到Notion/邮件中,保留格式。
/paste
[pasted output with sk-anthropic-key in it]→ 停止操作。提示:"检测到疑似Anthropic API密钥:。是否继续、脱敏或终止操作?"
sk-an...3kf9Composes with
可组合使用的工具
- — clean output for pasting into Typefully drafts when the MCP path doesn't fit; also enforces the link-placement rule for X/LinkedIn destinations
jab-hook - — clean a fetched post before quoting it in a draft or newsletter
social-fetch - —
second-brainoutput can be captured cleanly intopastefor future compilationraw/note-<slug>.md - — transcript / summary output often flows through
watch-videofor platform-specific reformattingpaste
- — 当MCP路径不适用时,清理输出内容以粘贴到Typefully草稿中;同时为X/LinkedIn平台执行链接放置规则
jab-hook - — 在草稿或通讯中引用抓取的帖子前,先清理帖子内容
social-fetch - —
second-brain的输出可被干净地捕获到paste中,供后续整理使用raw/note-<slug>.md - — 转录/总结输出通常会通过
watch-video进行平台专属格式转换paste
Notes on quality
质量说明
- Secret detection runs first, always. Before any formatting or destination logic, scans for
paste,sk-*,AKIA*, JWT-shaped strings, and long-hex tokens. Prompts before proceeding on any hit. Better to false-positive occasionally than to leak a real key.xoxb-* - Destination-aware transforms, not one-size-fits-all. Slack wants ; LinkedIn wants unicode-styled bold; email wants HTML. Same input, 9 different valid outputs. The destination flag is not optional.
*bold* - ANSI codes get stripped for every destination. Terminal escapes (etc.) render as garbage everywhere except the source terminal.
\033[31m - Character limits are enforced, not warnings. X at 280, LinkedIn at 3000, Twitter at 25000 — paste refuses to copy over-limit output and offers a trim strategy.
- Links go in first comments for social destinations — not the body. Enforced when destination is or
twitter. Documented inlinkedin.~/.claude/memory/feedback_social_link_placement.md - HTML destination opens in a browser tab, not the clipboard. Formatted tables + code blocks need a rendered surface to select-and-copy from with formatting preserved. Copying raw HTML to the clipboard produces garbage in Notion/email.
- 敏感信息检测始终优先执行。在任何格式化或目标平台逻辑执行前,会扫描
paste、sk-*、AKIA*、JWT格式字符串和长十六进制令牌。一旦检测到匹配项,会先提示用户再继续操作。宁可偶尔误报,也绝不泄露真实密钥。xoxb-* - 针对目标平台的专属转换,而非一刀切。Slack需要格式;LinkedIn需要Unicode样式的粗体;邮件需要HTML格式。同一输入可生成9种不同的有效输出。目标平台标识并非可选参数。
*bold* - 所有目标平台都会剥离ANSI代码。终端转义码(如等)除了在源终端外,在其他所有地方都会显示为乱码。
\033[31m - 字符限制为强制规则,而非单纯警告。X平台限制280字符,LinkedIn限制3000字符,Twitter限制25000字符 — 会拒绝复制超出限制的内容,并提供修剪策略。
paste - 社交平台的链接需放在第一条评论中 — 而非正文内。当目标平台为或
twitter时强制执行此规则。规则文档存于linkedin。~/.claude/memory/feedback_social_link_placement.md - HTML目标平台会在浏览器标签页中打开,而非写入剪贴板。格式化后的表格和代码块需要渲染界面才能保留格式进行选择和复制。将原始HTML复制到剪贴板会在Notion/邮件中显示为乱码。