agentleFS
kwiggenkwiggen/claude-code-plugin/skills/clip/SKILL.md

clip

Skill1 starsChanged 4 months agoMITView on GitHub

Take the most recent prior assistant message in this conversation, strip Claude Code's ⏺ bullet and 2-space indent, unwrap soft-wrapped paragraphs, and copy the result to the macOS clipboard in a target format (Markdown, Slack mrkdwn, plain text, or HTML). Use when the user says "/clip", "clip that", "copy that for Slack", "copy as plain text", "copy as html", or wants to grab Claude's prior output in paste-friendly form.

11 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If /clip is invoked as the very first turn (no prior assistant message exists), tell the user there's nothing to clip and stop.

    line 46
  2. Very specific:

    Use the quoted heredoc form (<<'CLIP_EOF') so $, backticks, and backslashes in the message stay literal.

    line 70
  3. Very specific:

    If CLIP_EOF appears inside the message body, pick a different unique delimiter (e.g.

    line 71
  4. Distinctive:

    Do not summarize or paraphrase the previous message.

    line 85
  5. Distinctive:

    Do not edit the previous message before piping it.

    line 86
  6. Distinctive:

    Do not attempt to do the Markdown→Slack/HTML/plain conversion in your head — always pipe through the CLI.

    line 87
  7. Very specific:

    Do not include tool-call blocks, tool results, <system-reminder> content, or user messages in the clipped text.

    line 88
  8. Distinctive:

    Do not re-print the cleaned result to the chat by default.

    line 89

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clip — Clean & Copy the Last Claude Message

Grabs the most recent prior assistant message in the current conversation, runs it through the bundled reformatter (dist/clip/cli.js), and replaces the macOS clipboard with the cleaned text in the requested format.

Designed for the case where the user wants to paste Claude's output somewhere else (doc, email, Slack, Linear, a blog post) without the ⏺ bullet and 2-space indent that Claude Code applies to its rendered output.

Adapted from octavehq/claude-clip (MIT), reimplemented in TypeScript.

Modes

ModeWhat it doesTypical destination
md(default) Strip ⏺/indent, unwrap paragraphs, keep Markdown as-isLinear, GitHub, Notion, docs
slackConvert Markdown → Slack mrkdwn (**bold**→*bold*, headers→bold, tables→aligned code blocks)Slack messages, threads
plainStrip all Markdown syntax, keep the pure prose; links become label (url)Email, SMS, plain-text notes
htmlConvert Markdown → HTML (paragraphs, lists, headers, tables, inline formatting)CMS, blog editors, email HTML

How to interpret user intent:

  • /clip or /clip md → md
  • /clip slack or "copy that for Slack" or "Slack mrkdwn" → slack
  • /clip plain or /clip email or "plain text" or "strip formatting" → plain
  • /clip html or "HTML version" → html

What "the last message" means

"The last message" = the most recent assistant (Claude) message in the conversation immediately before the user invoked /clip. Not the user's message. Not an earlier assistant message. The single most recent assistant turn's full prose content.

If /clip is invoked as the very first turn (no prior assistant message exists), tell the user there's nothing to clip and stop.

Requirements

  • Platform: macOS (uses pbcopy). On Linux/Windows the pipe target would need to change (e.g. xclip -selection clipboard).
  • Node.js on PATH and the plugin built (dist/clip/cli.js exists).

How to Execute

Pipe the prior message through the reformatter into the clipboard using a single Bash call with a quoted heredoc so the message text is passed verbatim without shell expansion. Pass the mode via -m:

cat <<'CLIP_EOF' | node {pluginDir}/dist/clip/cli.js -m <MODE> | pbcopy
<paste the full text of your previous assistant message here, verbatim>
CLIP_EOF

Replace <MODE> with md, slack, plain, or html. If the user didn't specify, use md.

Rules:

  • Use the quoted heredoc form (<<'CLIP_EOF') so $, backticks, and backslashes in the message stay literal.
  • If CLIP_EOF appears inside the message body, pick a different unique delimiter (e.g. CLIP_EOF_7F3A).
  • Pass the message verbatim. Do not trim, summarize, rewrite, or otherwise modify the content — the CLI handles all whitespace and formatting normalization.

Then confirm with a single short line that includes the mode:

Clipped (slack). Paste with ⌘V.

Nothing more. Do not echo the cleaned output back to the chat unless the user explicitly asks to see it.

What NOT to do

  • Do not summarize or paraphrase the previous message.
  • Do not edit the previous message before piping it.
  • Do not attempt to do the Markdown→Slack/HTML/plain conversion in your head — always pipe through the CLI. The CLI is deterministic; ad-hoc LLM conversion is not.
  • Do not include tool-call blocks, tool results, <system-reminder> content, or user messages in the clipped text.
  • Do not re-print the cleaned result to the chat by default.

What the reformatter does

dist/clip/cli.js reads stdin and writes stdout (src/clip/reformat.ts):

  1. Normalize CRLF → LF
  2. Strip any leading ⏺ marker from lines
  3. Parse into typed blocks: paragraphs, fenced code, separators
  4. Dedent fenced code blocks by the fence's own indent (so Claude's 2-sp indent is removed from code)
  5. Unwrap soft-wrapped paragraph lines (join with spaces, but start a new logical line on list items, headers, table rows, blockquotes, and **Label:** patterns)
  6. Apply the mode-specific renderer (md, slack, plain, html)

Example

User's prior assistant turn was:

⏺ What Else

  # Key insight

  The **qual-doctor** skill has a [hidden](https://x.com) duplicate of the
  ads-resonance prediction card system, and neither one knows about the
  other yet.

  - First item that wraps across
    multiple lines
  - Second item

User: /clip slack

Skill runs:

cat <<'CLIP_EOF' | node {pluginDir}/dist/clip/cli.js -m slack | pbcopy
⏺ What Else

  # Key insight

  The **qual-doctor** skill has a [hidden](https://x.com) duplicate of the
  ads-resonance prediction card system, and neither one knows about the
  other yet.

  - First item that wraps across
    multiple lines
  - Second item
CLIP_EOF

Skill replies: Clipped (slack). Paste with ⌘V.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.