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.

The feedback loop

selftune operates as a continuous improvement cycle:
Observe → Detect → Diagnose → Propose → Validate → Deploy → Watch → Rollback (if needed)
Every step is automated. You can run any step manually, or let selftune run handle the full loop.

Four layers

selftune is organized into four architectural layers:

1. Capture

Hooks and ingestors produce raw evidence from real agent sessions.
  • Claude Code has the deepest hook coverage, including prompt logging, guardrails, trigger tracking, and session telemetry
  • Codex, OpenCode, Pi, and Cline have narrower platform adapters with varying hook coverage
  • Platform ingestors replay native session formats (Claude Code, Codex, OpenCode, OpenClaw, Pi) into a normalized format
  • All data stays local in ~/.selftune/selftune.db (SQLite)

2. Normalize

selftune sync replays raw sources into a trustworthy SQLite database with repaired overlays.
  • Deduplicates sessions across multiple ingest runs
  • Repairs skill usage attribution when hooks missed events
  • Produces a consistent timeline of queries, triggers, and outcomes

3. Decide and Act

The analysis and evolution layer uses normalized evidence to improve skills.
ComponentWhat it does
Grading3-tier evaluation: trigger accuracy, process correctness, output quality
EvolutionProposes improved skill descriptions, validates against eval sets, deploys or rejects
RunAutonomous sync → grade → evolve → watch loop
WatchPost-deploy regression detection with auto-rollback

4. Surface

Status, dashboard, and reports explain what the system knows and what it did.
  • selftune status — one-line health summary
  • selftune last — quick insight from the most recent session
  • selftune dashboard — full local SPA with charts and timeline

Invocation taxonomy

selftune classifies every user query into one of four types:
TypeExampleDescription
Explicit”use the pptx skill”User names the skill directly
Implicit”make me a slide deck”User describes the task without naming the skill
Contextual”I need slides for the Q3 board meeting”Task is buried in domain context
Negative”what format should I use for a presentation?”Should NOT trigger the skill
Evolution improves performance across all four types simultaneously using Pareto multi-candidate selection.

How does signal-reactive improvement work?

selftune detects user corrections in real-time and feeds them back into the evolution pipeline:
  1. The prompt-log hook detects correction patterns like “why didn’t you use X?” via regex
  2. selftune logs an improvement signal linked to the mentioned skill
  3. The session-stop hook spawns a focused background run
  4. Skills with signals get priority boosts (+150, capped at +450) and bypass evidence gates
If a user corrects the agent about a skill, selftune can begin improving that skill before the session even ends.

Data architecture

  • SQLite (~/.selftune/selftune.db) is the sole write target for all local data
  • Hooks write directly via optimized direct-write paths
  • No external services required for local operation
  • Optional cloud sync via selftune alpha upload for team dashboards

Explore core concepts

Deep dive into skills, grading, evolution, and evals.