Session Mining
May 12, 2026 ยท View on GitHub
Use this when asked to turn prior AI work, chat history, or project lessons into a reusable skill or durable workflow.
Principles
- Mine repeated patterns, not raw chat.
- Keep private code, screenshots, stack dumps, and proprietary details out of reusable public artifacts.
- Separate collaboration preferences from architecture rules.
- Put each durable rule in the artifact that owns it.
- Treat memory as a lead; verify live files when the fact can drift.
Structural Parsing
For Codex-style JSONL sessions:
session_meta.payload.ididentifies the session.session_meta.payload.cwdandturn_context.payload.cwdidentify repo-scoped turns.response_item.payload.type == "message"androle == "user"contains user prompts.- Filter out injected
AGENTS.md, environment blocks, plugin lists, base64 images, and tool metadata.
Use native tools if shell wrappers distort counts:
/usr/bin/find /path/to/sessions -name '*.jsonl' | /usr/bin/wc -l
Classification Buckets
- Collaboration/status/tone -> collaboration skill or repo instructions.
- Screenshot/UI/repeated visual failure -> runtime-owner proof and UI workflow.
- Visual source asset rules -> visual asset workflow.
- Structural C#/refactor rules -> modular architecture workflow.
- Validation/runtime doubts -> validation workflow.
- Cleanup/deletion -> cleanup workflow.
- Gameplay balance/content -> content/system workflow.
- Git/publish -> git workflow.
Rule Update Workflow
- Count and describe scan scope.
- Filter to relevant repo/project turns unless user asks cross-project.
- Group repeated failures and successful fixes.
- Convert each lesson into a short reusable rule.
- Patch only the owning artifact.
- Validate docs/skill frontmatter and
git diff --check. - Report scan scope, changed artifacts, and what was intentionally excluded.
Do Not Include
- raw private prompts
- proprietary source code
- base64 images
- secrets, tokens, email, account IDs
- one-off user frustration as a permanent rule without repeated evidence
- stale runtime maps that should live in current architecture docs