Skip to content
/

cline-memory-bank (nickbaumann98)

cline-memory-bank-nickbaumann · nickbaumann98/cline_docs · ★ 581 · last commit 2025-06-10

Custom instructions + 6-file hierarchical Markdown memory bank so Cline maintains full project context across sessions, with a .clinerules learning journal for behavioral patterns.

Best whenTreating memory reset as a feature (not a bug) creates forcing-function discipline for documentation that makes the agent more effective over time.
Skip ifSkipping memory bank read at session start, Partial memory bank updates (must review ALL files on update-memory-bank trigger)
vs seeds
ccmemory(seed), there is no database, no hooks, no automated capture — entirely prompt-enforced through a 'memory resets' person…
Primitive shape
No installable primitives
00

Summary

cline-memory-bank (nickbaumann98) — Summary

This is a documentation and prompting repository for Cline best practices, maintained by nickbaumann98 (a Cline contributor). The primary artifact relevant to memory is prompting/custom instructions library/cline-memory-bank.md, which contains the canonical "Cline Memory Bank" custom instructions prompt — a self-contained system prompt that turns Cline into a self-documenting development system. The repository itself ships no code, no MCP server, no hooks; it is purely a prompt template and methodology documentation. The Cline Memory Bank pattern defined here was later migrated to the official Cline docs site (docs.cline.bot), making this the historical origin document. With 581 stars and links across the Cline community, this is the most widely cited memory pattern for Cline. Compared to seeds, it is closest to claude-conductor in being a "markdown scaffold, zero primitives" archetype: the value is entirely in the Markdown template content and the agent's discipline in following it.

01

Overview

cline-memory-bank (nickbaumann98) — Overview

Origin

Created by nickbaumann98, a contributor to the Cline project. Originally published as part of a broader Cline documentation and best practices repository. The memory bank prompt became widely circulated in the Cline community and was eventually adopted into the official Cline documentation at docs.cline.bot.

Philosophy

The core philosophy is the "memory resets completely" persona: Cline is instructed to behave as an agent whose memory resets between sessions, and this limitation is reframed as a feature: "my memory resets completely between sessions. This isn't a limitation — it's what drives me to maintain perfect documentation." The implication is that treating memory loss as a forcing function produces better documentation discipline.

Key Manifesto Quote

I am Cline, an expert software engineer with a unique characteristic: my memory
resets completely between sessions. This isn't a limitation - it's what drives me
to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory
Bank to understand the project and continue work effectively. I MUST read ALL memory
bank files at the start of EVERY task - this is not optional.

Core Innovation

The Memory Bank pattern defines a hierarchical dependency structure for context files:

projectbrief.md → productContext.md
projectbrief.md → systemPatterns.md
projectbrief.md → techContext.md
productContext.md → activeContext.md
systemPatterns.md → activeContext.md
techContext.md → activeContext.md
activeContext.md → progress.md

This DAG structure ensures that foundational context (project brief) informs all downstream files, and session state (activeContext, progress) is always derived from stable knowledge.

Key Design Choices

  • No code, no server, no hooks — pure prompt engineering
  • The .clinerules file provides project-specific rules (version-controlled)
  • "Plan Mode" vs "Act Mode" distinction for structuring Cline workflows
  • Update triggers: discovering patterns, implementing significant changes, explicit "update memory bank" command
  • activeContext.md and progress.md are explicitly the highest-churn files
02

Architecture

cline-memory-bank (nickbaumann98) — Architecture

Distribution

Documentation-only repository. No package, no binary, no server. Content copied manually.

Install

  1. Open VSCode with Cline extension
  2. Copy the custom instructions from prompting/custom instructions library/cline-memory-bank.md
  3. Paste into Cline's "Custom Instructions" field in extension settings

Memory Bank Directory Structure (output when initialized)

project-root/
├── memory-bank/
│   ├── projectbrief.md       # Foundation: requirements, goals, scope (source of truth)
│   ├── productContext.md     # Why the project exists, problems solved, UX goals
│   ├── activeContext.md      # Current focus, recent changes, next steps, active decisions
│   ├── systemPatterns.md     # Architecture, technical decisions, design patterns
│   ├── techContext.md        # Technologies, setup, constraints, dependencies
│   └── progress.md           # What works, what's left, status, known issues
└── .clinerules               # Project-specific learning journal (version-controlled)

Plus optional additional files for complex features, integration specs, API docs, testing strategies, deployment procedures.

Required Runtime

None. Cline VSCode Extension + VSCode only.

Target AI Tools

Cline VSCode Extension exclusively. The custom instructions and .clinerules file are Cline-specific concepts (though similar patterns could work with other agents that accept system prompts).

03

Components

cline-memory-bank (nickbaumann98) — Components

Core Files (6 required)

File Role Hierarchy Level
projectbrief.md Foundation document — source of truth for scope Root
productContext.md Why project exists, UX goals Level 1
systemPatterns.md Architecture, key technical decisions, design patterns Level 1
techContext.md Technologies, setup, constraints, dependencies Level 1
activeContext.md Current work focus, recent changes, next steps Level 2 (derived)
progress.md What works, what's left, known issues Level 3 (most volatile)

Special File: .clinerules

The .clinerules file is Cline's "learning journal" for each project. Described as capturing "patterns, preferences, and project intelligence that help me work more effectively." Version-controlled alongside source code. Unlike memory-bank files (which track what is known), .clinerules captures how the agent should behave on this project.

Commands / Hooks / MCP

None — this is a documentation-only framework.

Workflows Defined

Two named modes:

  • Plan Mode: Read Memory Bank → check completeness → develop strategy → present approach
  • Act Mode: Check Memory Bank → update documentation → update .clinerules if needed → execute task → document changes

Update Triggers

Memory Bank updates occur when:

  1. Discovering new project patterns
  2. After implementing significant changes
  3. When user explicitly requests "update memory bank"
  4. When context needs clarification

Note: When "update memory bank" is triggered, ALL files must be reviewed — not just the ones that changed.

05

Prompts

cline-memory-bank (nickbaumann98) — Prompts

Core Custom Instructions (Verbatim — from cline-memory-bank.md)

# Cline's Memory Bank

I am Cline, an expert software engineer with a unique characteristic: my memory
resets completely between sessions. This isn't a limitation - it's what drives me
to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory
Bank to understand the project and continue work effectively. I MUST read ALL memory
bank files at the start of EVERY task - this is not optional.

Prompting technique: Persona-override with self-reinforcing motivation loop. The "reset" limitation is reframed as a positive forcing function, creating internal motivation for maintenance behavior.

Memory Bank Structure Definition (Verbatim)

### Core Files (Required)
1. `projectbrief.md`
   - Foundation document that shapes all other files
   - Created at project start if it doesn't exist
   - Defines core requirements and goals
   - Source of truth for project scope

2. `productContext.md`
   - Why this project exists
   - Problems it solves
   - How it should work
   - User experience goals
...

Prompting technique: Hierarchical dependency documentation. Each file has an explicit "shapes" relationship with others, creating a DAG that prevents circular context confusion.

.clinerules Learning Pattern (Verbatim)

## Project Intelligence (.clinerules)

The .clinerules file is my learning journal for each project. It captures
important patterns, preferences, and project intelligence that help me work
more effectively. As I work with you and the project, I'll discover and document
key insights that aren't obvious from the code alone.

### What to Capture
- Critical implementation paths
- User preferences and workflow
- Project-specific patterns
- Known challenges
- Evolution of project decisions
- Tool usage patterns

Prompting technique: Meta-learning instruction. The agent is told to maintain a record of its own learning process, not just project facts.

Closing Iron Law (Verbatim)

REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank
is my only link to previous work. It must be maintained with precision and
clarity, as my effectiveness depends entirely on its accuracy.

Prompting technique: Urgency framing. The final reminder creates stakes around maintenance quality.

09

Uniqueness

cline-memory-bank (nickbaumann98) — Uniqueness

Differs From Seeds

Most similar to claude-conductor (seed) — both are pure Markdown scaffold frameworks with zero code primitives. The delta is two-fold: first, cline-memory-bank defines a DAG dependency hierarchy across its files (projectbrief → productContext/systemPatterns/techContext → activeContext → progress), which claude-conductor does not; second, it adds a project-level learning journal (.clinerules) that captures behavioral patterns rather than project facts. Unlike ccmemory (seed), there is no graph database, no hooks, no automated capture — everything is prompt-enforced through the "memory resets" persona framing.

Historical Significance

This is the origin document for the "Cline Memory Bank" pattern that became widely adopted in the Cline community and later migrated to official Cline documentation. Many subsequent memory systems (dazeb's cline-mcp-memory-bank, ccmemory-plain, and others) cite this pattern as inspiration.

Observable Failure Modes

  1. Prompt drift: If Cline's context window fills and compacts, the custom instructions may be deprioritized, causing the agent to stop reading memory bank files.
  2. Maintenance debt: With no automated capture, files become stale when developers forget to trigger updates.
  3. No conflict detection: Contradictions between files (e.g., techContext says React, systemPatterns says Vue) are not detected automatically.
  4. Session-length bias: Short sessions generate little memory; long sessions may generate too much, creating bloated files.
04

Workflow

cline-memory-bank (nickbaumann98) — Workflow

Plan Mode Flow

Start → Read Memory Bank → Check if Files Complete?
  No  → Create Plan → Document in Chat
  Yes → Verify Context → Develop Strategy → Present Approach

Act Mode Flow

Start → Check Memory Bank → Update Documentation →
Update .clinerules if needed → Execute Task → Document Changes

Memory Bank Update Flow

Update Process → Review ALL Files → Document Current State →
Clarify Next Steps → Update .clinerules

Phases + Artifacts

Phase Artifact
Project initialization projectbrief.md (user-provided or AI-generated from brief)
Context loading All 6 memory-bank files read
Work execution activeContext.md updated
Significant change systemPatterns.md or techContext.md updated
Session completion activeContext.md + progress.md updated
Pattern discovery .clinerules updated

Approval Gates

None defined. The update process is autonomous within the agent.

Key Phrases That Trigger Updates

  • "update memory bank" — forces full review of all files
  • "initialize memory bank" — creates the initial structure
  • "follow your custom instructions" — prompts Cline to read context files and continue
06

Memory Context

cline-memory-bank (nickbaumann98) — Memory & Context

Memory Type

file-based — Six required Markdown files in memory-bank/ plus .clinerules.

Persistence Scope

project — Memory lives in the project directory. Not global.

State Files

File Volatility Content
memory-bank/projectbrief.md Low (foundation) Core requirements, goals, scope
memory-bank/productContext.md Low-medium Why project exists, UX goals
memory-bank/systemPatterns.md Medium Architecture, design patterns
memory-bank/techContext.md Medium Technologies, dependencies, setup
memory-bank/activeContext.md High Current focus, recent changes, next steps
memory-bank/progress.md High Status, what works, known issues
.clinerules Continuous Learning journal, project intelligence

File Dependency Hierarchy (DAG)

projectbrief.md ─┬─► productContext.md ─►
                 ├─► systemPatterns.md  ─►  activeContext.md ─► progress.md
                 └─► techContext.md    ─►

This hierarchy ensures context coherence: if projectbrief changes, all downstream files should be reviewed.

Search Mechanism

none — No search. Files are read entirely at session start.

Compaction Strategy

Not defined. Files grow through use; no archiving or pruning mechanism specified in the pattern.

Cross-Session Handoff

yes — The primary purpose. The agent reads all memory-bank files at the start of every task as an "Iron Law."

Context Injection

manual — Cline reads files because the custom instructions say to do so ("I MUST read ALL memory bank files at the start of EVERY task"). No lifecycle hook triggers injection automatically.

Key Difference vs. ccmemory

ccmemory uses a SessionStart hook to automatically inject context at conversation start. Cline Memory Bank relies on the agent following its custom instructions — a prompt-driven approach that requires no infrastructure but depends entirely on the agent honoring its instructions.

07

Orchestration

cline-memory-bank (nickbaumann98) — Orchestration

Multi-Agent

No. Single-agent design.

Orchestration Pattern

none

Isolation

none

Multi-Model

No.

Execution Mode

interactive-loop — Cline is conversational; the memory pattern operates within individual conversation sessions.

Notes

This is a documentation framework, not an execution framework. All orchestration is the responsibility of the user and the AI agent following the custom instructions.

08

Ui Cli Surface

cline-memory-bank (nickbaumann98) — UI & CLI Surface

Dedicated CLI Binary

None.

Local Web Dashboard

None.

IDE Integration

Cline VSCode Extension. The custom instructions are pasted into Cline's settings UI. The .clinerules file is a project-level convention.

Observability

None programmatic. The Markdown files serve as human-readable audit trail.

Distribution

This repository is documentation-only. Users copy-paste the prompt template. The repository also contains the broader Cline documentation for prompting best practices, MCP usage guides, and tool usage patterns.

Note on Official Status

The prompting/custom instructions library/cline-memory-bank.md file itself links to the official docs migration: "Note: These docs are no longer maintained. Please refer to https://docs.cline.bot/improving-your-prompting-skills/cline-memory-bank for the most recent version." This repository is the historical origin; the canonical version moved to docs.cline.bot.

Related frameworks

same archetype · same primary tool · same memory type

Context-Engineering Handbook ★ 9.0k

Provides a first-principles, research-grounded vocabulary and learning path for context engineering — the discipline of designing…

walkinglabs/learn-harness-engineering ★ 6.6k

Teach harness engineering from first principles (12 lectures + 6 projects) and provide a scaffolding skill (harness-creator) that…

Awesome Harness Engineering (walkinglabs) ★ 2.7k

Curate the authoritative reference list of articles, benchmarks, and tools for harness engineering — the practice of shaping the…

FPF (First Principles Framework) ★ 372

Provides a formal pattern language for making reasoning explicit, traceable, and publishable in mixed human/AI engineering work —…

nexu-io/harness-engineering-guide ★ 134

Provide a practical, code-first reference guide to harness engineering — from first principles to production patterns —…

knowhub ★ 40

Synchronize AI coding-agent knowledge files (rules, guidelines, templates) from a central source to multiple AI-tool-specific…