Khala — Cross-Session Knowledge Sharing
Share knowledge between concurrent Claude Code sessions via two append-only files in .khala/ at the project root.
Files
| File | Purpose | Format |
|---|---|---|
.khala/stream.jsonl |
Raw event log | JSONL, append-only |
.khala/insights.md |
Curated insights for sibling sessions | Markdown, append-only |
On /khala <session-name> Invocation
- Create
.khala/directory if it doesn't exist - Read
.khala/insights.mdif exists — absorb current insights - Read
.khala/stream.jsonlif exists — scan recent entries (last 100 lines if > 200) - Append registration to stream:
{"t":"2026-02-06T14:30","s":"auth","m":"Session joined. Working on: Firebase auth"} - Summarize insights found (if any) and confirm session name to user
Operate under <session-name> for all subsequent Khala writes.
Per-Turn Behavior
Turn start:
- Read
.khala/insights.mdfor new entries - If new insights found, inform user briefly: "Khala: [session] discovered [summary]"
After significant work or user feedback:
- Append to
.khala/stream.jsonl - If insight-worthy, also append to
.khala/insights.md
Stream Format
{"t":"YYYY-MM-DDTHH:MM","s":"session-name","m":"Natural language message"}
Write when: task started/completed, error resolved, dependency discovered, user feedback received, shared file modified.
{"t":"2026-02-06T14:42","s":"auth","m":"Firestore rules updated — /users/{uid} now requires auth"}
{"t":"2026-02-06T15:15","s":"auth","m":"User requested session-based auth instead of JWT"}
Insight Format
Append to .khala/insights.md:
### [HH:MM] session-name — Brief title
1-3 sentences. Essential knowledge other sessions need now.
---
Insight Criteria
Write when ANY apply:
- Affects sibling sessions — shared resource changed, API modified, dependency added
- Prevents duplicate effort — "tried X, failed because Y"
- Architectural decision — pattern others must follow
- Non-obvious discovery — saves siblings from wasted time
Skip when: routine progress, session-internal decisions, common knowledge.
File Size
- Stream > 200 lines → read last 100 only
- Insights → always read in full
Rules
- Append-only — never modify existing entries
- Concise — stream < 200 chars, insights < 3 sentences
- Honest timestamps — use actual current time
- Read before write — check insights at turn start
- No conversation — announcements only, no replies between sessions