一键导入
ck-learn
Record a new knowledge snippet — domain rules, architectural decisions, gotchas, or cross-module relationships discovered during a session.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Record a new knowledge snippet — domain rules, architectural decisions, gotchas, or cross-module relationships discovered during a session.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
List files in a folder with their signatures, filtered by an optional regex pattern. Use this in fallback folder-scoped exploration after ck find-files.
Source discovery over path, file, type, and member names. Use this as the default first step before signatures or method extraction.
Build a seed-to-related keyword map from indexed results. Use when file-first retrieval is weak/noisy and you need fallback folder scoping with ck find-files.
Remove a stale knowledge snippet by ID when previously learned context is no longer valid.
Retrieve institutional knowledge for a confirmed folder or a cross-folder semantic query. Step 2.5 in the navigation protocol — run after confirming a target folder, before reading method bodies.
Initialize Context King in the current repository, or migrate a repo from a legacy per-repo deployment to the global install.
| name | ck-learn |
| description | Record a new knowledge snippet — domain rules, architectural decisions, gotchas, or cross-module relationships discovered during a session. |
Appends a new snippet to a session-specific JSONL file under .ck-knowledge/sessions/. Called by the session-end hook
(automated) and directly when you encounter something worth preserving mid-session.
.claude/skills/ck/ck learn \
--content "<text>" \
--folders "<folder1>,<folder2>" \
--tags "<tag1>,<tag2>"
| Option | Description |
|---|---|
--content <text> | The knowledge to record (required) |
--folders <f1,f2,...> | Comma-separated folder paths this snippet applies to |
--tags <t1,t2,...> | Comma-separated keywords for exact-match search |
--source <name> | Source label — defaults to "agent" |
--repo <path> | Repo root (default: auto-detect) |
The new snippet's UUID (stdout). Creates .ck-knowledge/ if absent. Silent (exit 0) when the repo has "brain": false in .ck.json.
ck learn writes through CK's schema-aware pipeline. Do not append/edit .ck-knowledge/**/*.jsonl files directly with shell tools.
Record: architectural patterns not obvious from folder structure, the WHY behind decisions, gotchas and constraints, cross-module relationships that span folders.
Do NOT record:
--folders, not in --contentck signatures — an agent can find those in 1 callIf --content is more than 4 sentences, you are including implementation detail. Cut until
only the non-obvious insight remains.
Good:
.claude/skills/ck/ck learn \
--content "Interac refunds require card-present: Interac's network rules mandate terminal
authentication. Unlike Visa/MC, there is no offline refund path — this is why the terminal
flow is structurally different from the API-only path." \
--folders "src/Modules/Payments/Adyen/Terminal/" \
--tags "interac,adyen,refund,terminal,card-present"
Bad (same snippet, wrong):
--content "... renderComponent (path/to/renderComponent.tsx) calls getInitChainWithCheck(),
finds the DOM node via getMountElement, creates a React element, and pushes both into
backendComponentsStore (Zustand vanilla store in path/to/backendComponentsStore.ts) ..."
File paths in prose, internal helper names, Zustand store location — all findable via
ck signatures. Strip them; keep only the non-obvious architectural insight.