Skip to content

Feature Request: Post-task self-reflection for skill auto-creation (inspired by Hermes + SkillClaw), + prefix cache optimization (inspired by Reasonix) #95477

Description

@WangXuexin24

Foreword

This is a follow-up to the closed #95388. ClawSweeper marked it as duplicate of an existing skills.workshop.autonomous.enabled feature. After testing that feature, I can confirm: it's a different thing. This issue proposes something OpenClaw genuinely doesn't have yet.


Problem

OpenClaw already has skills.workshop.autonomous.enabled which captures user instructions like "next time, do X first" and creates a pending skill proposal. This is passive — it waits for the user to explicitly teach.

But there's a capability gap: OpenClaw never self-reflects after completing a task. It never asks itself "did I just do something worth remembering?" and never proactively distills successful patterns into reusable skills.

The industry has two proven approaches for this:

1. Hermes Agent — Self-reflection loop

Hermes (Nous Research, 47K★) triggers skill creation autonomously on:

  • Complex task completion (5+ tool calls in a single turn)
  • Error recovery (the agent hit a failure and self-corrected)
  • User correction (the user said "no, do it this way")
  • Non-trivial workflow discovery (a multi-step sequence the agent hasn't seen before)

After creation, a Curator daemon runs in the background to merge overlapping skills, mark stale ones (30d unused → archive, 90d → delete). An alpha Self-Evolution module (GEPA + DSPy) even rewrites skill content and validates it against the old version before adopting.

Key differentiator: The agent decides what to learn. The user doesn't have to say "remember this."

2. SkillClaw — Collective evolution from session traces

SkillClaw (AMAP-ML / 高德地图, arXiv 2604.08377) takes an external approach: a Client Proxy records every API call into a shared store, and an Evolve Server runs a 3-stage pipeline:

Summarize → read all session traces, group by skill used
Aggregate → analyze success/failure patterns per skill
Execute → generate candidate, A/B test against current version, publish if better

It has a validated publish mode where candidates go through a peer review gate before going live.

Key differentiator: Cross-session, cross-user collective refinement. OpenClaw has nothing comparable.


Proposed Features

A. Post-task self-reflection (Hermes-inspired)

After each successful agent turn, check:

  • Did this turn involve 4+ tool calls?
  • Did the agent recover from an error?
  • Did the user provide a substantive correction?
  • Was the workflow sequence non-obvious?

If yes → auto-generate a Skill Workshop proposal (not a live skill — safety first), tagged as agent-suggested. The user can review and apply just like any other proposal.

Additionally, add a background curator-style job:

  • Detect overlapping proposals → suggest merge
  • Track usage → stale/archive after N days of inactivity
  • Optionally, flag low-quality proposals for user review

This is strictly additive to the existing skills.workshop.autonomous.enabled which waits for user instructions. The new path is agent-initiated.

B. Prefix cache optimization (Reasonix-inspired)

DeepSeek's prefix cache pricing is dramatic:

Cache Miss Cache Hit
DeepSeek-V4-Flash input $0.14/1M $0.028/1M (98% cheaper)
DeepSeek-V4-Pro input $0.435/1M $0.029/1M

Reasonix (esengine/DeepSeek-Reasonix, MIT) achieves ~99.8% cache hit rate by:

  1. Using a fixed, byte-identical 3-layer prompt prefix (identity → behavior → goals)
  2. Appending only dynamic tokens (current query + tools output) after the prefix
  3. Never inserting timestamps, session IDs, or random suffixes into the prefix

OpenClaw's system prompt (SOUL.md + IDENTITY.md + USER.md + memory excerpts + tool defs) changes structure every turn. Simple changes could save heavy users 50-80% on input costs:

  • Emit system context as a stable leading block
  • Insert only per-turn variable content after it
  • Keep tool definitions byte-stable across turns (reorder serialization deterministically)

Summary: Why this is not a duplicate

Feature OpenClaw autonomous.enabled Proposed (Hermes style) Proposed (Reasonix style)
Trigger User says "remember to..." Agent self-reflects after complex tasks N/A
Direction User → Agent Agent → User (proposal) N/A
Scope Instruction capture Execution self-reflection Prompt engineering
Token saving No No 50-80% on inputs

These are three distinct capabilities, none of which exist in OpenClaw today.

Metadata

Metadata

Assignees

Labels

P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions