Skip to content
Skills Library
AI & agents · Automation

memory-system

/memory-system

Tiered, low-token project memory protocol for .toh/memory/ — 7 files across 3 tiers (Tier 1 active.md + summary.md always read, ~800 tokens; Tier 2 architecture/components for build work and changelog for debug work; Tier 3 decisions/agents-log only on demand). Auto-saves after task completion with zero user effort; delegated agents receive context from the orchestrator instead of re-reading. Use at every session start and whenever loading or saving project memory or resuming context across sessions and IDEs.

Licence
MIT
Last repository change
02.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
5
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Tiered, low-token project memory protocol for .toh/memory/ — 7 files across 3 tiers (Tier 1 active.md + summary.md always read, ~800 tokens; Tier 2 architecture/components for build work and changelog for debug work; Tier 3 decisions/agents-log only on demand). Auto-saves after task completion with zero user effort; delegated agents receive context from the orchestrator instead of re-reading. Use at every session start and whenever loading or saving project memory or resuming context across sessions and IDEs.

Original author description

Tiered, low-token project memory protocol for .toh/memory/ — 7 files across 3 tiers (Tier 1 active.md + summary.md always read, ~800 tokens; Tier 2 architecture/components for build work and changelog for debug work; Tier 3 decisions/agents-log only on demand). Auto-saves after task completion with zero user effort; delegated agents receive context from the orchestrator instead of re-reading. Use at every session start and whenever loading or saving project memory or resuming context across sessions and IDEs.

How it works

  1. Overview
  2. 📚 The Tiered Model (use this everywhere)
  3. 📁 Directory Structure
  4. 🔄 Read Protocol (session start)
  5. 💾 Save Protocol (after completing work)
  6. 🗂️ File Reference
  7. 📝 Templates
  8. ⚠️ Anti-Patterns
  9. 🔗 Integration
Original SKILL.md headings · 192 lines, 1,148 words
SKILL.md preview
---
name: memory-system
description: >
  Tiered, low-token project memory protocol for .toh/memory/ — 7 files across
  3 tiers (Tier 1 active.md + summary.md always read, ~800 tokens; Tier 2
  architecture/components for build work and changelog for debug work; Tier 3
  decisions/agents-log only on demand). Auto-saves after task completion with
  zero user effort; delegated agents receive context from the orchestrator
  instead of re-reading. Use at every session start and whenever loading or
  saving project memory or resuming context across sessions and IDEs.
user-invocable: false  # internal — model-invoked via toh-* commands, not a user /command
---
# 🧠 Memory System Skill

> **Purpose:** Tiered, low-token memory — load only what the task needs, save what matters
> **Version:** 2.0.0
> **For:** Toh Framework v2.0.0+
> **Updated:** 2026-07-14

---

## Overview

Automatic memory that keeps AI in context across sessions with **zero user effort**. v2 replaces the old "read all files every time" mandate with **tiered loading**: Tier 1 is always read (~800 tokens), Tier 2 is read only for the relevant task type, Tier 3 only when explicitly referenced.

### Key principles
- ✅ **Zero config** — no setup required
- ✅ **Tiered** — Tier 1 always; Tier 2/3 on demand (no more ~3,000 tokens every time)
- ✅ **Auto save** — saves after task completion, never asks the user
- ✅ **Delegated agents don't re-read** — they receive context from the orchestrator
- ✅ **IDE & model agnostic**

---

## 📚 The Tiered Model (use this everywhere)

There are **7 memory files** across 3 tiers. Read by tier, not all at once.

| Tier | Files | When to read | Budget |
|------|-------|--------------|--------|
| **Tier 1** | `active.md` + `summary.md` | **ALWAYS**, at every session start | **~800 tokens** |
| **Tier 2** | `architecture.md` + `components.md` | Build / code work (creating pages, components, logic) | ~600 tokens |
| **Tier 2** | `changelog.md` | Debug work (to see previous attempts) | ~400 tokens |
| **Tier 3** | `decisions.md` + `agents-log.md` | Only when explicitly referenced / asked about | on demand |

> **This replaces the old "read ALL files (MANDATORY)" rule.** Never bulk-read all 7. Read Tier 1 always, add the Tier 2 files that match the task type, and touch Tier 3 only when needed.

**Delegated agents:** an agent invoked by the orchestrator **receives context from the orchestrator** and does NOT re-read memory itself. This avoids every agent re-reading the same files.

---

## 📁 Directory Structure

```
.toh/
├── config.json              # Toh configuration
└── memory/
    ├── active.md            # 🔥 Tier 1 — current task (~300 tokens)
    ├── summary.md           # 📋 Tier 1 — project shape (~500 tokens)
    ├── architecture.md      # 🏗️ Tier 2 — structure (build/code work)
    ├── components.md        # 📦 Tier 2 — component registry (build/code work)
    ├── changelog.md         # 📝 Tier 2 — change/attempt log (debug work)
    ├── decisions.md         # 🧠 Tier 3 — key decisions (when referenced)
    ├── agents-log.md        # 🤖 Tier 3 — agent activity (when referenced)
    └── archive/             # 📦 Historical — load only when asked
```

`agents-log.md` stays a **separate** file — it is NOT merged into `changelog.md`.

---

## 🔄 Read Protocol (session start)

```
STEP 1 — Ensure memory exists
        .toh/memory/ exists? → continue · missing? → create from templates

STEP 2 — Read Tier 1 (ALWAYS, in parallel)
        ├── active.md    → what we're working on
        └── summary.md   → what this project is
        Budget: ~800 tokens.

STEP 3 — Add Tier 2 by task type
        ├── Build / code (create page, component, logic)
        │     → also read architecture.md + components.md
        └── Debug (fix a bug)
              → also read changelog.md (see prior attempts)

STEP 4 — Tier 3 only if referenced
        User asks "why did we decide X?"  → read decisions.md
        User asks about past agent runs    → read agents-log.md

STEP 5 — Acknowledge briefly
        "Memory loaded 📚 — working on [X]. Just completed [Y]. Ready to continue."
```

Do **not** read `archive/` during normal work — only when the user asks about past work or runs a history command.

---

## 💾 Save Protocol (after completing work)

```
STEP 1 — active.md            → ALWAYS update (current focus, in-progress, next steps)
STEP 2 — summary.md           → update when the PROJECT SHAPE changes
                                 (feature completed, tech/stack change, new major area)
STEP 3 — architecture.md      → update if structure changed (new route/module/service, data flow)
STEP 4 — components.md         → update if components/hooks/stores/utils changed
STEP 5 — changelog.md         → append what changed / what was attempted (esp. debug work)
STEP 6 — decisions.md         → add row only if a real decision was made
STEP 7 — agents-log.md        → append if agents were delegated
STEP 8 — Confirm: "✅ Memory saved"
```

**Write rules:** always update `active.md`; update `summary.md` when the project shape changes; update the rest **only when relevant** to what actually happened. Keep entries concise (1-2 lines). If `active.md` grows past ~50 lines, roll older content into `archive/YYYY-MM-DD.md`.

---

## 🗂️ File Reference

| File | Tier | Holds | Update when |
|------|------|-------|-------------|
| `active.md` | 1 | Current focus, in-progress, next steps | **Always** |
| `summary.md` | 1 | Project name, stack, completed features | Project shape changes |
| `architecture.md` | 2 | Entry points, modules, data flow, services | Structure changes |
| `components.md` | 2 | Pages, components, hooks, stores, utils registry | Components change |
| `changelog.md` | 2 | Chronological change & debug-attempt log | Every notable change |
| `decisions.md` | 3 | Date · Decision · Reason table | A real decision is made |
| `agents-log.md` | 3 | Which agent did what, when | Agents are delegated |

---

## 📝 Templates

### active.md (Tier 1)
```markdown
# 🔥 Active Task
## Current Focus
[Awaiting user instructions]
## In Progress
- (none)
## Next Steps
- (awaiting)
---
*Last updated: YYYY-MM-DD*
```

### summary.md (Tier 1)
```markdown
# 📋 Project Summary
## Overview
- Name: [Project]
- Stack: Next.js 16, Tailwind, shadcn/ui, Zustand, Supabase
## Completed Features
- (none yet)
---
*Last updated: YYYY-MM-DD*
```

### changelog.md (Tier 2 — debug)
```markdown
# 📝 Changelog
| Date | Change / Attempt | Result |
|------|------------------|--------|
| YYYY-MM-DD | [what changed or was tried] | [worked / failed because …] |
---
*Last updated: YYYY-MM-DD*
```

### agents-log.md (Tier 3)
```markdown
# 🤖 Agents Log
| Date | Agent | Task | Outcome |
|------|-------|------|---------|
| YYYY-MM-DD | [agent] | [task] | [result] |
---
*Last updated: YYYY-MM-DD*
```

> `architecture.md`, `components.md`, and `decisions.md` keep their existing table structures (entry points/modules, component registry, decision log).

---

## ⚠️ Anti-Patterns

| ❌ Don't | ✅ Do |
|----------|-------|
| Bulk-read all 7 files every time | Read Tier 1 always; Tier 2/3 by need |
| Make delegated agents re-read memory | Pass context from the orchestrator |
| Read `archive/` during normal work | Only when the user asks about the past |
| Forget to save | Always update `active.md` after a task |
| Ask the user whether to save | Save automatically |
| Merge `agents-log` into `changelog` | Keep the 7 files distinct |

---

## 🔗 Integration

Every command applies this protocol: read Tier 1 at start, add Tier 2 for the task type, save `active.md` (+ relevant files) at the end. Delegated agents receive context and skip the re-read.

---

*Memory System v2.0.0 — tiered loading, ~800-token Tier 1, 7 files across 3 tiers*
Files in this package (5)
  • SKILL.md 8 KB
  • templates/active.md 1 KB
  • templates/config.json 1 KB
  • templates/decisions.md 1 KB
  • templates/summary.md 1 KB

Versions

RepositoryScoreLicence
This page · wasintoh/toh-framework100MIT
bojieli/ai-agent-book90Apache-2.0

Database snapshot: 13.11.2026 · package version 4f96baab6d01 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100session-recovery
    Seamless continuation across sessions and IDEs — on session start, read .toh/memory/ and greet the user with where the last session left off so nothing needs re-explaining. Handles first run (no memory yet), mid-task resume, and returns after days or weeks. Use at the start of…
  • 90plan-orchestrator
    THE BRAIN behind /toh-plan — analyzes the request or PRD, writes .toh/plan.md per the orchestration-protocol Section D schema (plans are files, never chat state), shows a condensed summary, and holds the single "Go" approval gate before handing execution to THE TOH LOOP. Also…
  • 100memory-protocol
    Universal protocol for total-agent-memory MCP server. Activate at session start, before any non-trivial task, after every significant action, on errors, and at session end. Relevant whenever the user mentions: memory, recall, past context, decisions history, conventions, lessons…
  • 100context-cost
    Measure how many tokens your coding agent reads before you type anything (CLAUDE.md and AGENTS.md chains, imports, memory files, always-on Cursor rules, skills and MCP servers), find what is stale, duplicated or only needed in one folder, and show how much each cut saves. Use…
  • 98memory-map
    Use when installing or configuring memory_map, writing CLAUDE.md session-setup instructions, choosing what to save in memory vs history, managing cross-project memory, tuning compression, or troubleshooting why Claude isn't loading context at session start.
  • 100memory
    Persistent, token-efficient project memory. When ON, maintains a `.shob/memory/` folder of structured `.md` files so the full context of the project is NEVER lost across responses, sessions, or context compaction. Uses progressive disclosure — routes through a lightweight INDEX…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.