Skip to content

superbasicstudio/claude-anchor

Claude Anchor

Claude Anchor

for Claude Code command line

A persistent memory, rules, and behavioral context framework for AI-assisted development with Claude Code.

npm version npm downloads license


Important

Open Source Project Notice

This is open source software maintained by ONE individual in their free time.

While the templates are tested and reviewed before releases, you should ALWAYS have:

  • A proper GitHub/Git strategy in place
  • Regular backups of your work
  • Version control before running ANY script from the internet

DISCLAIMER: This software is provided "as is" without warranty of any kind. Super Basic Studio and the maintainers of Claude Anchor are not responsible for any issues, data loss, or damages that may occur from using this tool. By using Claude Anchor, you acknowledge that you run it at your own risk.


Star History

Star History Chart


Give Claude persistent memory, enforceable rules, and behavioral consistency across sessions. Claude Anchor is the behavioral brain — it tells Claude how to think and behave in your project.

Table of Contents

External Resources

Quick Start

Back to top

Option 1: npx (Recommended)

# Copy 3 essential templates into your project
npx claude-anchor

# Copy all 11 templates
npx claude-anchor --full

# Copy into a specific directory
npx claude-anchor ./my-project

# Overwrite existing files
npx claude-anchor --force

Option 2: Manual (git clone)

# Clone the templates
git clone https://github.com/superbasicstudio/claude-anchor.git

# Copy the templates you need into your project
cp claude-anchor/templates/_GOLDEN-RULES.md ./your-project/
cp claude-anchor/templates/_TODOS.md ./your-project/
cp claude-anchor/templates/_LONG-TERM-MEMORY.md ./your-project/

Then:

  1. Edit each .md file, replacing [PLACEHOLDERS] with your project-specific content
  2. Customize _GOLDEN-RULES.md with your project's constraints
  3. Claude reads these files automatically at the start of each session

What It Does

Back to top

Claude Anchor provides a structured template system that gives Claude:

  • Voice & tone — Control Claude's personality, attitude, vocabulary, and communication vibe. Loaded first so it colors everything.
  • Persistent memory — Long-term knowledge that survives across sessions (user preferences, project conventions, important decisions)
  • Session continuity — RAM for single-session crash recovery, short-term memory for multi-session context across 4-10 sessions
  • Enforceable rules — Immutable constraints ("NEVER do X") that Claude must follow, read twice per session to prevent context decay
  • Design preferences — Visual design rules: lighter hover colors, WCAG accessibility, typography, flat iconography, UX principles
  • Conversation preferences — Standardized output formatting, verbosity levels, and communication style
  • Lessons learned — A living record of past mistakes and their fixes, so Claude doesn't repeat them
  • Task tracking — Priority-based TODOs with blockers and dependencies

The Problem It Solves

Without persistent context, Claude:

  • Loses crucial knowledge between sessions
  • Repeats the same mistakes
  • Forgets your preferences and conventions
  • Can't resume interrupted work or recover from crashes
  • Has no enforceable behavioral constraints
  • Has no consistent personality or communication style
  • Ignores your design system and accessibility requirements

Anchor fixes all of this with a structured set of markdown templates that Claude reads at session start.

Templates

Back to top

Minimal Setup (Simple Projects)

your-project/
├── CLAUDE.md                    # Your existing project docs
├── _GOLDEN-RULES.md             # Immutable rules
└── _TODOS.md                    # Active tasks

Full Setup (Complex Projects)

your-project/
├── CLAUDE.md                    # Project context (with load order block)
├── _RAM.md                      # Single-session volatile memory (crash recovery)
├── _VOICE-AND-TONE.md           # Personality, attitude, language style (loaded FIRST)
├── _GOLDEN-RULES.md             # Immutable rules (read twice per session)
├── _TODOS.md                    # Active tasks and priorities
├── _LESSONS-LEARNED.md          # Past mistakes and fixes
├── _CONVERSATION-PREFERENCES.md # Output formatting and communication style
├── _DESIGN-PREFERENCES.md       # Visual design, accessibility, UX rules
├── _LONG-TERM-MEMORY.md         # Persistent memory (NEVER delete)
├── _SHORT-TERM-MEMORY.md        # Multi-session temporary context (4-10 sessions)
└── _SYSTEM_ARCHITECTURE.md      # Technical diagrams and system design

Session Load Order

Back to top

The CLAUDE.md template includes a mandatory startup block. When Claude enters a project with Anchor files, it reads them in this exact sequence:

0. _RAM.md                       <- IF EXISTS: recover interrupted session state
1. _SHORT-TERM-MEMORY.md         <- IF EXISTS: active multi-session context
2. _VOICE-AND-TONE.md            <- Personality and language style
3. _GOLDEN-RULES.md              <- BINDING rules — MUST FOLLOW every session
4. _TODOS.md                     <- Know what's pending
5. _LESSONS-LEARNED.md           <- Avoid past mistakes
6. _LONG-TERM-MEMORY.md          <- Persistent knowledge and preferences
7. _CONVERSATION-PREFERENCES.md  <- Output formatting
8. _DESIGN-PREFERENCES.md        <- Visual design and UX rules
9. _GOLDEN-RULES.md              <- Re-read (reinforce)
10. CLAUDE.md                     <- Full project context
11. BEGIN conversation

Why is RAM step 0? If _RAM.md exists, the previous session was interrupted. Reading it first restores the exact working state before anything else loads.

Why is VOICE-AND-TONE first (after recovery)? Claude's personality should be established before it reads anything else. It colors how Claude processes every file after it and how it communicates throughout the session.

Why read GOLDEN-RULES twice? In long contexts, content read early can get "forgotten" as the context window fills. Re-reading critical rules last keeps them fresh and prevents behavioral drift during the session.

Template Overview

Back to top

Template Purpose Lifecycle Priority
_RAM.md Single-session volatile state — crash recovery Auto-managed. Written continuously, deleted at session end. RECOVERY
_VOICE-AND-TONE.md Personality, attitude, vocabulary, response style, commit format Permanent. Adjust to match your working style. FIRST
_GOLDEN-RULES.md Immutable constraints — things Claude must NEVER/ALWAYS do Permanent. Updated when new rules are needed. BINDING
_TODOS.md Active tasks with priorities, blockers, and dependencies Ongoing. Tasks move from pending to completed. High
_LESSONS-LEARNED.md Documented mistakes with root cause and prevention Permanent. Add entries immediately when issues are discovered. High
_CONVERSATION-PREFERENCES.md Output formatting, colors, progress bars, verbosity Permanent. Adjusted to match your communication style. Medium
_DESIGN-PREFERENCES.md Hover states, accessibility, typography, iconography, UX rules Permanent. Adjust to match your design system. High
_LONG-TERM-MEMORY.md Persistent knowledge: user identity, system config, code style, decisions NEVER delete. Accumulates over months/years. High
_SHORT-TERM-MEMORY.md Multi-session temporary context: active issues, in-progress work Delete when all items resolved. Persists 4-10 sessions. Conditional
_SYSTEM_ARCHITECTURE.md ASCII diagrams, data flows, component maps, security model On-demand reference. Updated when architecture changes. Reference

Memory Model

_LONG-TERM-MEMORY.md           _SHORT-TERM-MEMORY.md          _RAM.md
 - NEVER delete                 - Persists 4-10 sessions       - Single session only
 - Accumulates over time        - Active issues & work          - Crash recovery
 - User preferences, decisions  - In-progress improvements      - Written continuously
 - System configuration         - Delete when items resolve     - Deleted at session end
 - Always available             - "What are we working ON?"     - "What am I doing NOW?"

Customization Guide

Back to top

All template files use placeholder syntax:

[PROJECT_NAME]  — Your project name
[DESCRIPTION]   — Brief description
[DATE]          — Current date
[PATH]          — File/folder paths
[COMMAND]       — CLI commands

Tips

  1. _VOICE-AND-TONE.md — Set this up first. It shapes everything Claude says. Pick your formality, humor, and energy levels.
  2. _GOLDEN-RULES.md — Be specific. Vague rules get ignored. Include "why" for each rule.
  3. _TODOS.md — Keep it current. Stale TODOs confuse Claude about priorities.
  4. _LESSONS-LEARNED.md — Add entries immediately when you discover gotchas. Future you will thank past you.
  5. _CONVERSATION-PREFERENCES.md — Include visual examples of your preferred output format.
  6. _DESIGN-PREFERENCES.md — Set your hover, accessibility, and icon rules once. Claude follows them everywhere.
  7. _LONG-TERM-MEMORY.md — Start with your identity, system environment, and code style. It grows naturally over time.
  8. _SHORT-TERM-MEMORY.md — Use for context that should persist across several sessions. Delete entries as they're resolved.
  9. _RAM.md — Claude manages this automatically. If you see one at session start, it means the last session was interrupted.
  10. _SYSTEM_ARCHITECTURE.md — ASCII diagrams are universally understood. Use them.

Naming Conventions

Back to top

Pattern Meaning Example
ALLCAPS.md Core documentation CLAUDE.md, TODOS.md
_UNDERSCORE.md Supporting/reference docs _SYSTEM_ARCHITECTURE.md
HYPHENATED.md Multi-word names GOLDEN-RULES.md, LESSONS-LEARNED.md

The underscore prefix keeps supporting files visually grouped at the top of directory listings.

Companion Project: Claude Conductor

Back to top

Two repos, two tools, complementary not competitive.

Anchor is the behavioral brain — it manages Claude's rules, memory, conversation preferences, and session continuity. It tells Claude how to think and behave.

Claude Conductor is the codebase brain — it documents your project's architecture, APIs, build systems, errors, and development history. It tells Claude what your project is.

Together they give Claude full context — what the project is AND how to work on it.

Conductor Anchor
Focus Codebase documentation AI behavior and memory
Generates ARCHITECTURE.md, BUILD.md, API.md, JOURNAL.md _VOICE-AND-TONE.md, _GOLDEN-RULES.md, _DESIGN-PREFERENCES.md, _RAM.md, _LONG-TERM-MEMORY.md, _TODOS.md
Delivery npx claude-conductor (automated CLI) Copy templates into project
Answers "What is this codebase?" "How should Claude behave?"

A project can use one or both. They don't overlap — they stack.

Contributing

Back to top

We welcome contributions! See CONTRIBUTING.md for full details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes and run npm test
  4. Submit a pull request

All PRs require passing CI checks (tests across Node 16/18/20 + CodeQL security scan) and a code review from @superbasicstudio before merging.

Please keep templates framework-agnostic — they should work with any project in any language.

Privacy & Security

Back to top

Claude Anchor is a collection of markdown templates with a lightweight CLI installer. It:

  • Templates are pure markdown — no executable code runs in your project
  • The CLI (npx claude-anchor) only copies template files — nothing else
  • Makes zero network requests (beyond npm install)
  • Has no telemetry or analytics
  • Runs entirely on your local machine
  • Never collects or transmits any data

The _LONG-TERM-MEMORY.md template includes a warning to NEVER store actual passwords or secrets. Follow this guidance.

License

Back to top

BSD 2-Clause (c) Super Basic Studio


Made with love by Super Basic Studio

Keywords

claude, claude code, claude anchor, ai memory, ai context, persistent memory, rules framework, claude code framework, vibe coding, super basic studio

About

Persistent memory, enforceable rules, and behavioral consistency for Claude Code. The behavioral brain for AI-assisted development.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages