docs: decommission cognitive memory references from KB
All checks were successful
Reindex Knowledge Base / reindex (push) Successful in 2s
All checks were successful
Reindex Knowledge Base / reindex (push) Successful in 2s
Removed cognitive-memory MCP, timers, and symlink system references. Replaced with kb-search MCP and /save-doc skill workflow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1ca0458a66
commit
fcecde0de4
38
CLAUDE.md
38
CLAUDE.md
@ -5,41 +5,13 @@
|
||||
- Check imports when writing code (prevent NameErrors)
|
||||
- Temp files go in `.claude/tmp/`, clean up after
|
||||
- Prefer editing existing files over creating new ones
|
||||
- After complex tasks, prompt to save learnings to cognitive memory
|
||||
- After complex tasks, prompt to save learnings to the KB (use /save-doc)
|
||||
- At session end, ask: "Should I update our documentation?"
|
||||
- At 25% context remaining, automatically run `/save-memories` before compaction loses detail
|
||||
|
||||
## Context Loading
|
||||
When a topic comes up, load `{tech}/CONTEXT.md` + `{tech}/troubleshooting.md`. For scripts, also load `{tech}/scripts/CONTEXT.md`.
|
||||
|
||||
| Keywords | Directory |
|
||||
|----------|-----------|
|
||||
| tdarr, transcode, ffmpeg, nvenc | `tdarr/` |
|
||||
| docker, container, compose, dockerfile | `docker/` |
|
||||
| vm, proxmox, kvm, hypervisor | `vm-management/` |
|
||||
| nginx, proxy, dns, firewall, ssh, ssl, pihole | `networking/` |
|
||||
| monitoring, alert, uptime kuma, discord health check | `monitoring/` |
|
||||
| productivity,
|
||||
n8n, workflow, automation, ko-fi | `productivity/` |
|
||||
| openclaw, ai assistant, autonomous agent | `productivity/openclaw/` |
|
||||
| jellyfin, plex, media server, watchstate | `media-servers/` |
|
||||
| yt-dlp, playwright, media download, web scraping | `media-tools/` |
|
||||
| steam, proton, steam tinker launch, gaming | `gaming/` |
|
||||
| server config, gitea config, infrastructure | `server-configs/` |
|
||||
| database, postgres, redis, sql | `databases/` |
|
||||
| backup, restic, snapshot, restore, retention | `backups/` |
|
||||
| workstation, dotfiles, symlink, fish, starship, mangohud, zed, fish config, fish alias, tmux, tmux alias | `workstation/` |
|
||||
| tui testing, mcp-tui-driver, tui automation, terminal ui test | `development/tui-testing.md` |
|
||||
| scheduled task, claude-scheduled, headless claude, timer, cowork, issue-poller, issue-worker, pr-reviewer, backlog-triage | `scheduled-tasks/CONTEXT.md` + `~/.claude/skills/create-scheduled-task/SKILL.md` |
|
||||
|
||||
**Special loads:**
|
||||
- Pi-hole → also `networking/pihole-ha-setup.md`
|
||||
- n8n → also `productivity/n8n/CONTEXT.md`
|
||||
- Ko-fi → also `productivity/n8n/workflows/kofi-paper-dynasty.md`
|
||||
- Jellyfin → also `media-servers/jellyfin-ubuntu-manticore.md`
|
||||
- `.py` files → `development/python-CONTEXT.md`
|
||||
- `.js/.ts` files → `development/nodejs-CONTEXT.md`
|
||||
- `.sh/.bash` files → `development/bash-CONTEXT.md`
|
||||
## Knowledge Base
|
||||
Use the `kb-search` MCP tools to find documentation. For code files, also
|
||||
load the relevant dev CONTEXT: `.py` → `development/python-CONTEXT.md`,
|
||||
`.js/.ts` → `development/nodejs-CONTEXT.md`, `.sh` → `development/bash-CONTEXT.md`.
|
||||
|
||||
## Documentation Maintenance
|
||||
- New tech without a directory → offer to create `/{tech}/` structure
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
---
|
||||
title: "Claude Code Memory Auto-Load"
|
||||
description: "How MEMORY.md symlinks to cognitive memory CORE.md provide automatic context injection into every Claude Code session. Covers the symlink mechanism, daily refresh via systemd, and manual refresh commands."
|
||||
type: guide
|
||||
domain: development
|
||||
tags: [claude-code, cognitive-memory, symlinks, systemd, automation]
|
||||
---
|
||||
|
||||
# Claude Code Memory Auto-Load (CORE.md Symlinks)
|
||||
|
||||
## Problem
|
||||
Claude Code's CLAUDE.md can instruct the AI to load files at session start, but this relies on the model choosing to follow the instruction — which it often doesn't.
|
||||
|
||||
## Solution
|
||||
Claude Code has a built-in auto-memory feature: each project gets a `MEMORY.md` file at `~/.claude/projects/<project-path>/memory/MEMORY.md` that is **automatically injected into the system prompt** every session. No tool calls needed.
|
||||
|
||||
We symlink every project's `MEMORY.md` to our cognitive memory `CORE.md` (`~/.claude/memory/CORE.md`), which is an auto-curated summary of the most relevant memories (~1,000-1,100 tokens).
|
||||
|
||||
## How It Works
|
||||
|
||||
```
|
||||
~/.claude/projects/<project>/memory/MEMORY.md → ~/.claude/memory/CORE.md
|
||||
```
|
||||
|
||||
- CORE.md is regenerated daily by `cognitive-memory-daily.service`
|
||||
- Symlinks are refreshed daily by the same service (catches new projects)
|
||||
- Cost: ~1% of 200k context window — negligible
|
||||
|
||||
## Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `~/.local/bin/claude-memory-symlinks` | Script that creates/refreshes symlinks for all projects |
|
||||
| `~/.config/systemd/user/cognitive-memory-daily.service` | Daily timer that runs decay → core → embed → symlinks |
|
||||
| `~/.claude/memory/CORE.md` | Auto-curated cognitive memory summary (symlink target) |
|
||||
|
||||
## Manual Refresh
|
||||
|
||||
```bash
|
||||
# Regenerate CORE.md and refresh symlinks
|
||||
claude-memory core && claude-memory-symlinks
|
||||
|
||||
# Just refresh symlinks (e.g., after creating a new project)
|
||||
claude-memory-symlinks
|
||||
```
|
||||
|
||||
## What Changed
|
||||
|
||||
- **Removed** from `~/.claude/CLAUDE.md`: "Session start: Load CORE.md" instruction
|
||||
- **Added** to `~/.claude/CLAUDE.md`: "CORE.md auto-loads via MEMORY.md symlinks"
|
||||
- **Migrated** project-specific MEMORY.md content (major-domo, strat-gameplay-webapp) into cognitive memory before replacing with symlinks
|
||||
- **Added** `claude-memory-symlinks` step to daily systemd service
|
||||
|
||||
## Date
|
||||
2026-02-16
|
||||
@ -25,7 +25,7 @@ Comprehensive monitoring and alerting system for home lab infrastructure with fo
|
||||
### AI Infrastructure LXCs (301–302)
|
||||
|
||||
#### Claude Discord Coordinator — CT 301 (10.10.0.147)
|
||||
**Purpose**: Discord bot coordination with read-only cognitive memory MCP access
|
||||
**Purpose**: Discord bot coordination with read-only KB search MCP access
|
||||
**SSH alias**: `claude-discord-coordinator`
|
||||
|
||||
#### Claude Runner — CT 302 (10.10.0.148)
|
||||
|
||||
@ -3,7 +3,7 @@ title: "Scheduled Tasks Overview"
|
||||
description: "Headless Claude Code sessions triggered by systemd timers using runner.sh template framework and custom dispatcher scripts. Covers task layout, settings reference, cost safety, and monitoring."
|
||||
type: context
|
||||
domain: scheduled-tasks
|
||||
tags: [claude-code, systemd, timers, automation, headless, runner, issue-poller, pr-reviewer, backlog-triage]
|
||||
tags: [claude-code, systemd, timers, automation, headless, runner, issue-poller, pr-reviewer, backlog-triage, sync-kb, sync-config]
|
||||
---
|
||||
|
||||
# Scheduled Tasks — Headless Claude Sessions on a Timer
|
||||
@ -34,10 +34,12 @@ For a guide on **creating new tasks**, see: `~/.claude/skills/create-scheduled-t
|
||||
~/.config/systemd/user/
|
||||
├── claude-scheduled@.service # Template service (used by runner.sh tasks)
|
||||
├── claude-scheduled@backlog-triage.timer
|
||||
├── claude-scheduled@sync-config.timer # Daily 02:00
|
||||
├── claude-issue-poller.service/timer # Every 30 min
|
||||
├── claude-pr-reviewer.service/timer
|
||||
├── claude-issue-dispatcher.service
|
||||
└── claude-daily-report.service/timer
|
||||
├── claude-daily-report.service/timer
|
||||
├── sync-kb.service/timer # Every 2 hours (plain bash, no Claude)
|
||||
|
||||
~/.local/share/claude-scheduled/
|
||||
└── logs/<task-name>/ # Timestamped .log files (last 30 kept)
|
||||
@ -45,7 +47,7 @@ For a guide on **creating new tasks**, see: `~/.claude/skills/create-scheduled-t
|
||||
|
||||
Source files are in `~/dotfiles/claude-scheduled/` and symlinked into place.
|
||||
|
||||
## Two Execution Patterns
|
||||
## Three Execution Patterns
|
||||
|
||||
### 1. runner.sh (Template Framework)
|
||||
|
||||
@ -58,7 +60,6 @@ claude-scheduled@<task>.timer
|
||||
reads tasks/<task>/{prompt.md,settings.json,mcp.json}
|
||||
invokes: claude -p <prompt> --model --effort --max-budget-usd
|
||||
--allowedTools --output-format json
|
||||
stores result to cognitive-memory
|
||||
optionally POSTs to Discord webhook
|
||||
```
|
||||
|
||||
@ -85,15 +86,31 @@ claude-daily-report.timer
|
||||
→ generates summary, posts to Discord
|
||||
```
|
||||
|
||||
### 3. Plain Bash Scripts
|
||||
|
||||
Used for tasks that don't need AI — just shell commands with their own systemd units.
|
||||
|
||||
```
|
||||
sync-kb.timer (every 2 hours)
|
||||
→ sync-kb.service
|
||||
→ tasks/sync-kb/sync-kb.sh
|
||||
→ git add/commit/push .md files in claude-home
|
||||
→ push triggers kb-rag webhook reindex via Gitea Actions
|
||||
```
|
||||
|
||||
Logs go to `~/.local/share/claude-scheduled/logs/sync-kb/` (last 30 kept).
|
||||
|
||||
## Active Tasks
|
||||
|
||||
| Task | Trigger | Type | Description |
|
||||
|------|---------|------|-------------|
|
||||
| `backlog-triage` | Weekdays 09:15 | runner.sh | Scan Gitea issues, prioritize, suggest focus |
|
||||
| `sync-config` | Daily 02:00 | runner.sh | Commit and push `~/.claude` and `~/dotfiles` to Gitea |
|
||||
| `issue-poller` | Every 30 min | custom | Find new issues, dispatch AI workers |
|
||||
| `issue-dispatcher` | On-demand | custom | Fix a single issue, open a PR |
|
||||
| `pr-reviewer` | On timer | custom | Review open PRs, post formal reviews |
|
||||
| `daily-report` | Daily | custom | Summarize activity, post to Discord |
|
||||
| `sync-kb` | Every 2 hours | bash script | Commit and push claude-home KB changes to Gitea (triggers kb-rag reindex) |
|
||||
|
||||
## Settings Reference (`settings.json`)
|
||||
|
||||
@ -103,7 +120,6 @@ claude-daily-report.timer
|
||||
"effort": "medium",
|
||||
"max_budget_usd": 0.75,
|
||||
"allowed_tools": "Read(*) Glob(*) Grep(*)",
|
||||
"graph": "default",
|
||||
"working_dir": "/mnt/NV2/Development/claude-home",
|
||||
"timeout_seconds": 300,
|
||||
"notify_webhook": "https://discord.com/api/webhooks/..."
|
||||
@ -116,7 +132,6 @@ claude-daily-report.timer
|
||||
| `effort` | `medium` | `low`, `medium`, `high` — controls reasoning depth |
|
||||
| `max_budget_usd` | `0.25` | Hard cost ceiling per session |
|
||||
| `allowed_tools` | `Read(*) Glob(*) Grep(*)` | Principle of least privilege |
|
||||
| `graph` | `default` | Cognitive-memory graph for output storage |
|
||||
| `working_dir` | `claude-home` | `cd` here before running — loads that project's CLAUDE.md |
|
||||
| `timeout_seconds` | `300` | Hard timeout via `timeout(1)` |
|
||||
| `notify_webhook` | — | Discord webhook URL for result posting (optional) |
|
||||
|
||||
@ -88,15 +88,6 @@ Abbreviations defined in `config.fish` (loaded interactively):
|
||||
|
||||
Timers running under `systemctl --user` on the workstation. Not tracked in dotfiles — managed by their respective projects.
|
||||
|
||||
### Cognitive Memory Maintenance
|
||||
Source: `/mnt/NV2/Development/cognitive-memory/systemd/`
|
||||
|
||||
| Timer | Schedule | Purpose |
|
||||
|-------|----------|---------|
|
||||
| `cognitive-memory-embed.timer` | Hourly | Refresh embeddings (skips if unchanged) |
|
||||
| `cognitive-memory-daily.timer` | Daily midnight | Decay scores + regenerate CORE.md + git sync |
|
||||
| `cognitive-memory-weekly.timer` | Sun 02:00 | Reflect on recent memories |
|
||||
|
||||
### Claude Scheduled Tasks
|
||||
Config: `~/.config/claude-scheduled/` | Skill: `~/.claude/skills/create-scheduled-task/SKILL.md`
|
||||
|
||||
@ -111,7 +102,7 @@ Uses `claude-scheduled@.service` template unit. Add new tasks by creating a dire
|
||||
See [claude-code-config.md](claude-code-config.md) for full details on config file locations, MCP server setup, hooks, and permissions.
|
||||
|
||||
Key files:
|
||||
- `~/.claude.json` — MCP servers (cognitive-memory, n8n-mcp, gitea-mcp, tui-driver, kb-search)
|
||||
- `~/.claude.json` — MCP servers (n8n-mcp, gitea-mcp, tui-driver, kb-search)
|
||||
- `~/.claude/settings.json` — permissions, hooks, env vars, plugins
|
||||
- `~/.claude/skills/` — custom skill definitions
|
||||
- `~/.claude/hooks/` — hook scripts (format-code.sh, notify-subagent-done.sh)
|
||||
|
||||
@ -68,7 +68,6 @@ All defined in `~/.claude.json` under `mcpServers`:
|
||||
|
||||
| Server | Type | Purpose |
|
||||
|--------|------|---------|
|
||||
| `cognitive-memory` | stdio | Persistent memory system (local Python) |
|
||||
| `n8n-mcp` | stdio | n8n workflow automation API |
|
||||
| `gitea-mcp` | stdio | Gitea API (issues, PRs, repos) |
|
||||
| `tui-driver` | stdio | TUI automation for testing |
|
||||
@ -97,7 +96,6 @@ Hooks are configured in `~/.claude/settings.json` under the `hooks` key. They ru
|
||||
|-------|--------|
|
||||
| `PostToolUse` (Edit/Write/MultiEdit) | Auto-format code via `format-code.sh` |
|
||||
| `SubagentStop` | Notify via `notify-subagent-done.sh` |
|
||||
| `SessionEnd` | Save session memories via `cognitive-memory` |
|
||||
|
||||
## Permissions
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user