ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 KilimcininKorOglu

pin-note

Claude Code 플러그인으로, `/pin-note`로 고정한 메모를 세션 내내 유지하고 각 압축 및 `/clear` 후 SessionStart hook을 통해 모델 컨텍스트에 그대로 다시 주입합니다. 세션별로 `$.store`에 지속되며 기본값은 꺼짐입니다.

KilimcininKorOglu@KilimcininKorOglu

KilimcininKorOglu/claude-code-mods/tree/main/plugins/pin-note

번역 완료

이 mod 소개

pin-note는 Claude Code 플러그인입니다(manifest와 hooks 모듈을 검증했으며 L0 reach, 네트워크/파일/프로세스 접근 없음). 세션 초기에 전달한 지시가 압축 또는 /clear 후 약해지거나 사라지는 문제를 해결합니다. 명령은 /pin-note(핀 전환 및 목록), /pin-note on | off, /pin-note <note>로 고정, /pin-note drop <n>으로 제거입니다. 고정한 메모는 세션 ID 아래 $.store에 세션별로 저장되므로 재개한 세션에서 복구됩니다. /clear는 메모를 물려받는 새 세션을 시작합니다. 압축 또는 /clear 후 SessionStart hook은 모든 핀을 번호가 매겨진 목록으로 다시 전송합니다. 각 항목은 입력한 그대로이며, 모델이 메모를 주입된 지시로 오해하지 않도록 메모의 출처를 설명하는 세 줄이 앞에 붙습니다. claude plugin marketplace add KilimcininKorOglu/claude-code-mods로 설치한 다음 claude plugin install pin-note@kilimcininkoroglu-mods를 실행하고 재시작한 뒤 /pin-note on을 실행하세요. 제한: 메모는 압축 및 /clear 때만 다시 전송되며, 이전 세션의 메모는 가비지 컬렉션되지 않습니다. 메모 수와 길이에도 제한이 없습니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install pin-note
원문 / README

pin-note

You tell the model early on "ask before every push", and after a compaction the summary has dropped the sentence or reworded it into something weaker; after /clear it is gone for good. This mod keeps the notes you pin with /pin-note for the whole session, and sends them to the model again, word for word, after each compaction and /clear.

What it does

  1. /pin-note <note> pins a note. The model reads it at once, in the command's answer:

    pin-note: pinned note 1, kept for this session and sent to you again after each compaction and /clear:
    ask before every push
    
  2. After a compaction, and after /clear, the notes go into the model's new context through a SessionStart hook, as one numbered list, each note as you typed it. Three lines above the list tell the model where the notes come from: you pinned them yourself with /pin-note, then the conversation was compacted or you ran /clear, and the pin-note plugin you turned on hands them back. Without those lines the model at times took a note for an injected instruction and did not follow it. One line tells you:

    pin-note: sent 1 pinned note(s) again after the compaction
    
  3. The notes belong to the session. They are kept in $.store under the session's id, so a reloaded module and a resumed session find them again. /clear starts a new session, and the notes go with it.

  4. Nothing is sent at a session's start or at a resume, because the conversation there still holds the notes as you pinned them.

Measured on Claude Code 2.1.283 in live sessions with the sonnet model: after /compact the note reached the model's context, and after /clear the model, asked whether a note was pinned, wrote it word for word. A note that asked for one word at the end of every reply was pinned, then /clear and a new question followed, 20 times for each text: with the earlier one-line text the model refused the note 4 times, calling it injected; with the current text it followed the note all 20 times.

Command

/pin-note                  on or off, and the pinned notes, numbered
/pin-note on | off         off by default; off keeps the notes and sends none
/pin-note <note>           pins a note; the text is kept as typed, several lines too
/pin-note drop <n>         takes note n out

While the mod is off, /pin-note <note> and drop are refused. on, off and drop <n> are the only command words, so a note may start with drop when no number alone follows it.

Install

claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install pin-note@kilimcininkoroglu-mods

Function hooks are early access. Claude Code 2.1.288 and later load them by default, so there is nothing to switch on.

After installing

  1. Restart Claude Code.
  2. Run /pin-note on.

What it can reach

Validated with claude plugin validate on Claude Code 2.1.283:

❯ ./register.ts hooks: session.start, command.run{command=pin-note}, classic.SessionStart
❯ ./register.ts calls: $.command.register, $.session.id, $.store.get (via loadPins, readSettings), $.store.set (via runCommand, savePins), $.ui.log

Reach L0, no network, no files, no processes.

1. Reads:        the notes you pin, and the session's id
2. Runs:         nothing
3. Sends:        nothing off the machine; the notes go into the model's context as you typed them
4. Persists:     the on/off setting and each session's notes in $.store
5. Hostile input: a note is your own text and the model reads it as your instruction; nothing else is read

Limits

  • The notes are sent again only at a compaction and at /clear. A note you want gone from the context must be dropped and the context compacted, because a note the model already read stays in the conversation.
  • Every session's notes stay in $.store under its id; nothing deletes the notes of an old session.
  • There is no limit on the number or length of notes, and every note goes into the context after each compaction.

Development

make install     # eslint, typescript-eslint, typescript
make lint        # complexity limit 10, the build fails above it
make typecheck   # needs the /plugin-types output in .claude/types/
make validate
make test        # claude plugin test

비슷한 프로젝트