# Wiki Layer — References

## Files This Feature Reads From

| File / Path | Role |
|---|---|
| `session-logs/*.md` | Raw source — root general logs |
| `projects/*/session-logs/*.md` | Raw source — project-specific logs |
| `clients/*/session-logs/*.md` | Raw source — client logs |
| `projects/*/CONTEXT.md` | Cross-reference for live state facts |
| `.claude/memory/*.md` | Cross-reference for discrete facts |
| `credentials.md` | Cross-reference for access details |

## Files This Feature Writes To

| File / Path | Role |
|---|---|
| `wiki/index.md` | LLM-maintained master index |
| `wiki/clients/<slug>.md` | Per-client synthesized knowledge |
| `wiki/projects/<slug>.md` | Per-project synthesized knowledge |
| `wiki/systems/<slug>.md` | Per-system synthesized knowledge |
| `wiki/patterns/<slug>.md` | Cross-cutting pattern articles |

## Commands This Feature Touches

| Command | Change |
|---|---|
| `.claude/commands/context.md` | Add wiki-first search step (Phase 3) |
| `.claude/commands/save.md` | Add post-save wiki update prompt (Phase 5) |
| `.claude/commands/wiki-compile.md` | New — created in Phase 2 |
| `.claude/commands/wiki-lint.md` | New — created in Phase 4 |

## Integration Points

### GrepAI
- `wiki/` is under the repo root — GrepAI watcher picks it up automatically
- No config change needed
- Wiki articles get full semantic search immediately after creation
- CLI: `D:/claudetools/grepai.exe search "cascades billing rate" --json -c -n 5`

### Ollama (Compilation Engine)
- Model: `qwen3:8b` on DESKTOP-0O8A1RL (86 tok/s, fits in 12GB VRAM)
- Model: `qwen3:14b` on other machines
- Prompt style: structured-format, JSON frontmatter first, then article body
- Endpoint: `http://localhost:11434` (DESKTOP-0O8A1RL) | `http://100.92.127.64:11434` (others)
- See `.claude/OLLAMA.md` for full routing table

### Git / Gitea Sync
- `wiki/` is tracked in Git — syncs via `sync.sh` on every `/save` and `/sync`
- Cross-machine sync is automatic: Mike compiles on DESKTOP, Howard gets it on next pull
- No special handling needed

### Coord API
- Wiki does NOT replace coord API — they serve different purposes
- Coord API: real-time state (locks, messages, component state)
- Wiki: synthesized historical knowledge
- `/wiki-compile` may read coord API component state for currency checks but does not write to it

## Existing Relevant Docs

| Doc | Why Relevant |
|---|---|
| `.claude/CLAUDE.md` | Auto-context-loading section needs updating to reference wiki |
| `.claude/OLLAMA.md` | Compilation uses Ollama — routing table and examples |
| `.claude/FILE_PLACEMENT_GUIDE.md` | `wiki/` placement is new — add section |
| `.claude/memory/MEMORY.md` | Memory entries should link to wiki articles where applicable |
| `CONTEXT.md` (root) | Add wiki to "Where to Find Things" section |

## Karpathy Reference

Original post: https://x.com/karpathy/status/2039805659525644595
Posted: 2026-04-02
Key insight adopted: raw data → LLM-compiled wiki → Q&A against wiki → outputs filed back into wiki
Key insight NOT adopted: Obsidian IDE, RAG pipelines, finetuning (unnecessary at our scale)
Key divergence: We already have GrepAI (replaces his naive search engine) and coord API (real-time comms he lacks)
