Skip to content

Self-improving skills

Every agent turns its own work into new skills and memory with nobody authoring them. A cheap per-turn hook writes candidates — an idea plus pointers into the session. The nightly dream-cycle follows those pointers and composes the real SKILL.md or memory.

stage fires writes
notice turn-review Stop hook (claude) / agent_end extension (pi), every ~10 turns, on the small skill_model candidates to ~/.cache/agentctl/turn-review-candidates.jsonl
compose the nightly dream-cycle, per candidate the real SKILL.md or memory entry, stamped created_by: agent
age out the nightly dream-cycle, on real usage the lifecycle state of agent-composed skills

The notice hook is detached, work-gated and recursion-guarded; it never blocks the session. A candidate carries a session id, a verbatim grep anchor and the files touched. The compose stage follows those pointers with the introspection verbs and pulls only the evidence it needs.

Ageing

state after
active on compose
stale 30d
archived 90d

The dream-cycle measures use with live sessions grep. Only skills stamped created_by: agent age; hand-written skills are never touched.

Steering the review model

sudo agentctl agents set <name> skill_model <model>
sudo agentctl apply <name>
runtime env var default
claude CLAUDE_SKILL_MODEL claude-haiku-4-5, back-filled into the ledger
pi PI_SKILL_MODEL none — an empty value reviews on the agent's PI_MODEL

skill_model is a model-only override on the agent's own account and key; see Which model runs where. pi crons carry the same per-job override as PI_CRON_MODEL, the analog of claude's CLAUDE_CRON_MODEL.

Introspection verbs

Seven read-only JSON verbs over an agent's own sessions, memory, skills, candidate store and workspace. This is the layer the dream-cycle composes from, and candidates is how you watch what is being proposed fleet-wide.

agentctl sessions   <agent> grep <pattern> [--role …] [--tool …] [--since …]
agentctl sessions   <agent> perms [--lane <lane>] [--all]
agentctl mem        <agent> [--type …] [--grep <re>] [--since …]
agentctl skills     <agent> [--since …]
agentctl candidates <agent> [--kind skill|memory] [--status …] [--since …]
agentctl ws changes <agent> [--since …]
agentctl ws search  <agent> <query>
caller may query
any agent itself
an admin agent any agent, through the agentd read-proxy

sessions grep is a live grep with no pre-built index. skills is runtime-aware per agent:

runtime skills lists
claude ~/.claude/skills/
pi ~/.pi/agent/skills/