Emotion State
NL emotion tracking + prompt injection via OpenClaw hook
tashfeenahmed
@tashfeenahmed
What This Skill Does
Tracks user and agent emotions as natural-language phrases and injects them into the system prompt via an OpenClaw hook. Stores per-user emotion state across sessions with decayed trend lines.
Replaces manually writing emotion-tracking logic by automatically evaluating, storing, and injecting emotion context into every agent prompt.
When to Use It
- Add emotional context to agent responses in customer support conversations
- Track user frustration levels over multiple chat sessions
- Enable agents to adapt tone based on detected user emotion
- Inject emotion trend data into prompts for role-playing or therapeutic bots
- Log inferred emotional states for post-session analysis without storing raw user text
Install
$ openclaw skills install @tashfeenahmed/emotion-stateEmotion State (NL) Skill
This skill describes how to install and configure the Emotion State hook, which
adds a compact emotion_state block to the system prompt.
What it does
- Evaluates user and agent emotions as short natural-language phrases.
- Stores per-user emotion state across sessions in the agent state directory.
- Injects the latest entries plus a decayed trend line into the system prompt.
Install & enable (workspace hook)
- After installing the skill, copy the bundled hook into your workspace:
cp -R ./skills/emotion-state/hooks/emotion-state ./hooks/
- Enable the hook in OpenClaw:
openclaw hooks enable emotion-state
- Restart the OpenClaw gateway.
Configuration
Set environment variables for the hook via OpenClaw config, e.g. in
~/.openclaw/openclaw.json:
{
"hooks": {
"internal": {
"enabled": true,
"entries": {
"emotion-state": {
"enabled": true,
"env": {
"EMOTION_CLASSIFIER_URL": "",
"OPENAI_API_KEY": "YOUR_KEY",
"OPENAI_BASE_URL": "https://api.openai.com/v1",
"EMOTION_MODEL": "gpt-4o-mini",
"EMOTION_CONFIDENCE_MIN": "0.35",
"EMOTION_HISTORY_SIZE": "100",
"EMOTION_HALF_LIFE_HOURS": "12",
"EMOTION_TREND_WINDOW_HOURS": "24",
"EMOTION_MAX_USER_ENTRIES": "3",
"EMOTION_MAX_AGENT_ENTRIES": "2",
"EMOTION_MAX_OTHER_AGENTS": "3",
"EMOTION_TIMEZONE": "America/Los_Angeles"
}
}
}
}
}
}
Notes
- The hook stores state at
~/.openclaw/agents/<agentId>/agent/emotion-state.json. - It does not store raw user text; only model-inferred reasons.
- If the classifier fails, entries fall back to
neutral/low/unsure.
Top skills in this category
self-improving agent
@pskoettCaptures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude rea
Skill Vetter
@spclaudehomeSecurity-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
Self-Improving + Proactive Agent
@ivangdavilaSelf-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when...
Proactive Agent
@halthelobsterTransform AI agents from task-followers into proactive partners that anticipate needs and continuously improve. Now with WAL Protocol, Working Buffer, Autonomous Crons, and battle-tested patterns. Part of the Hal Stack 🦞
Agent Browser
@matrixyHeadless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection