---
title: "fable-pin"
url: "https://claudemods.dev/ko/builds/fable-pin-0bbd87"
source: "https://github.com/karanb192/claude-code-mods/tree/main/plugins/fable-pin"
source_type: "github"
repo: "https://github.com/karanb192/claude-code-mods/tree/main/plugins/fable-pin"
author: "karanb192"
author_handle: "karanb192"
stars: 49
category: "멀티 에이전트 및 오케스트레이션"
categories: ["agents"]
tags: ["claude-code", "function-hooks", "hooks", "model-pinning", "plugin", "subagents"]
permission_level: 0
scan_complete: true
install: "claude plugin marketplace add karanb192/claude-code-mods\nclaude plugin install fable-pin@claude-code-mods"
added: "2026-10-05T17:27:04.321Z"
updated: "2026-10-19T09:58:55Z"
locale: "ko"
content_locale: "ko"
---

# fable-pin

각 agent.spawn에서 서브에이전트 모델을 고정 대상（기본값 fable）으로 바꾸는 Claude Code 플러그인입니다. spawn이 fork인 경우를 제외하며 /fable-pin on, off, status로 세션마다 전환하고 상태는 플러그인 자체 저장소에 둡니다.

## Description

모든 서브에이전트를 fable 모델에 고정합니다. spawn이 fork가 아니면 agent.spawn에서 모델을 다시 쓰고 /fable-pin on, off, status를 제공합니다. 자체 저장소 외에는 건드리지 않습니다. function hooks（early access）가 필요합니다.

## Install

```
claude plugin marketplace add karanb192/claude-code-mods
claude plugin install fable-pin@claude-code-mods
```

## Original README

# fable-pin

Every subagent runs on the model you chose, not the one a prompt asked for. This mod rewrites `model` on `agent.spawn` to `fable` unless the spawn is a fork, which inherits the parent's model anyway. `/fable-pin off` turns it off for the session and remembers that, `/fable-pin on` turns it back on, `/fable-pin status` says which.

Why it exists: a standing rule such as "every agent runs on fable" lives in a settings file that the model reads and sometimes ignores. A hook on `agent.spawn` cannot be ignored. The Agent tool's own `model` parameter is what gets rewritten, so the subagent's transcript shows the pinned model as its own.

## What it can reach

Validated on Claude Code 2.1.272:

    ❯ ./register.ts hooks: session.start, command.run{command=fable-pin}, agent.spawn
    ❯ ./register.ts calls: $.command.register, $.store.get, $.store.set

Reach L0, draws and remembers. Sees subagent spawns.

    Threat model for fable-pin (reach L0, draws and remembers)
    1. Reads:    nothing beyond the event payload; one boolean from its own $.store
    2. Runs:     nothing
    3. Sends:    nothing leaves the machine
    4. Persists: one boolean, "enabled", in $.store, until /fable-pin changes it
    5. Hostile input: the only text the mod reads is the /fable-pin argument, compared against two literals; a crafted prompt or tool result cannot reach a process, a file, the network or the model; if the hook throws, the engine skips it and the spawn proceeds unpinned, with one dim line in the transcript

## Install

Function hooks are early access. Nothing loads without the flag.

For one session:

    CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude --plugin-dir plugins/fable-pin

To keep it on, add this to `~/.claude/settings.json`, which also loads the hooks module of every other installed plugin that ships one:

    { "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }

Then from this marketplace:

    claude plugin marketplace add karanb192/claude-code-mods
    claude plugin install fable-pin@claude-code-mods

## Change the target model

`TARGET` at the top of `hooks/register.ts` is the alias or full model id the spawn is rewritten to. An alias resolves the way the Agent tool's `model` parameter does.

## Typecheck

Inside a Claude Code session started in this folder, run `/plugin-types`. It writes `.claude/types/claude-code.d.ts` for the installed version; that folder is git-ignored. Then, from this folder:

    npx -y -p typescript@5 tsc -p .

The tsconfig here includes `hooks` and `tests`, so the hook and both tests are checked against the generated declarations. Nothing else is needed; there is no package.json.

## Test

    claude plugin test plugins/fable-pin

Two tests, on the official kit from `claude-code/testing`. The first drives `session.start` and two `agent.spawn` calls through the mod: a subagent asking for another model comes out pinned to the target, a fork keeps its model. The second runs `/fable-pin off` and checks the next spawn is left alone. The inputs are typed `AgentSpawnInput` and `CommandRunInput` from `claude-code` with no casts; the Typecheck section below has the exact command that checks them.
