learnings
Persistent JSONL knowledge store for cross-session learnings. Saves entries via /dog:learn, searches and lists via /dog:learnings. Use when you want to capture a specific insight, decision, or technique from the current session for future recall.
/dog:learnings — Persistent Cross-Session Knowledge Store
A searchable JSONL database of learnings extracted from sessions. Works alongside the existing dog:learner skill (which saves reusable skill files). This skill stores granular insights — specific techniques, decisions, and patterns that don't warrant a full skill file.
When to Use
- When
/dog:learnextracted a broad pattern, but you also want to save a specific detail - When you learned something session-specific (e.g., "this repo uses X convention for Y")
- When searching for something you remember learning but can't find in skills
Storage
File: ~/.dog/projects/{slug}/learnings.jsonl
Slug: git remote get-url origin | slugify (or $(basename $PWD) if no remote)
JSONL line schema:
{
"ts": "2026-04-15T12:00:00Z",
"tags": ["bun", "testing"],
"title": "Use Bun built-in test runner for TS projects",
"body": "bun test runs without vitest config. Use `bun test --watch` for TDD.",
"files": ["package.json"],
"commit_sha": "abc1234"
}
API
Save a learning (via /dog:learn)
/dog:learn has been extended to also append to the JSONL store after saving the skill file.
The JSONL entry is written with:
title: first line of the learning descriptionbody: full descriptiontags: auto-extracted keywords (language names, tool names, concept keywords)files: files mentioned or recently editedcommit_sha: current HEAD
List recent learnings
/dog:learnings # last 20 entries
/dog:learnings bun # search by keyword
/dog:learnings --tag testing # filter by tag
/dog:learnings --since 7d # entries from last 7 days
/dog:learnings --files pkg # entries mentioning files matching 'pkg'
Search implementation
SLUG=$(git remote get-url origin 2>/dev/null | sed 's|[/:.]|-|g' || basename $PWD)
FILE=~/.dog/projects/${SLUG}/learnings.jsonl
# Keyword search
grep -i "$QUERY" "$FILE" | tail -20 | while IFS= read -r line; do
echo "$line" | jq -r '"[\(.ts[:10])] \(.title)"'
done
# Tag filter
jq -r 'select(.tags[] | contains("'"$TAG"'")) | "[\(.ts[:10])] \(.title)"' "$FILE"
# Since filter (approximate — compare date prefix)
jq -r 'select(.ts >= "'"$(date -d '-7 days' +%Y-%m-%d 2>/dev/null || date -v-7d +%Y-%m-%d)"'") | "[\(.ts[:10])] \(.title)"' "$FILE"
Process
Saving via /dog:learn
When /dog:learn is invoked, after saving the skill file:
- Extract metadata: title, tags (keywords from description), files touched, current commit SHA
- Build JSONL entry
- Ensure
~/.dog/projects/{slug}/directory exists - Append entry to
learnings.jsonl - Report:
Saved to learnings.jsonl: "{title}"
Listing/searching via /dog:learnings
-
Resolve slug and locate
~/.dog/projects/{slug}/learnings.jsonl -
If file doesn't exist: print
No learnings found for this project. -
Apply filters (keyword, --tag, --since, --files)
-
Display results as numbered list:
1. [2026-04-15] Use Bun built-in test runner for TS projects Tags: bun, testing bun test runs without vitest config. Use `bun test --watch` for TDD. -
If no results:
No learnings matching "{query}".
Verification
SLUG=$(git remote get-url origin 2>/dev/null | sed 's|[/:.]|-|g' || basename $PWD)
tail -1 ~/.dog/projects/${SLUG}/learnings.jsonl | jq .title
Should print the title of the last saved learning.
Related
- Skill:
dog:learner(saves full skill files; this skill saves granular insights) - Command:
/dog:learn(entry point for saving),/dog:learnings(entry point for querying) - Agent:
pattern-extractor