첫 mod 만들기
가장 빠른 길은 Claude에게 말로 시키는 것이에요. Claude Code에는 mod를 만드는 plugin-authoring 스킬이 들어 있어요.
말로 시키기
섹션 제목: “말로 시키기”대화 옆에 이번 세션의 도구 호출 수를 세는 창을 만들어 줘Claude가 mod 폴더에 첫 파일을 쓰면 **“Enable hot reloading for this session?”**을 물어요. Enable for this session을 고르면 턴이 끝날 때마다 고친 내용이 바로 다시 로드돼요.
직접 쓰기
섹션 제목: “직접 쓰기”-
매니페스트를 만들어요.
.claude-plugin/plugin.json { "name": "first-mod", "version": "0.1.0", "description": "도구 호출 수를 센다" } -
훅 모듈 위치를 적어요. 경로는 이 파일 기준이에요.
hooks/hooks.json { "modules": ["./register.ts"] } -
훅을 등록해요. 창은
$.ui.open으로 열고,ui.render훅이 그 안을 그려요.hooks/register.tsx import type { Register } from 'claude-code'let calls = 0export const register: Register = on => {on('session.start', async ($, e, next) => {await $.command.register({ name: 'calls', description: '도구 호출 수 창 열기' })return next(e)})on('command.run', { command: 'calls' }, async $ => {await $.ui.open({ id: 'calls', title: 'Tool calls' })return { text: '창을 열었어요.' }})on('tool.call', async ($, e, next) => {calls += 1$.ui.invalidate('ui.render')return next(e)})on('ui.render', { component: 'Pane', requestId: 'calls' }, async ($, e) => {const { Text } = $.ui.resolve(e)return <Text>도구 호출 {calls}회</Text>})} -
한 세션에서 불러 써 봐요.
터미널 창 claude --plugin-dir ./first-mod
검증과 테스트
섹션 제목: “검증과 테스트”claude plugin validate ./first-mod # 훅·호출 목록, 엔진이 거절할 부분claude plugin test ./first-mod # *.test.ts(x) 실행테스트는 claude-code/testing의 test, expect, mock을 써요. 테스트의 on으로 엔진 자리에 가짜 응답을 깔고, $.ui.mount로 창을 터미널·데스크톱 화면에 똑같이 그려서 버튼을 누르고 결과를 확인해요. 타입은 엔진이 mod 폴더의 .claude-plugin/types/에 깔아 주니, 한 번 로드된 뒤 tsc -p <폴더>로 검사할 수 있어요.
공유하기
섹션 제목: “공유하기”저장소 루트에 마켓플레이스 파일 하나를 두면 끝이에요.
{ "name": "first-mod", "owner": { "name": "you" }, "plugins": [{ "name": "first-mod", "source": "./" }]}다른 사람은 이렇게 설치해요.
/plugin install first-mod --marketplace you/first-modGitHub 저장소에 claude-code-mod 토픽을 달면 커뮤니티 카탈로그가 몇 시간 안에 수집해 가요.
더 보기
섹션 제목: “더 보기”비공식 커뮤니티 가이드입니다. Anthropic과 제휴하거나 승인받지 않았습니다. Claude와 Claude Code는 Anthropic의 상표입니다.