Problem
When setting up Cortex in a new project, cortex init outputs the hooks JSON but does not create the required .claude/rules/ files. This leaves a manual gap that's easy to miss:
.claude/rules/cortex-memory-instructions.md — Instructs Claude to use [MEMORY:] tags
.claude/rules/cortex-briefing.md — Empty file that Cortex populates with extracted memories
Without these files, Layer 3 extraction (self-reporting via [MEMORY:] tags) doesn't work because Claude doesn't know to use the tags.
Current Setup Flow (with gap)
cortex init # ✅ Creates project hash, outputs hooks JSON
# User manually adds hooks to .claude/settings.local.json ✅
# User manually creates .claude/rules/ directory ❌ Easy to miss
# User manually copies template file ❌ Easy to miss
# User manually creates empty briefing file ❌ Easy to miss
Proposed Solution
Enhance cortex init to handle full Claude Code integration:
Option A: New --setup flag
cortex init # Current behavior (backward compatible)
cortex init --setup # Creates .claude/rules/ with both files
Option B: Interactive prompt
$ cortex init
Created project hash: 9c50fee522dcb7a2
Set up Claude Code integration? [Y/n] Y
Created: .claude/rules/cortex-memory-instructions.md
Created: .claude/rules/cortex-briefing.md
Add the following to .claude/settings.local.json:
{
"hooks": {
"Stop": [...],
"PreCompact": [...],
"SessionStart": [...]
}
}
Option C: Single command does everything
cortex init # Always creates rules files if .claude/ exists
Files to Create
.claude/rules/cortex-memory-instructions.md
Copy from templates/cortex-memory-instructions.md (already exists in repo)
.claude/rules/cortex-briefing.md
<!-- Cortex briefing - auto-populated by cortex session-start -->
Acceptance Criteria
Context
Discovered while setting up klockthingy project — hooks were configured and working, but Layer 3 extraction wasn't happening because the rules files were missing.
🤖 Generated with Claude Code
Problem
When setting up Cortex in a new project,
cortex initoutputs the hooks JSON but does not create the required.claude/rules/files. This leaves a manual gap that's easy to miss:.claude/rules/cortex-memory-instructions.md— Instructs Claude to use[MEMORY:]tags.claude/rules/cortex-briefing.md— Empty file that Cortex populates with extracted memoriesWithout these files, Layer 3 extraction (self-reporting via
[MEMORY:]tags) doesn't work because Claude doesn't know to use the tags.Current Setup Flow (with gap)
Proposed Solution
Enhance
cortex initto handle full Claude Code integration:Option A: New
--setupflagOption B: Interactive prompt
Option C: Single command does everything
cortex init # Always creates rules files if .claude/ existsFiles to Create
.claude/rules/cortex-memory-instructions.mdCopy from
templates/cortex-memory-instructions.md(already exists in repo).claude/rules/cortex-briefing.md<!-- Cortex briefing - auto-populated by cortex session-start -->Acceptance Criteria
cortex init(or--setupvariant) creates.claude/rules/directorycortex-memory-instructions.mdtemplate to rules directorycortex-briefing.mdfile--forceflagContext
Discovered while setting up klockthingy project — hooks were configured and working, but Layer 3 extraction wasn't happening because the rules files were missing.
🤖 Generated with Claude Code