self-extend

self-extend is a skill for Claude Code, Codex from sergezuber/FABULA-LLM-5. It costs 56 tokens per session (962 once invoked), scanned D, original, MIT.

A project-local extension system for adding tools, hooks, and skills to an AI coding agent. Changes in the .mimocode/ folder take effect on the next turn.

In plain words
What is it for?
Creating reusable tools, adding event-based behavior, storing domain knowledge, and adapting or overriding built-in tools.
Why use it?
It avoids repeating custom work and lets the agent adapt its behavior to a project. It can also add checks that stop unsafe tool actions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Creating reusable tools, adding event-based behavior, storing domain knowledge, and adapting or overriding built-in tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sergezuber/fabula-llm-5/self-extend
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sergezuber/FABULA-LLM-5 --skill self-extend
Clone the repo
git clone --depth 1 https://github.com/sergezuber/FABULA-LLM-5

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for self-extend

README.md
[![agentmods](https://agentmods.dev/badge/skills/sergezuber/fabula-llm-5/self-extend/github.svg)](https://agentmods.dev/skills/sergezuber/fabula-llm-5/self-extend)
Your own site
<a href="https://agentmods.dev/skills/sergezuber/fabula-llm-5/self-extend"><img src="https://agentmods.dev/badge/skills/sergezuber/fabula-llm-5/self-extend/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for self-extend

Your own site · 80×15
<a href="https://agentmods.dev/skills/sergezuber/fabula-llm-5/self-extend"><img src="https://agentmods.dev/badge/skills/sergezuber/fabula-llm-5/self-extend.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 962 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.00962
Opus 5 $0.00028 $0.00481
Sonnet 5 $0.00011 $0.00192
Haiku 4.5 $0.00006 $0.00096

Measured 9d ago against content hash cd8125059fa7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade D, and why

self-extend scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

if (args.command.includes("sudo")) return "Error: sudo not allowed"

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

if (input.tool === "bash" && output.args.command?.includes("rm -rf /")) {

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { execSync } from "child_process"
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

engine/packages/opencode/src/skill/builtin/.bundle/self-extend/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Self-Extension

Overview

You can extend your own capabilities by writing files to .mimocode/. Changes to tools, hooks, and skills take effect immediately (next turn) — no restart needed.

Creating Tools

Write to .mimocode/tools/<name>.ts:

import { tool } from "@mimo-ai/plugin"

export default tool({
  description: "What this tool does",
  args: {
    param1: tool.schema.string().describe("Parameter description"),
  },
  async execute(args, ctx) {
    // ctx.directory — project root
    // ctx.worktree — git worktree root
    // ctx.abort — AbortSignal
    return `Result: ${args.param1}`
  },
})

Multiple tools per file: use named exports instead of default.

Creating Hooks

Write to .mimocode/hooks/<name>.ts — export a Hooks object:

export default {
  "tool.execute.before": async (input, output) => {
    if (input.tool === "bash" && output.args.command?.includes("rm -rf /")) {
      output.cancel = true
      output.cancelReason = "Blocked dangerous command"
    }
  },
  "experimental.chat.system.transform": async (input, output) => {
    output.system.push("Additional instruction here.")
  },
}

Hook Events

Event Capability
tool.execute.before Modify args or cancel=true to block
tool.execute.after Modify tool output
tool.definition Modify tool description/parameters
chat.params Modify temperature, topP, maxOutputTokens
experimental.chat.system.transform Append to system prompt
experimental.chat.messages.transform Modify message list sent to LLM
permission.ask Auto-allow/deny permission requests
shell.env Inject environment variables

Tool Override

A custom tool with the same id as a built-in replaces it:

// .mimocode/tools/bash.ts — overrides built-in bash
import { tool } from "@mimo-ai/plugin"
import { execSync } from "child_process"

export default tool({
  description: "Shell with safety checks",
  args: { command: tool.schema.string() },
  async execute(args, ctx) {
    if (args.command.includes("sudo")) return "Error: sudo not allowed"
    return execSync(args.command, { encoding: "utf-8", cwd: ctx.directory })
  },
})

Read the full file on GitHub · 132 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 132 lines · 56 tokens per session scan D cd8125059fa7

Subscribe to this mod's changes

self-extend is a skill published in the GitHub repository sergezuber/FABULA-LLM-5 (83 stars, last pushed 8d ago), licensed MIT. It adds 56 tokens to every session and 962 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, recursive force delete, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

architecture-audit

Systematic architecture audit and refactoring methodology for Rust + TypeScript codebases. Use when performing refactoring, cleanup, unification, code review, dead code removal, module reorganization, or tech debt elimination. Ensures no naming confusion, semantic overloading, hidden defaults, duplicate logic, or…

org2AI/ORG2 · 70 tokens

e2e-testing

ORGII keeps two separate E2E surfaces. Do not use one as proof for the other.

org2AI/ORG2 · 0 tokens

dual-instance-verification

Dual-instance (双机) real-machine verification protocol for ORG2 cloud sync and session sharing. Use before declaring any sharing/sync/collab feature or fix "verified": share/unshare, push/retract, fork/import, comments, member-floor, replay, continuation, or anything touching Org2CloudSyncEngine, collab engines, or the…

org2AI/ORG2 · 0 tokens

org2-performance-guard

Prevent CPU, RAM, I/O, background-work, and false-green lifecycle regressions in ORG2. Use when adding or reviewing polling, timers, Realtime subscriptions, event listeners, workers, streaming paths, caches, pagination, provider-owned transcript ingestion or identity/dedupe, external-history scans, cloud sync…

org2AI/ORG2 · 112 tokens

react-best-practices

ORGII-specific React 19 performance review and implementation guidance, adapted from Vercel Engineering. Use for React performance, re-render, async waterfall, bundle, heavy dependency, virtualization, high-frequency event, Context/provider, or store-subscription work. Do not trigger for styling, copy changes, or…

org2AI/ORG2 · 77 tokens

create-orgii-agent

Create or modify a custom ORGII agent definition (and the org it belongs to). Use when the user wants to create, configure, retune, rename, or delete an agent, define an agent's soul / capabilities / tools, organise agents into an org, or asks about agent-definitions.json.

org2AI/ORG2 · 67 tokens