agentleFS
IncredibleFyrkatIncredibleFyrkat/claude-buttons/skills/pin/SKILL.md

pin

Skill1 starsChanged 5 months agoMITView on GitHub

Pin a command as a button in the Claude Buttons panel (this chat, or global)

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use recall.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • termdockSkill

    recall

    Retrieves cross-session memories about past decisions, lessons, and patterns. Use when user asks about prior work, past decisions, or mentions a feature. Triggers include check memory, what did we decide, how did we solve.

    Also in 3 projects that use this

  • Other versions7 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 7

    1. svy04/ballast★ 73same name
    2. pantheon-org/tekhne★ 10same name
    3. rzaaeeff/agent-ledger★ 4same name
    4. hazarsozer/ren-os★ 2same name
    5. HEADING-OS-Official/heading-os★ 2same name
    6. lawrips/skills★ 2same name
    7. chanjarster/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Staleness check — this one FAILS CLOSED: If the file is missing or unreadable, or its ts is more than 2 minutes old, REFUSE the pin and …

    line 14
  2. Very specific:

    If the command is destructive or irreversible (shutdown, delete, deploy, etc.), add "confirm": true — the panel then requires two clicks …

    line 23
  3. Very specific:

    Write the object to a temp .json file (UTF-8) and pass the PATH — a button's text can be a whole prompt with quotes and newlines, and that …

    line 30

“Common” is measured: kept by at least 6 in 10 of the 6 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

The user wants to pin a command as a button in the Claude Buttons panel: $ARGUMENTS

Do the following:

  1. Locate buttons.json: read the install marker at %USERPROFILE%\.claude\claude-buttons-path.txt — its content is the full path to buttons.json. If the marker is missing, tell the user Claude Buttons is not installed and stop.
  2. Parse the arguments: the first token (possibly quoted) is the text the button types into the chat (e.g. /code-review or plain text). An optional second argument is the button label. Without a label, use the text as the label.
  3. Scope: ALWAYS ask one clickable question with the AskUserQuestion tool: "Where should the button appear?" with two options: "Only this chat (Recommended)" (first) and "Global (all chats)". Skip the question ONLY if the user already stated the scope in the command. If the user does not actively choose global, it is this-chat only.
  4. For per-chat scope: read %USERPROFILE%\.claude\active-session.json and use its session_id as the button's chat value (a hook updated this file when the user sent this message).

    Staleness check — this one FAILS CLOSED. If the file is missing or unreadable, or its ts is more than 2 minutes old, REFUSE the pin and explain why. Never widen the scope to global.

    A per-chat button is per-chat precisely because it carries chat (and/or chatTitle); a button with neither field is global and shows in every conversation. So "carrying on" past a stale session file means dropping the only thing that keeps the button private — and a click in some other chat would then paste the user's text there. When the user asked for this chat, global is not a degraded answer, it is the wrong one, in the direction that leaks their text. A stale file may also carry a different conversation's session_id, so pinning with it is equally wrong.

    Say: the chat could not be identified, nothing was pinned, and sending any message in this chat refreshes the session file, after which they can retry. Do not pin globally, do not pin with the untrusted session_id, and do not offer global as the way out. Pin globally only if the user asks for a global button of their own accord, after being told the pin was refused.

  5. Build the button object:
    • Per-chat: { "label": "<label>", "short": "<short>", "text": "<text>", "submit": true, "chat": "<session_id>", "chatTitle": "<the current chat's displayed title, if known>" }
    • Global: same but without chat/chatTitle.
    • short is a very short version of the label (max ~8 chars) shown when the window is too narrow.
    • If the command is destructive or irreversible (shutdown, delete, deploy, etc.), add "confirm": true — the panel then requires two clicks before firing.
    • Note: per-chat buttons never auto-send (the panel only inserts the text), regardless of submit.
  6. Do NOT read, edit or write buttons.json yourself. The panel writes that file too, under a mutex, and a hand-written read-modify-write silently destroys whatever the panel saved in between. Instead run the panel's own locked entry point, passing the object as one JSON argument (the panel is in the same folder as buttons.json, from the marker in step 1):

    Write the object to a temp .json file (UTF-8) and pass the PATH — a button's text can be a whole prompt with quotes and newlines, and that does not survive being a command-line argument:

    powershell -NoProfile -ExecutionPolicy Bypass -File "<install-dir>\claude-buttons.ps1" -AddButton "<path-to-temp.json>"

    It takes the same lock, merges against a fresh read and writes atomically. Delete the temp file afterwards — it contains the user's prompt text.

    Interpret the result strictly. Never claim success on anything not listed as success:

    ExitOutputMeaning
    0ADDED: <label>Done. The panel reloads within ~1 second.
    0DUPLICATE: ...Nothing changed — that command is already pinned in that scope. Say so.
    1stderrThe file was locked or unreadable. Nothing was saved. Tell the user and offer to retry.
    2stderrBad payload (empty, missing file, invalid JSON). Nothing was saved.
    anything else, or no output—Treat as failure. Do NOT tell the user the button was pinned.
  7. Confirm briefly: button name + whether it is pinned to this chat or globally.

If there are no arguments: show a clickable menu with AskUserQuestion (multiSelect). Offer the most relevant available slash commands as options; then pin the chosen ones as above. Also mention that the fastest way to pin is to click the panel's kebab menu and choose "Pin new button".

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.