cc-second-brain
Manage the three-tier memory system (engram + Obsidian vault + plugin rules) for Claude Code setups. Use this skill whenever saving CC-setup findings, consolidating engram into durable knowledge, writing repo docs to the Obsidian vault, or running /cc-memory subcommands. Triggers on phrases like "save this pattern", "promote to memory", "update the vault", "consolidate memory", "write an ADR", and whenever work on CC plugins, hooks, agents, skills, or autonomy profiles concludes.
What this skill does
# CC Second Brain
Three-tier memory: **engram (working)** + **Obsidian vault (durable)** + **plugin rules (baseline)**. Full separation-of-concerns in [conventions.md](../../memory/conventions.md) and [topic-key-taxonomy.md](references/topic-key-taxonomy.md).
## Tier routing — decision tree
```
Did work just conclude?
│
├─ Is it a one-off observation, decision, or discovery?
│ └─ YES → engram (tier 1) — mem_save with CC topic_key (see taxonomy)
│
├─ Is it a reusable pattern (used or useful in ≥ 2 repos)?
│ └─ YES → Obsidian (tier 2) — Research/Claude-Code/Patterns/{slug}.md
│ with frontmatter auto_generated: false if user-curated
│
├─ Is it repo-specific durable knowledge?
│ └─ YES → Obsidian (tier 2) — Repositories/{org}/{repo}.md
│ or Decisions/NNNN-title.md for ADRs
│
└─ Is it a rule every consumer-repo Claude should follow?
└─ YES → plugin rules (tier 3) — memory/rules/cc-always.md
(only the plugin maintainer edits this)
```
## Engram — tier 1 write pattern
Call `mem_save` with CC topic_key. See [topic-key-taxonomy.md](references/topic-key-taxonomy.md) for full prefix table.
**Required:** `title`, `content` (**What/Why/Where/Learned** format).
**Recommended:** `topic_key` starting with `cc/*`, `type` (decision/bugfix/architecture/discovery/pattern/config/preference), `scope` (project or personal).
**Examples:**
```
mem_save({
title: "Chose protect-sensitive-files hook for all new setups",
type: "decision",
topic_key: "cc/hooks/protect-sensitive-files",
content: "**What**: Default install on every /cc-setup run\n**Why**: Prevents writes to .env / credentials / keys\n**Where**: memory/rules/cc-always.md\n**Learned**: Hook matcher Write|Edit is correct — don't also match MultiEdit, it inherits"
})
```
## Obsidian — tier 2 write pattern
**Preferred**: use Obsidian MCP tools (`mcp__obsidian__*`) if loaded — they append/update via the Local REST API.
**Fallback**: direct Write tool at vault paths.
**Auto-generated note frontmatter (consolidator only):**
```yaml
---
auto_generated: true
source: engram
topic_key: cc/patterns/{slug}
reinforcement_count: 7
first_seen: 2026-04-09
last_updated: 2026-04-16
tags: [claude-code, pattern, auto]
---
```
**User-curated note frontmatter:**
```yaml
---
title: {short title}
created: {YYYY-MM-DD}
tags: [claude-code, type/pattern]
---
```
**Durability invariant:** notes WITHOUT `auto_generated: true` are user-curated. Consolidator never overwrites them. If you're writing a note on behalf of the user, use `auto_generated: false` explicitly.
## Plugin rules — tier 3 write pattern
`memory/rules/cc-always.md` — user-only (edit via `/cc-memory edit-always`).
`memory/rules/cc-patterns.md` — consolidator-only.
`memory/rules/DRAFT.md` — consolidator-only (conflicts).
Do NOT hand-edit `cc-patterns.md` or `DRAFT.md` — the consolidator owns them.
## Querying the tiers
| Need | Tool |
|---|---|
| "Have we solved this before?" | `mem_search` with cc/ prefix hint → `mem_context` for recent history |
| "What's the current rule for X?" | Read `memory/rules/cc-always.md` and `memory/rules/cc-patterns.md` |
| "What patterns exist for Y?" | Obsidian MCP search or Grep on `Research/Claude-Code/Patterns/` |
| "What does this repo know?" | Read `Repositories/{org}/{repo}.md` first |
## /cc-memory subcommands
| Subcommand | Action |
|---|---|
| `search <query>` | engram `mem_search` scoped to `cc/*` keys |
| `export [--domain ...]` | write human digest to `memory/digests/{date}.md` |
| `consolidate` | run consolidator: engram → Obsidian + cc-patterns.md |
| `edit-always` | open `memory/rules/cc-always.md` |
| `review` | open `memory/rules/DRAFT.md` (conflicts) |
| `status` | show: last consolidation, pattern count, draft count, cc/* observation count |
## MCP tools the consolidator uses (READ-ONLY on engram)
| Tool | Used for |
|---|---|
| `mem_search` | Find cc/* observations |
| `mem_get_observation` | Fetch full content of a match |
| `mem_context` | Recent session context for timing |
**NEVER** used by the consolidator: `mem_save`, `mem_update`, `mem_delete`. Those are Claude-in-session or user-manual operations only.
## Common anti-patterns
- Saving to engram without a topic_key for CC work → consolidator can't group observations → pattern never promotes.
- Writing to `Repositories/{org}/{repo}.md` with `auto_generated: true` when it's actually hand-curated → consolidator will overwrite it later.
- Editing `memory/rules/cc-patterns.md` by hand → consolidator will clobber your edits on next run. Put hand-curation in `cc-always.md`.
- Skipping `mem_session_summary` at end of session → next session starts blind; consolidator has less to work with.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.