Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.selftune.dev/llms.txt

Use this file to discover all available pages before exploring further.

Overview

selftune does not install the same hook set on every runtime.
PlatformInstall pathPrompt loggingGuardsSession telemetryNotes
Claude Codeselftune initYesYes, including blocking guard exitsYesDeepest integration
Codexselftune codex installYes, via SessionStartYesYesExperimental
OpenCodeselftune opencode installNoAdvisory onlyYesExperimental; no prompt-submit event
Piselftune pi installYesYesYesExperimental; judge/evolve use pi -p, optimizer agents are inlined
Clineselftune cline installNoNoYesExperimental; post-tool and task lifecycle only
OpenClawNoNoNoIngest and cron only
Claude Code remains the reference implementation. The rest of this page documents the Claude hook set because it is the most complete and it defines the core event model selftune adapts elsewhere.

Claude Code hook reference

prompt-log

  • Event: UserPromptSubmit
  • Purpose: Logs every user query to SQLite
  • Performance: < 5ms per invocation
  • Extra: Detects improvement signals via regex (e.g., “why didn’t you use X?“)

auto-activate

  • Event: UserPromptSubmit
  • Purpose: Evaluates activation rules and surfaces suggestions
  • Fires: At most once per session per rule

skill-change-guard

  • Event: PreToolUse (Write, Edit)
  • Purpose: Prevents unreviewed changes to SKILL.md files
  • Behavior: Blocks the tool call if the target is a SKILL.md that selftune manages and no review has been recorded

evolution-guard

  • Event: PreToolUse (Write, Edit)
  • Purpose: Blocks conflicting manual edits during active evolution runs
  • Behavior: If an evolution is in progress for a skill, prevents manual edits to that skill’s SKILL.md

skill-eval

  • Event: PostToolUse (Read)
  • Purpose: Tracks when skills are read/triggered and classifies the invocation type (explicit, implicit, contextual)

session-stop

  • Event: Stop
  • Purpose: Captures end-of-session telemetry (query count, trigger count, miss count)
  • Extra: Spawns a focused background orchestrate run if improvement signals were detected during the session

Manual hook management

Claude Code hooks are installed automatically by selftune init. To run a hook manually:
selftune hook <name>
Available names: prompt-log, session-stop, skill-eval, auto-activate, skill-change-guard, evolution-guard