mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-14 22:13:41 +08:00
feat(skill): ck — context-keeper v2, persistent per-project memory
Adds the ck (Context Keeper) skill — deterministic Node.js scripts that give Claude Code persistent, per-project memory across sessions. Architecture: - commands/ — 8 Node.js scripts handle all command logic (init, save, resume, info, list, forget, migrate, shared). Claude calls scripts and displays output — no LLM interpretation of command logic. - hooks/session-start.mjs — injects ~100 token compact summary on session start (not kilobytes). Detects unsaved sessions, git activity since last save, goal mismatch vs CLAUDE.md. - context.json as source of truth — CONTEXT.md is generated from it. Full session history, session IDs, git activity per save. Commands: /ck:init /ck:save /ck:resume /ck:info /ck:list /ck:forget /ck:migrate Source: https://github.com/sreedhargs89/context-keeper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
41
skills/ck/commands/resume.mjs
Normal file
41
skills/ck/commands/resume.mjs
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* ck — Context Keeper v2
|
||||
* resume.mjs — full project briefing
|
||||
*
|
||||
* Usage: node resume.mjs [name|number]
|
||||
* stdout: bordered briefing box
|
||||
* exit 0: success exit 1: not found
|
||||
*/
|
||||
|
||||
import { resolveContext, renderBriefingBox } from './shared.mjs';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
const arg = process.argv[2];
|
||||
const cwd = process.env.PWD || process.cwd();
|
||||
|
||||
const resolved = resolveContext(arg, cwd);
|
||||
if (!resolved) {
|
||||
const hint = arg ? `No project matching "${arg}".` : 'This directory is not registered.';
|
||||
console.log(`${hint} Run /ck:init to register it.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const { context, projectPath } = resolved;
|
||||
|
||||
// Attempt to cd to the project path
|
||||
if (projectPath && projectPath !== cwd) {
|
||||
try {
|
||||
const exists = execSync(`test -d "${projectPath}" && echo yes || echo no`, {
|
||||
stdio: 'pipe', encoding: 'utf8', timeout: 2000,
|
||||
}).trim();
|
||||
if (exists === 'yes') {
|
||||
console.log(`→ cd ${projectPath}`);
|
||||
} else {
|
||||
console.log(`⚠ Path not found: ${projectPath}`);
|
||||
}
|
||||
} catch { /* non-fatal */ }
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log(renderBriefingBox(context));
|
||||
Reference in New Issue
Block a user