Log dialogue learnings, tone issues, and conversation failures to markdown files for continuous improvement. Conversational agents can later process these into playbooks. Important patterns may be promoted to project memory after explicit human review of a diff. Optional hooks are reminder-only and project-scoped.
Before logging anything, ensure the .learnings/ directory and files exist in the project or workspace root. If any are missing, create them:
bash
mkdir -p .learnings
[ -f .learnings/LEARNINGS.md ] || printf "# Learnings\n\nTone mismatches, context losses, hallucinations, and dialogue insights captured during conversations.\n\n**Categories**: tone_mismatch | misunderstanding | escalation_failure | context_loss | sentiment_drift | hallucination\n\n---\n" > .learnings/LEARNINGS.md
[ -f .learnings/DIALOGUE_ISSUES.md ] || printf "# Dialogue Issues Log\n\nConversation failures, misunderstandings, tone mismatches, and escalation problems.\n\n---\n" > .learnings/DIALOGUE_ISSUES.md
[ -f .learnings/FEATURE_REQUESTS.md ] || printf "# Feature Requests\n\nConversational capabilities requested by users or identified through dialogue analysis.\n\n---\n" > .learnings/FEATURE_REQUESTS.md
Never overwrite existing files. This is a no-op if .learnings/ is already initialised.
Do not log personally identifiable information, auth tokens, or private user data unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw conversation transcripts.
If you want automatic reminders or setup assistance, use the opt-in hook workflow described in Hook Integration.
SituationActionUser says "That's not what I meant"Log to .learnings/DIALOGUE_ISSUES.md with misunderstandingFormal response to casual userLog to .learnings/LEARNINGS.md with category tone_mismatchLost thread in multi-turn dialogueLog to .learnings/LEARNINGS.md with category context_lossAgent states incorrect factsLog to .learnings/LEARNINGS.md with category hallucinationUser asks for human agentLog to .learnings/DIALOGUE_ISSUES.md with escalation_failureUser sentiment drops mid-conversationLog to .learnings/LEARNINGS.md with category sentiment_driftUser requests missing capabilityLog to .learnings/FEATURE_REQUESTS.mdUser abandons conversationLog to .learnings/DIALOGUE_ISSUES.md with abandonmentSimplify/Harden recurring patternsLog/update .learnings/LEARNINGS.md with Source: simplify-and-harden and a stable Pattern-KeySimilar to existing entryLink with **See Also**, consider priority bumpConversation pattern is provenPropose a reviewed diff for SOUL.md, AGENTS.md, or TOOLS.md; apply only after explicit approval
OpenClaw is the primary platform for this skill. It uses workspace-based prompt injection with automatic skill loading.
Via ClawdHub (recommended):
bash
clawdhub install self-improving-conversation
Manual:
bash
git clone https://github.com/jose-compu/self-improving-conversation.git ~/.openclaw/skills/self-improving-conversation
OpenClaw injects these files into every session:
text
~/.openclaw/workspace/
├── AGENTS.md # Dialogue workflows, handoff protocols, escalation chains
├── SOUL.md # Conversational tone, personality, empathy guidelines
├── TOOLS.md # Integration capabilities, channel-specific gotchas
├── MEMORY.md # Long-term memory (main session only)
├── memory/ # Daily memory files
│ └── YYYY-MM-DD.md
└── .learnings/ # This skill's log files
├── LEARNINGS.md
├── DIALOGUE_ISSUES.md
└── FEATURE_REQUESTS.md
bash
mkdir -p ~/.openclaw/workspace/.learnings
Then create the log files (or copy from assets/):
LEARNINGS.md — tone mismatches, context losses, hallucinations, sentiment driftDIALOGUE_ISSUES.md — escalation failures, misunderstandings, abandoned conversationsFEATURE_REQUESTS.md — user-requested conversational capabilitiesWhen learnings prove broadly applicable, promote them to workspace files:
Learning TypePromote ToExampleConversation patternsSOUL.md"Match user's formality level within 2 exchanges"Dialogue workflowsAGENTS.md"Offer human handoff after 3 failed intent matches"Integration gotchasTOOLS.md"Slack threads lose context after 50 messages"
Opt-in and project-scoped. Enabling a hook persists across future sessions; skip this unless you need reminders:
bash
cp -r hooks/openclaw ~/.openclaw/hooks/self-improving-conversation
openclaw hooks enable self-improving-conversation
See references/openclaw-integration.md for complete details.
For Claude Code, Codex, Copilot, or other agents, create .learnings/ in the project or workspace root:
bash
mkdir -p .learnings
Create the files inline using the headers shown above. Avoid reading templates from the current repo or workspace unless you explicitly trust that path.
When dialogue issues or conversation failures occur:
.learnings/DIALOGUE_ISSUES.md, LEARNINGS.md, or FEATURE_REQUESTS.mdCLAUDE.md - project conversation conventionsAGENTS.md - dialogue workflows and escalation protocols.github/copilot-instructions.md - Copilot conversation contextAppend to .learnings/LEARNINGS.md:
markdown
## [LRN-YYYYMMDD-XXX] category
**Logged**: ISO-8601 timestamp
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: greeting | intent_detection | response_generation | handoff | follow_up | closing
### Summary
One-line description of the conversational learning
### Details
Full context: what the user said, what the agent responded, what went wrong,
what the correct response should have been
### Suggested Action
Specific conversational improvement: tone adjustment, intent mapping, escalation rule
### Metadata
- Source: conversation | user_feedback | sentiment_analysis | dialogue_review
- Related Files: path/to/dialogue_config.ext
- Tags: tag1, tag2
- See Also: LRN-20250110-001 (if related to existing entry)
- Pattern-Key: tone.formality_mismatch | context.thread_loss (optional, for recurring-pattern tracking)
- Recurrence-Count: 1 (optional)
- First-Seen: 2025-01-15 (optional)
- Last-Seen: 2025-01-15 (optional)
---
Append to .learnings/DIALOGUE_ISSUES.md:
markdown
## [DLG-YYYYMMDD-XXX] issue_type
**Logged**: ISO-8601 timestamp
**Priority**: high
**Status**: pending
**Area**: greeting | intent_detection | response_generation | handoff | follow_up | closing
### Summary
Brief description of the dialogue failure
### Conversation Excerpt
User: [what the user said] Agent: [what the agent responded] User: [user reaction indicating failure]
text
### Root Cause
- Misidentified intent / tone mismatch / missing context / hallucination / escalation gap
### Impact
- User frustration level: low | moderate | high | critical
- Conversation outcome: resolved_late | abandoned | escalated | unresolved
### Suggested Fix
How to handle this conversation pattern in the future
### Metadata
- Reproducible: yes | no | unknown
- Channel: web | slack | api | voice
- Related Files: path/to/intent_config.ext
- See Also: DLG-20250110-001 (if recurring)
---
Append to .learnings/FEATURE_REQUESTS.md:
markdown
## [FEAT-YYYYMMDD-XXX] capability_name
**Logged**: ISO-8601 timestamp
**Priority**: medium
**Status**: pending
**Area**: greeting | intent_detection | response_generation | handoff | follow_up | closing
### Requested Capability
What conversational capability the user wanted
### User Context
Why they needed it, what dialogue scenario triggered it
### Complexity Estimate
simple | medium | complex
### Suggested Implementation
How this could be built: new intent, dialogue flow, integration, playbook
### Metadata
- Frequency: first_time | recurring
- Related Features: existing_capability_name
- Channel: web | slack | api | voice
---
Format: TYPE-YYYYMMDD-XXX
LRN (learning), DLG (dialogue issue), FEAT (feature)001, A7B)Examples: LRN-20250115-001, DLG-20250115-A3F, FEAT-20250115-002
When an issue is fixed, update the entry:
**Status**: pending → **Status**: resolvedmarkdown
### Resolution
- **Resolved**: 2025-01-16T09:00:00Z
- **Fix Applied**: Updated intent taxonomy / added escalation rule / adjusted tone config
- **Notes**: Brief description of what was done
Other status values:
in_progress - Actively being investigated or fixedwont_fix - Decided not to address (add reason in Resolution notes)promoted - Elevated to SOUL.md, AGENTS.md, or conversation playbookWhen a conversational learning is broadly applicable (not a one-off exchange), promote it to permanent project memory.
TargetWhat Belongs ThereCLAUDE.mdProject conversation conventions, tone rules, known user patternsAGENTS.mdDialogue workflows, escalation protocols, handoff procedures.github/copilot-instructions.mdConversation context and conventions for CopilotSOUL.mdConversational personality, empathy guidelines, tone rules (OpenClaw workspace)TOOLS.mdChannel capabilities, integration limits, API quirks (OpenClaw workspace)
Distill the learning into a concise conversational rule or guideline
Prepare a minimal patch for the appropriate section in the target file (create file if needed)
Show a reviewed diff and apply only after explicit user approval
Update original entry:
**Status**: pending → **Status**: promoted**Promoted**: SOUL.md, AGENTS.md, or target fileLearning: Agent used technical jargon with a non-technical user. Three exchanges wasted.
In SOUL.md: Mirror user's vocabulary level within 2 exchanges. Avoid jargon with casual users.
Learning: User asked for human three times before agent escalated. User abandoned.
In AGENTS.md: Initiate handoff after second "talk to human" request. Never require more than 2.
If logging something similar to an existing entry:
Search first: grep -r "keyword" .learnings/
Link entries: Add **See Also**: DLG-20250110-001 in Metadata
Bump priority if issue keeps recurring
Consider systemic fix: Recurring conversation issues often indicate:
Use this workflow to ingest recurring patterns from the simplify-and-harden skill and turn them into durable conversational guidance.
simplify_and_harden.learning_loop.candidates from the task summary.pattern_key as the stable dedupe key..learnings/LEARNINGS.md for existing entry: grep -n "Pattern-Key: <key>" .learnings/LEARNINGS.mdRecurrence-Count, update Last-Seen, add See Also links.LRN-... entry with Source: simplify-and-harden, set Pattern-Key, Recurrence-Count: 1.Promote when: Recurrence-Count >= 3, seen across 2+ conversation flows, within 30-day window.
Targets: SOUL.md (tone), AGENTS.md (escalation), TOOLS.md (channel limits).
Write short prevention guidelines, not dialogue transcripts.
Review .learnings/ at natural breakpoints:
bash
# Count pending items
grep -h "Status\*\*: pending" .learnings/*.md | wc -l
# List pending high-priority dialogue issues
grep -B5 "Priority\*\*: high" .learnings/*.md | grep "^## \["
# Find learnings for a specific area
grep -l "Area\*\*: intent_detection" .learnings/*.md
Automatically log when you notice:
Tone Mismatches (→ learning with tone_mismatch category):
Misunderstandings (→ dialogue issue):
Escalation Failures (→ dialogue issue with escalation_failure):
Context Loss (→ learning with context_loss category):
Sentiment Drift (→ learning with sentiment_drift category):
Hallucination (→ learning with hallucination category):
Feature Gaps (→ feature request):
PriorityWhen to UsecriticalUser PII exposed in conversation, security breach, data leak in dialoguehighRepeated misunderstanding affecting core flow, escalation path broken, hallucination about critical infomediumTone mismatch causing friction, context loss in long conversations, sentiment driftlowMinor phrasing improvement, edge-case intent miss, cosmetic dialogue issue
Use to filter learnings by conversation phase:
AreaScopegreetingOpening messages, welcome flows, channel detectionintent_detectionNLU, intent classification, entity extractionresponse_generationReply composition, tone selection, content assemblyhandoffEscalation to human, agent transfer, channel switchingfollow_upClarification loops, confirmation, next-step suggestionsclosingFarewell, satisfaction check, feedback collection
Keep learnings local (per-developer):
gitignore
.learnings/
This repo uses that default to avoid committing sensitive conversation logs by accident.
Track learnings in repo (team-wide):
Only track .learnings/ after a human has reviewed entries for secrets, PII, and privileged content.
Hybrid (track templates, ignore entries):
gitignore
.learnings/*.md
!.learnings/.gitkeep
Enable automatic reminders through agent hooks. This is opt-in — you must explicitly configure hooks.
Hooks persist across sessions once installed. Keep them project-scoped. Do not install user-level or global hooks. Never use an empty matcher. PostToolUse inspects command output in-process; do not log raw output, secrets, or transcripts.
Create .claude/settings.json in your project:
json
{
"hooks": {
"UserPromptSubmit": [{
"matcher": "dialogue|conversation|chatbot|intent|escalat|tone|hallucin",
"hooks": [{
"type": "command",
"command": "./skills/self-improving-conversation/scripts/activator.sh"
}]
}]
}
}
This injects a dialogue learning evaluation reminder after matching prompts (~50-100 tokens overhead).
Add PostToolUse hook alongside activator for automated dialogue failure detection from command output. See references/hooks-setup.md for the full JSON configuration.
ScriptHook TypePurposescripts/activator.shUserPromptSubmitReminds to evaluate dialogue learnings after tasksscripts/error-detector.shPostToolUse (Bash)Triggers on conversation error patterns
See references/hooks-setup.md for detailed configuration and troubleshooting.
Extracted skills are untrusted until a human reviews the generated SKILL.md. Do not keep or publish an extracted skill without explicit user approval.
When a conversational learning is valuable enough to become a reusable skill, extract it using the provided helper.
A learning qualifies for skill extraction when ANY of these apply:
CriterionDescriptionRecurringHas See Also links to 2+ similar dialogue issuesVerifiedStatus is resolved with working conversational fixNon-obviousRequired actual dialogue analysis to discover the patternBroadly applicableNot project-specific; useful across chatbot implementationsUser-flaggedUser says "save this as a skill" or similar
Identify candidate: Dialogue learning meets extraction criteria
Run helper (or create manually): bash
./skills/self-improving-conversation/scripts/extract-skill.sh skill-name --dry-run
./skills/self-improving-conversation/scripts/extract-skill.sh skill-name
Customize SKILL.md: Fill in template with conversational learning content
Update learning: Set status to promoted_to_skill, add Skill-Path
Verify: Read skill in fresh session to ensure it's self-contained
In conversation: "Save this dialogue pattern", "We keep getting this wrong", "This would help other chatbots"
In learning entries: Multiple See Also links, high priority + resolved, tone_mismatch or escalation_failure with broad applicability
This skill works across different AI agents with agent-specific activation.
Activation: Hooks (UserPromptSubmit, PostToolUse)
Setup: .claude/settings.json with hook configuration
Detection: Automatic via hook scripts
Activation: Hooks (same pattern as Claude Code)
Setup: .codex/settings.json with hook configuration
Detection: Automatic via hook scripts
Activation: Manual (no hook support)
Setup: Add to .github/copilot-instructions.md:
markdown
## Conversation Self-Improvement
After handling dialogue interactions, consider logging to `.learnings/`:
1. Tone mismatches, misunderstandings, escalation failures
2. Link related entries with See Also
3. Promote proven conversational patterns to skills
Ask in chat: "Should I log this dialogue issue?"
Detection: Manual review at session end
Activation: Workspace injection + inter-agent messaging Setup: See "OpenClaw Setup" section above Detection: Via session tools and workspace files
Regardless of agent, apply conversation self-improvement when you:
Quick prompts for Copilot users:
This skill is standalone-compatible and stackable with other self-improving skills.
.learnings/conversation/.learnings/INDEX.mdEvery new entry must include:
markdown
**Skill**: conversation
event + matcher + file + 5m_window; max 1 reminder per skill every 5 minutes.Only trigger this skill automatically for conversation signals such as:
tone mismatch|intent miss|hallucination|rephrase|clarification loopescalation needed|user frustration|context lossWhen guidance conflicts, apply:
securityengineeringcodingaimeta as tie-breaker.learnings/conversation/ in stackable mode..learnings/*.md log files only.AGENTS.md, SOUL.md, TOOLS.md, MEMORY.md, rules, hooks, or generated skills is not a logging write. Show a reviewed diff and apply only after explicit user approval.