/darwin:evolvefrom darwin
Use when you want to modify ANY aspect of yourself — your capabilities (new/overridden tools), your behavior (hooks that intercept every tool call, LLM request, session and subagent lifecycle), your knowledge (skills that persist across sessions), your orchestration (workflow scripts), or even your UI (TUI panels, commands, dialogs). Nothing about you is fixed: every layer from what tools you expose, to how you react to events, to what the user sees on screen is rewritable through files in .darwin/. Use proactively — repeated manual sequence 3+ times, repeated user correction, durable project knowledge, or any "I wish I could..." moment is a trigger to evolve.
Ships in darwin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every layer of you is rewritable by writing files to .darwin/ (reload semantics differ per layer — see File Locations):
This skill is not documentation — it is a standing instruction to notice when you should evolve, and act on it.
Act on these signals — don't wait for the user to ask:
| Signal | Action |
|---|---|
| You ran the same bash/API sequence 3+ times (this or past sessions) | Wrap it into a tool |
| You keep making the same mistake, or the user keeps correcting the same behavior | Add a hook to block/fix it structurally |
| You learned non-obvious project knowledge that future sessions will need | Write a skill to persist it |
| A built-in tool's behavior conflicts with project needs | Override it (same-name tool) |
| A workflow you hand-orchestrated worked well and may repeat | Save it as a workflow script |
Before creating: check whether the extension already exists (ls .darwin/tools .darwin/hooks .darwin/skills). Prefer improving an existing one over adding a near-duplicate.
Need to change WHAT you can do → tool (new capability, wraps commands/APIs)
Need to change HOW you behave → hook (intercept/modify/block existing behavior)
Need to remember HOW to do X → skill (knowledge, loaded on demand)
Need to redo a multi-agent run → workflow (.darwin/workflows/*.js)
Need to change the UI → TUI plugin (.darwin/tui/*.tsx)
Rule of thumb: tools add verbs, hooks add reflexes, skills add memories.
Write to .darwin/tools/<name>.ts:
import { tool } from "@opencode-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. A tool with the same id as a built-in (bash, read, edit, ...) replaces it.
Tools (and workflows) written under .darwin/ are dispatched at runtime through the darwin_ext gateway tool — hot, no host restart: write the file, invoke it through darwin_ext on the next turn, and it runs.
Write to .darwin/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.")
},
}
Hooks are loaded by the host at startup — a new or changed hook file is not picked up mid-session and requires a host restart. The escape hatch is the phoenix restart flow: /darwin restart writes a handoff note and restarts the session, so the new hook loads with minimal lost context.
| Event | Capability |
|---|---|
tool.execute.before | Modify output.args or set output.cancel=true to block |
tool.execute.after | Modify tool result via output.output (string), output.title, output.metadata — NOT output.result |
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 |
session.pre / session.post | Session runLoop lifecycle; post receives the full trajectory |
session.userQuery.pre / .post | Per-LLM-step lifecycle; cancel or inspect each step |
actor.preStop / actor.postStop | Gate subagent delivery; continue=true forces another turn |
permission.ask | Auto-allow/deny permission requests (not yet wired) |
shell.env | Inject environment variables |
Field names must match exactly — a typo'd field (e.g. output.result) fails
silently. Always check @reference/hook-api.md for the exact input/output shape
before writing a hook.
Write to .darwin/skills/<name>/SKILL.md:
---
name: my-skill
description: Use when [triggering conditions — not a workflow summary]
---
Instructions here...
Skills are hot — the host scans its skill dirs, so a newly written (or edited) skill is discoverable without a restart.
| Type | Path | Hot-reload |
|---|---|---|
| Tools | .darwin/tools/*.ts | hot — dispatched through the darwin_ext gateway tool, no restart |
| Hooks | .darwin/hooks/*.ts | host restart (/darwin restart) |
| Skills | .darwin/skills/*/SKILL.md | hot — host scan dirs |
| Workflows | .darwin/workflows/*.js | hot — dispatched through the darwin_ext gateway tool, no restart |
| TUI | .darwin/tui/*.tsx | restart |
darwin_ext / trigger the hook (restart first if needed) on the next turn. A broken extension is worse than none.For full type signatures, all available fields, and more examples:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
9 skills in this plugin
/compose-askUse whenever you need a decision, clarification, or approval from the user — covers how to ask the user (one question at a time), and how to resolve the decision yourself when no user is available (unattended run, or a [Never-Ask] response)/compose-nextUse for multi-step feature work, bug fixes, or refactors where requirements need to settle, a feature document should carry design + tasks + delivery evidence, and the change deserves independent review before merge. Use it only when the user explicitly requests this workflow, whether with `/compose-next`, by name, or in any other clear natural language; do not infer the request from task complexity alone. Not for one-shot edits, single-file tweaks, or answering questions — those need no orchestration overhead./npx claudepluginhub alliecatowo/claude-code-darwin --plugin darwin