Meditate

From kbanc85/claudia · View interactive version

Meditate is an AI agent skill from the GitHub repository kbanc85/claudia. End-of-session reflection generating persistent learnings about user preferences, communication patterns, and cross-session insights. Activates when wrapping up a session, or when user says "let's wrap up", "end the session", "time to reflect", or "meditate". Also extracts judgment rules from decisi

How to use this skill

Skill file

Meditate

End-of-session reflection that generates persistent learnings. These reflections inform future sessions, helping Claudia remember not just what happened, but what it learned about working with this user.

When to Activate

What Reflections Are

Reflections are user-approved insights that decay very slowly and compound over time. They capture:

| Type | Focus | Example |

|------|-------|---------|

| observation | User behavior or preference | "User prefers bullet points over paragraphs for status updates" |

| pattern | Recurring theme across sessions | "Mondays typically involve financial review tasks" |

| learning | How to work better with this user | "Direct questions get better responses than open-ended ones" |

| question | Worth revisiting later | "How did the negotiation with Acme resolve?" |

Key difference from memories: Memories are facts about the world. Reflections are learnings about working with this specific user.


Process

Step 1: Gather Context

Silently retrieve:

Step 2: Generate Reflections

Review the session and identify 1-3 reflections. Ask yourself:

  1. What did I learn about how this user prefers to work?
  1. What patterns am I seeing across sessions?
  1. What should I do differently next time?
  1. What questions remain open?
  1. Did any judgment-relevant decisions happen this session?

If yes, draft a judgment rule for each (see Step 3). Not every session produces judgment rules. Most won't. Only propose rules when behavior clearly indicates a repeatable business trade-off.

Quality over quantity. One genuine insight beats three generic observations.

Step 2b: Loop harness review (only if loops ran this session)

If any Maker-Checker loop ran this session (auto-research, or a wrapped daemon job), review how the harness itself performed, separately from reflections about the user. Read the signal from the status files gathered in Step 1, not from memory:

If a clear, repeatable harness problem emerges, draft a harness-improvement proposal: a concrete edit to a rubric, the Maker brief (.claude/skills/_loop/maker.md), the Checker brief (.claude/skills/_loop/checker.md), or a new judgment rule about how to run loops. Do not apply it yet. Harness proposals go through the Checker gate in Step 5.

Most sessions produce no harness proposal. Raise one only when the evidence is in the status files.

Step 3: Present for Approval

Format reflections clearly and ask for approval:

---
**Session Reflection**

Today we [brief 1-2 sentence summary of what happened].

**What I'm taking away:**

1. **Observation:** [User behavior/preference noticed]
2. **Learning:** [How to work better with this user]
3. **Question:** [Something worth revisiting]

*Do these feel accurate? Say "looks good" to save, or tell me what to change.*

---

If judgment-relevant decisions were identified in question 5, append proposed rules after the reflections:

**Proposed Judgment Rules:**

4. **Rule (escalation):** Always surface commitments to Sarah Chen within 72h of deadline
   - *Based on:* You checked on the Sarah proposal three times this session
   - *Category:* escalation

5. **Rule (priorities):** Client deliverables always take precedence over internal ops
   - *Based on:* You explicitly said "client work first, always"
   - *Category:* priorities

*These would be saved to your judgment rules file so I apply them in future sessions.*
*Say "looks good" to save everything, or tell me what to adjust.*

---

Only propose rules when the evidence is clear. A single offhand comment is not enough. Look for:

Step 4: Handle Edits

User responses:

| Response | Action |

|----------|--------|

| "Looks good" / "Save it" | Store all reflections and approved judgment rules |

| "Remove the second one" | Delete that reflection, store others |

| "That's not quite right about X" | Edit that reflection, then confirm |

| "Skip" / "Don't save anything" | End without storing |

| User provides correction | Update the reflection content |

Judgment rule responses:

| Response | Action |

|----------|--------|

| "Remove the rule" | Store reflections only, skip the judgment rule |

| "Make it broader" | Generalize the rule (e.g., "Sarah" -> "all key clients"), re-confirm |

| "That should apply to all clients" | Widen scope of the rule, re-confirm |

| "Make it narrower" | Restrict the rule scope, re-confirm |

| "Save the reflections but not the rules" | Store reflections, skip all judgment rules |

Step 5: Store and Close

Call the memory_end_session MCP tool with:

If judgment rules were approved, also write them to context/judgment.yaml:

  1. Read context/judgment.yaml (if it exists)
  2. If the file doesn't exist, create it with the initial structure:

```yaml

version: 1

meta: [] # rules that resolve conflicts between other rules

priorities: []

escalation: []

overrides: []

surfacing: []

delegation: []

process: []

```

  1. Get the next free ID from the script, never by reading the file yourself:

```bash

python3 .claude/hooks/judgment-sync.py next

```

IDs are unique across the WHOLE file, not per section. Rules drift between

sections over time (an esc- rule can end up filed under process), so

counting within a category reads the wrong set and silently reuses an ID that

already belongs to another rule. This has happened twice.

  1. Append each approved rule to the appropriate category, in this shape:

```yaml

escalation:

rule: "The directive itself, first sentence standalone. See below."

context: "What happened this session that produced the rule."

source: meditate/2026-08-11

domain: video # OPTIONAL. See step 5.

```

Write the directive as the first sentence. The always-on view shortens

long rules to their first sentence or clause, so a rule that opens with

preamble loses its instruction. Lead with what to do; put caveats,

cross-references and rationale after.

  1. Decide whether the rule needs to be resident. Every rule is at least

named in the always-on view; the tag only decides how much text rides along.

anything that could apply when you are not expecting it.

ID stays resident, grouped under that domain, and the full text is fetched

before working in that area. Use this ONLY when the rule is meaningless

outside a recognisable activity.

esc-, are always carried in full and ignore domain:. Safety gates fire

when nobody is looking for them, so they are never abbreviated.

  1. Set source to meditate/YYYY-MM-DD (today's date)
  2. Write the updated file
  3. Regenerate the always-on view, and report the result:

```bash

python3 .claude/hooks/judgment-sync.py --write

```

Until this runs, the rule exists in the archive but is not applied. If the

script reports the file is over budget, say so and offer to tag the named

rules with a domain: so they become activity-scoped. Do not skip this step:

the failure it prevents is invisible.

Harness proposals go through the Checker before anything is written (Proposal 11, E4). If Step 2b produced a harness-improvement proposal (a rubric edit, a Maker or Checker brief edit, or a loop-running judgment rule), validate it first:

  1. Dispatch the loop-checker agent with the proposal as the artifact and a one-line rubric: "does this change actually fix the observed failure without breaking the brief's contract?"
  2. Write the proposal only if the Checker returns verified: true. A proposal the Checker rejects is surfaced to the user as an open question, not saved.
  3. Edits to shipped briefs (_loop/maker.md, _loop/checker.md) are never auto-applied. Present them as a diff for the user to approve, like any other change to Claudia's own files. Loop-running judgment rules go into context/judgment.yaml like any other rule, after passing the Checker.

Confirm storage with both reflections and rules:

"Got it. I've saved [N] reflection(s) and added [M] judgment rule(s) to your judgment file. I'll apply them going forward. See you next time."

If only reflections (no rules): "Got it, I'll keep that in mind. See you next time."


Data Model

Storage

Reflections are stored in the memory system's reflections table with:

Aggregation

When similar reflections accumulate over time:

Retrieval

Reflections surface through:


What Makes Good Reflections

Good Examples

Avoid


Natural Language Editing

Users can modify reflections anytime in future sessions:

User: "That thing you learned about me preferring bullet points -
       that's only for technical content, not conversations."

Claudia:
1. Call the `memory_reflections` MCP tool with query: "bullet points" to find the reflection
2. Call the `memory_reflections` MCP tool with action: "update", id: <id>, content: "..." to update
3. Confirm: "Updated. I'll keep that distinction in mind."
User: "Delete the reflection about Monday mornings"

Claudia:
1. Search for the reflection via `memory_reflections` MCP tool
2. Call the `memory_reflections` MCP tool with action: "delete", id: <id> to delete
3. Confirm: "Done, I've removed that."
User: "Show me all your reflections about me"

Claudia:
1. Call the `memory_reflections` MCP tool with limit: 50
2. Format nicely with timeline info
3. Offer to edit or delete any

Integration with Other Skills

Judgment Rules

The meditate skill is the primary mechanism for creating judgment rules. When session behavior reveals business trade-offs, priorities, or preferences, meditate proposes rules that get saved to context/judgment.yaml. Rules are loaded by the SessionStart hook .claude/hooks/judgment-sync.py, which regenerates .claude/rules/judgment-active.md from the archive. See the judgment-awareness skill for how to apply and expand them.

Morning Brief

When generating morning brief, pull relevant reflections:

Memory Manager

The memory-manager skill handles natural language reflection queries:

Session Start

At session start, load high-importance reflections to inform the interaction style. Don't announce them, just apply them.


Without Memory Tools

If the memory MCP tools are unavailable, store reflections in context/learnings.md:

## Reflections

### Communication Preferences
- [date] Prefers bullet points for status updates
- [date] Likes getting the answer first

### Work Patterns
- [date] Mondays involve financial review

### Open Questions
- [date] How did the Acme negotiation resolve?

Tone


Examples

Example 1: After a productive planning session

---
**Session Reflection**

Today we mapped out the Q2 product roadmap and prioritized the feature backlog. Good energy throughout.

**What I'm taking away:**

1. **Observation:** You think best when I lay out options visually (the table format landed well)
2. **Learning:** For planning sessions, I should front-load structure rather than discover it together
3. **Pattern:** This is the third planning session that's gone long. You might benefit from time-boxing these.

*Do these feel accurate? Say "looks good" to save, or tell me what to change.*

---

Example 2: After a frustrating debugging session

---
**Session Reflection**

Today we tracked down that authentication bug. Took a few false starts but got there.

**What I'm taking away:**

1. **Learning:** When debugging, you prefer I show my reasoning rather than just the answer. Helps you learn the codebase.
2. **Question:** You mentioned the auth system needs a bigger refactor. Worth revisiting when there's time?

*Do these feel accurate?*

---

Example 3: After a quick check-in

---
**Session Reflection**

Quick session today. Reviewed the proposal draft and made some edits.

**What I'm taking away:**

1. **Observation:** For document reviews, you prefer me to make edits directly rather than suggest them. "Just fix it" mode.

*Sound right?*

---

Example 4: Session with judgment-relevant behavior

---
**Session Reflection**

Today we triaged a busy week and you reorganized your priorities after that unexpected investor call.

**What I'm taking away:**

1. **Learning:** When investor communications arrive, you drop everything else to respond. Speed matters more than polish for these.
2. **Observation:** You checked on the Acme proposal status three times unprompted. That one's weighing on you.

**Proposed Judgment Rules:**

3. **Rule (priorities):** Investor communications take precedence over all other tasks
   - *Based on:* You explicitly said "investors always come first" and reorganized your entire day around the call
   - *Category:* priorities

4. **Rule (escalation):** Surface Acme proposal status in every session until it's resolved
   - *Based on:* You checked on it three times without me prompting
   - *Category:* surfacing

*These would be saved to your judgment rules file so I apply them in future sessions.*
*Do these feel accurate? Say "looks good" to save, or tell me what to adjust.*

---
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.