
## Trigger

- Starting a lihan-cards consult/capture — or any session that relies on the
  user-level agent config — on this WSL host.
- Prevents two failure modes: acting on **stale local cards** after a recent
  merge, and acting on an **empty user config** because a symlink got clobbered.

## Symptoms

- `~/.claude/CLAUDE.md` or `~/.codex/AGENTS.md` is a 0-byte regular file
  instead of a symlink → user config silently empty (no language routing,
  proxy, or principle essence reaches the agent).
- A `--local` registry read disagrees with the live site shortly after a PR
  merge.

## Diagnosis

Two source-of-truth drifts on this host:

1. **cc-switch** (a running tray daemon, `~/.cc-switch/`, autostarts on Windows
   boot via WSLg) re-deploys tool config and **overwrites the symlinks** that
   `scripts/install.sh` created at `~/.claude/CLAUDE.md` and
   `~/.codex/AGENTS.md`. It is the old pointer-copy flow `install.sh` was meant
   to replace, still installed.
2. The local clone can **lag `origin/main`** after a PR merge; the canonical
   card source is the remote registry, not the working tree.

## Fix

Do this pre-consult, **every time**:

1. **Align with remote first.** `git fetch && git status -sb`; `git pull
   --ff-only` if behind. For consulting, prefer the canonical remote
   `https://lihan3238.github.io/ai/registry.json` over `--local` (the public
   URL is always current; `--local` is for authoring/preview).
2. **Verify the two config symlinks** (see `verify`). If clobbered:
   `bash scripts/install.sh`, then remove any 0-byte `*.bak.*` junk.
3. **Durable fix:** disable cc-switch's skill / user-prompt (用户提示词)
   management in its GUI. That toggle lives in `cc-switch.db`, not
   `settings.json`, so it can't be confirmed from config files — the only proof
   it held is the symlinks not reverting.

## Reuse Rule

- **Load when**: at the start of a lihan-cards consult/capture on this WSL
  host, or whenever the user config looks empty or local cards look stale.
- **Do not load when**: consulting from the remote registry URL on a host
  without cc-switch, or in a project unrelated to this blog's config sync.
