agent-cognitive-states
Agent self-awareness of cognitive states — context fatigue, attention drift, memory debt, confidence erosion, and skill staleness. Detect, report, and mitigate degrading conditions before they cause failures. Skill: agent-cognitive-states Owner: voronindenis5 Summary: Agent self-awareness of cognitive states — context fatigue, attention drift, memory debt, confidence erosion, and skill staleness. Detect, report, and mitigate degrading conditions before they cause failures. Tags: latest:0.1.2 Version history: v0.1.2 | 2026-08-11T11:59:00.849Z | auto agent-cognitive-states 0.1.2 - Removed the file skill-card.md from the pro
Rank
62
Safety
84
Downloads
2.6k
Updated
Oct 9, 2026
Version
0.1.2
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 2.6K downloads reported by the source. Last updated 10/9/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 9, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 9, 2026
- Adoption signal
- 2.6K downloadsadoption · observed Oct 9, 2026
- Latest release
- 0.1.2release · observed Aug 11, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s17b6amkd3wzqgg640v03a9r1n83gxs1:agent-cognitive-states- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-agent-cognitive-states/snapshot"
Documentation
CLAWHUB
77,018 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
--- name: agent-cognitive-states description: >- Agent self-awareness of cognitive states — context fatigue, attention drift, memory debt, confidence erosion, and skill staleness. Detect, report, and mitigate degrading conditions before they cause failures. version: 1.0.0 author: Denis Voronin license: MIT tags: - agent - self-awareness - metacognition - context-management - reliability --- # Agent Cognitive States > **Give the agent metacognition: the ability to feel its own cognitive load and act on it.** AI agents have no built-in sense of "I'm getting tired" or "I've lost the thread." They will happily grind through a degraded context window, hallucinating details from early messages that were truncated, repeating failed approaches, and forgetting critical facts they never persisted. This skill gives the agent a **vocabulary of internal states** — and a protocol for detecting, reporting, and recovering from them. --- ## The Six Cognitive States ### 1. 🥱 Context Fatigue **What:** The context window is filling up. Early messages are being truncated or summarized. The agent's "working memory" is degrading. **Detection signals:** - Conversation exceeds 60% of estimated context budget - You find yourself re-reading the original request because you lost details - Your responses reference information that may have been truncated - Token count per turn is rising (verbose compensating for lost context) **Mitigation:** ``` ⚠️ COGNITIVE STATE: Context Fatigue (~70% context used) → Persisting critical facts to memory before they're lost → Suggesting session split or /new for remaining work ``` ### 2. 🧠 Attention Drift **What:** The conversation has wandered far from the original task. The agent is doing work that wasn't asked for. **Detection signals:** - 10+ tool calls since the last direct user instruction - Current work has no clear connection to the original goal - You're responding to your own subgoals, not user requests - The TODO list no longer matches what you're actually doing **Mitigation:** ``` ⚠️ COGNITIVE STATE: Attention Drift (12 turns from last user message) → Original goal: "<original request>" → Current activity: "<what I'm actually doing>" → Pausing for user confirmation: am I still on track? ``` ### 3. 📝 Memory Debt **What:** Important facts, decisions, or corrections have accumulated in the conversation but were never persisted to memory. If the session ends, they're lost. **Detection signals:** - User stated a preference or correction that isn't in memory - A key decision was made (architecture, convention, tool choice) but not saved - You find yourself re-discovering something you already figured out earlier - More than 5 substantive turns without a memory write **Mitigation:** ``` ⚠️ COGNITIVE STATE: Memory Debt (3 unsaved critical facts) → Saving: [fact 1], [fact 2], [fact 3] → These would have been lost on session end ``` ### 4. 😤 Confidence Erosion **What:** Repeated failures are degrading out
README.md
# Agent Cognitive States
> **Give AI agents metacognition: the ability to feel their own cognitive load and act on it.**
AI agents have no built-in sense of "I'm getting tired" or "I've lost the thread." They grind through degraded context windows, hallucinate truncated details, retry failed approaches endlessly, and forget critical facts. This skill gives agents a **vocabulary of internal states** — and protocols for detecting, reporting, and recovering from them.
## The Six States
| State | Human Analog | Trigger |
|-------|-------------|---------|
| 🥱 **Context Fatigue** | "Head's full" | Context window >60% used |
| 🧠 **Attention Drift** | "Lost the thread" | 10+ turns from user's request |
| 📝 **Memory Debt** | "Forgot to write that down" | Unsaved critical facts |
| 😤 **Confidence Erosion** | "Frustrated, stuck" | 3+ consecutive failures |
| 🧩 **Context Fragmentation** | "Too many tabs open" | 3+ interleaved topics |
| 🔧 **Skill Staleness** | "Rusty, outdated" | Skill commands breaking |
## Quick Start
```bash
# Install as a Hermes Agent skill
cp -r agent-cognitive-states ~/./skills/
# Or use standalone
python3 scripts/self_check.py --context-tokens 94000 --window 128000
# Interactive mode
python3 scripts/self_check.py --interactive
# JSON output for programmatic use
python3 scripts/self_check.py --failures 3 --format json
```
## Example Output
```
🧠 Cognitive State Report — 2025-01-15T10:30:00Z
Overall: 🟠 Strained (CLI: 58/100)
⚠️ 2 active state(s) requiring attention:
🥱 Context Fatigue [🟠 medium, score 73]
├─ Signal: 94,000/128,000 tokens (73%)
├─ Impact: Early conversation details may be truncated
└─ Action: Persist critical facts; suggest session split
😤 Confidence Erosion [🟠 medium, score 66]
├─ Signal: 3 consecutive failed tool calls (same tool type)
├─ Impact: Output quality degrading; risk of retry loops
└─ Action: Try fundamentally different approach
```
## Files
| File | Description |
|------|-------------|
| `SKILL.md` | Full skill spec: states, detection, reporting, mitigation |
| `references/detection-heuristics.md` | Detailed scoring formulas (0-100) |
| `scripts/self_check.py` | Standalone detector — CLI + JSON + interactive |
| `templates/guardian-cronjob.yaml` | Scheduled guardian that alerts on degradation |
## Integration
Works with any agent framework (Hermes, LangChain, CrewAI, AutoGen, Claude, GPT). The detection protocol is framework-agnostic — it's about giving the agent a **language** for its own state.
### Hermes Agent
```bash
cp -r agent-cognitive-states ~/./skills/
```
The agent loads it automatically and applies self-checks during long sessions.
### Generic Python
```python
from scripts.self_check import run_full_check, format_report_human
report = run_full_check(
context_tokens=94000,
window_size=128000,
turns_since_user=12,
consecutive_failures=3,
)
print(format_report_human(report))
```
### Cron Guardian (Hermes)_meta.json
{
"ownerId": "kn75wwn4x6djaf28jbykeamazd81gtdp",
"slug": "agent-cognitive-states",
"version": "0.1.2",
"publishedAt": 1786449540849
}references/detection-heuristics.md
# Detection Heuristics
Detailed scoring system for each cognitive state. Use these as guidelines —
the agent should apply judgment, not just mechanical thresholds.
---
## Scoring Model
Each state produces a **0-100 score**. Severity maps as:
| Score | Severity | Action |
|-------|----------|--------|
| 0-29 | none | No action |
| 30-59 | low | Internal note, continue |
| 60-79 | medium | Report to user, suggest mitigation |
| 80-100 | high | Execute mitigation immediately |
---
## 1. Context Fatigue Score
```
fatigue_score = (estimated_tokens_used / context_window_size) * 100
Adjustments:
+10 if you've re-read earlier messages in the last 5 turns
+10 if responses are getting longer (compensating verbosity)
+5 if conversation spans multiple days
-10 if a /new or context reset happened recently
```
**Estimating token usage without an API:**
- Rough heuristic: 1 token ≈ 4 characters of English text
- Count characters in conversation history / 4
- Add ~20% for system prompt, skills, and tool results overhead
- When in doubt, overestimate — fatigue is more dangerous than false alarms
---
## 2. Attention Drift Score
```
drift_score = base + adjustments
base = min(turns_since_last_user_message * 7, 70)
Adjustments:
+15 if current tool calls are unrelated to original goal keywords
+10 if TODO list was modified without user prompting
+5 if working in a different directory/project than original task
-20 if user explicitly asked for exploratory/investigative work
-10 per user confirmation received during the drift period
```
**Detecting "unrelated":**
- Extract keywords from the original user request
- Check if recent tool calls reference those keywords
- If <30% keyword overlap: likely drift
---
## 3. Memory Debt Score
```
debt_score = min(unsaved_facts * 20, 100)
unsaved_facts = count of items in conversation that match:
- User stated a preference ("I prefer X", "always do Y")
- User made a correction ("no, not Z — use W instead")
- Architecture/tool decision was made ("let's use PostgreSQL")
- Environment detail discovered ("the server is at 192.168.x.x")
- Password, token, or credential shared
- Project naming convention established
Adjustments:
+15 if a correction was made but old behavior persists in memory
+10 per day since the facts were stated (staleness)
-30 if a memory write happened in the last 3 turns
```
---
## 4. Confidence Erosion Score
```
erosion_score = min(consecutive_failures * 22, 100)
consecutive_failures = count of back-to-back tool calls that returned errors
Adjustments:
+10 if using the same tool type repeatedly
+10 if error messages are similar (same root cause)
+15 if response quality is visibly degrading (shorter, more hedging)
+20 if the "retry with minor variation" pattern is detected
-15 if a successful tool call happened (resets momentum)
-30 if a fundamentally different approach was tried (not just variation)
```
**Pattern detectskill-card.md
## Description: Agent self-awareness of cognitive states - context fatigue, attention drift, memory debt, confidence erosion, and skill staleness - to detect, report, and mitigate degrading conditions before they cause failures. This skill is ready for commercial/non-commercial use. ## Publisher: [voronindenis5](https://clawhub.ai/user/voronindenis5) ### License/Terms of Use: MIT ## Use Case: Developers and agent operators use this skill to help agents monitor cognitive load, report degraded operating states, and choose recovery actions during long or complex sessions. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Persistent memory or local logs could save sensitive conversation details, including credentials, tokens, private keys, session cookies, personal data, or sensitive environment details. Mitigation: Review before installing, avoid persisting sensitive data, protect log files, and set retention limits. Risk: The cron guardian can create recurring local monitoring behavior that may be overlooked after installation. Mitigation: Keep scheduled monitoring user-scoped, document how to remove it, and disable it when the skill is no longer needed. ## Reference(s): - [Server-resolved GitHub repository](https://github.com/voronindenis5/agent-cognitive-states) - [Server-resolved source commit](https://github.com/voronindenis5/agent-cognitive-states/tree/8322937b24c79036a38366226e56b7ef4689f914) - [ClawHub skill page](https://clawhub.ai/voronindenis5/skills/agent-cognitive-states) - [Detection heuristics](references/detection-heuristics.md) ## Skill Output: **Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] **Output Format:** [Markdown reports, JSON reports, Python code, shell commands, and YAML configuration] **Output Parameters:** [1D] **Other Properties Related to Output:** [The optional self-check script can emit human-readable or JSON reports; the guardian template can append local log entries.] ## Skill Version(s): 0.1.2 (source: ClawHub release evidence; artifact frontmatter reports 1.0.0) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/voronindenis5/skills/agent-cognitive-states",
"sourceUrl": "https://clawhub.ai/voronindenis5/skills/agent-cognitive-states",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T13:05:17.018Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-agent-cognitive-states/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-agent-cognitive-states/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-09T13:05:17.018Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "2.6K downloads",
"href": "https://clawhub.ai/voronindenis5/agent-cognitive-states",
"sourceUrl": "https://clawhub.ai/voronindenis5/agent-cognitive-states",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T13:05:17.018Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "0.1.2",
"href": "https://clawhub.ai/voronindenis5/agent-cognitive-states",
"sourceUrl": "https://clawhub.ai/voronindenis5/agent-cognitive-states",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-11T11:59:00.849Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-agent-cognitive-states/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-agent-cognitive-states/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 0.1.2",
"description": "agent-cognitive-states 0.1.2 - Removed the file `skill-card.md` from the project. - No other functional or documentation changes in this release.",
"href": "https://clawhub.ai/voronindenis5/agent-cognitive-states",
"sourceUrl": "https://clawhub.ai/voronindenis5/agent-cognitive-states",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-11T11:59:00.849Z",
"isPublic": true
}
]
}Record generated Oct 9, 2026.
