session-reflect
Skill57 starsChanged 5 months agoMITView on GitHub
Analyze a user's pi coding-agent session history for recurring behavior, prompting habits, workflow loops, friction, and preferences. Use when the user asks to inspect or reflect on pi sessions, common behavior patterns, agent/user interaction style, prompting habits, or personal pi workflow quality.
- Installs packages
3 other projects use a version of this.
Adopted by
Most recently taken up by
- AbdouMoumen/claude-skills-plugintheir own version, first seen Nov 1, 2026
- aaronpdoherty/claude-skillstheir own version, first seen Jul 18, 2026
- iiiburnyiii/agent-skillstheir own version, first seen May 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- AbdouMoumen/claude-skills-plugin★ 1same name
- aaronpdoherty/claude-skills★ 0same name
- iiiburnyiii/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-browserSkill
- ai-newsSkill
- applescriptSkill
- birdSkill
- chat-to-skillSkill
- dont-anger-marioSkill
- github-issuesSkill
- keyboard-layout-decoderSkill
- maintainer-replySkill
- package-releaseSkill
- pr-reviewSkill
- skill-discoverySkill
- twitter-thread-styleSkill
- vibe-mergeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 9 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to help the user understand their own pi usage patterns from local session logs.
- Distinctive: line 25
Do not hardcode English behavior categories or phrase lists as conclusions.
- Distinctive: line 26
Treat repeated text, n-grams, FTS hits, and SQL aggregates as evidence leads, not interpretations.
- Very specific: line 31
When the current user message is itself a high-signal intervention, follow the recovery protocol in references/intervention-events.md …
- Very specific: line 35
Use scripts/session-db.ts as a local evidence workbench.
- Distinctive: line 50
If the user points to another session root:
- Very specific: line 84
Use --format table|json|markdown before the subcommand when output will be read by the agent or quoted in a report:
- Distinctive: line 91
Read references/query-cookbook.md when selecting SQL queries.
- Distinctive: line 96
If the task is reflection over a large history, extract user messages first.
- Very specific: line 98
Run a bounded first-pass evidence set: overview, exact-short-repeats, tools, long-sessions, and sample --turns 3 --examples 2.
- Distinctive: line 101
Run targeted searches for explicit current-user preferences mentioned in the conversation, then inspect context.
- Distinctive: line 104
Ask whether the user wants tooling changes, pi prompt/default changes, or deeper follow-up analysis.
- Distinctive: line 108
Use this structure unless the user asks otherwise:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session Reflect
Use this skill to help the user understand their own pi usage patterns from local session logs.
Data location
By default this skill writes only to:
~/.pi/agent/cache/session-reflect/It never writes analysis databases into the current project by default. Use --db only when the user explicitly asks for another location. Use clean to remove the default cache.
The skill's job is evidence retrieval + agent judgment. Do not turn the helper script into the analyst. Use the script to load/search/query session evidence; use your own reasoning to infer patterns cautiously.
Core rules
- Discuss the analysis approach before implementing new tooling or making broad claims.
- Do not hardcode English behavior categories or phrase lists as conclusions.
- Treat repeated text, n-grams, FTS hits, and SQL aggregates as evidence leads, not interpretations.
- Inspect surrounding context before interpreting short user turns like “go ahead” or “what next”.
- Preserve multilingual text, typos, shorthand, pasted logs, and frustration markers as meaningful evidence.
- Cite session paths or message keys for important claims.
- Separate: observed facts, interpretations, confidence, alternative explanations, recommendations.
- When the current user message is itself a high-signal intervention, follow the recovery protocol in
references/intervention-events.mdbefore continuing.
Helper script
Use scripts/session-db.ts as a local evidence workbench. It loads pi JSONL sessions into DuckDB and exposes SQL/search/context helpers.
Install helper dependencies from the skill directory if they are missing:
cd <dot-pi>/skills/session-reflect
npm installTypical first step:
npx tsx scripts/session-db.ts buildIf the user points to another session root:
npx tsx scripts/session-db.ts build --root <session-root>Useful evidence commands:
npx tsx scripts/session-db.ts doctor
npx tsx scripts/session-db.ts preset --list
npx tsx scripts/session-db.ts preset overview
npx tsx scripts/session-db.ts preset exact-short-repeats
npx tsx scripts/session-db.ts preset long-sessions
npx tsx scripts/session-db.ts turns --role user --limit 80
npx tsx scripts/session-db.ts turns --role user --short --limit 100
npx tsx scripts/session-db.ts ngrams --n 2 --min-count 3 --limit 50
npx tsx scripts/session-db.ts ngrams --n 3 --min-count 3 --limit 50
npx tsx scripts/session-db.ts search "literal or fuzzy lead" --role user --limit 25
npx tsx scripts/session-db.ts context <message_key> --before 4 --after 8
npx tsx scripts/session-db.ts context <message_key> --before 4 --after 8 --compact --hide-tools
npx tsx scripts/session-db.ts examples --text "Go ahead." --limit 5 --before 3 --after 5
npx tsx scripts/session-db.ts sample --turns 5 --examples 2 --before 3 --after 5
npx tsx scripts/session-db.ts interventions --limit 30 --min-score 2 --sort score
npx tsx scripts/session-db.ts interventions --limit 30 --min-score 2 --sort recent
npx tsx scripts/session-db.ts interventions --signal autonomy_boundary,evidence_challenge --limit 20
npx tsx scripts/session-db.ts interventions --project quackdb --since 2026-06-01 --limit 20
npx tsx scripts/session-db.ts interventions --sample --limit 10 --min-score 2
npx tsx scripts/session-db.ts interventions --pasted include --limit 20 --min-score 2
npx tsx scripts/session-db.ts interventions --pasted only --limit 20 --min-score 2
npx tsx scripts/session-db.ts interventions --context --limit 10 --min-score 2 --sort recent --before 4 --after 6
npx tsx scripts/session-db.ts sql "select ..."Use --format table|json|markdown before the subcommand when output will be read by the agent or quoted in a report:
npx tsx scripts/session-db.ts --format markdown preset exact-short-repeats
npx tsx scripts/session-db.ts --format json context <message_key>Read references/query-cookbook.md when selecting SQL queries. Read references/reflection-protocol.md before producing a user-facing reflection. Read references/intervention-events.md when analyzing shouting, profanity, corrections, frustration, stop/pause requests, evidence challenges, or any high-signal user redirect.
Recommended workflow
- Clarify scope: recent sessions vs all sessions, coding-only vs all Pi use, and desired output depth.
- If the task is reflection over a large history, extract user messages first. Use them to identify candidate workflows and repeated corrections; retrieve assistant/tool context only around selected examples.
- Build or refresh the DuckDB evidence database with
scripts/session-db.ts build. - Run a bounded first-pass evidence set:
overview,exact-short-repeats,tools,long-sessions, andsample --turns 3 --examples 2. Add n-grams only when exact repeats do not explain enough. - Pick surprising evidence leads and retrieve compact context windows around representative message keys. For repeated exact turns, use
examples --text ...for targeted sampling orsamplefor time-spread examples across top repeated turns. Use--compact --hide-toolsfirst; rerun without them only when tool output matters. - For friction analysis, treat candidate events as broad interventions, not just profanity/escalation. Use
references/intervention-events.mdbefore generalizing. - Run targeted searches for explicit current-user preferences mentioned in the conversation, then inspect context.
- Reason manually from evidence; do not let preset names, query names, repeated phrases, profanity, or all-caps become conclusions.
- Present a concise reflection with citations and confidence levels.
- Ask whether the user wants tooling changes, pi prompt/default changes, or deeper follow-up analysis.
Output shape
Use this structure unless the user asks otherwise:
# Pi session behavior reflection
## Evidence inspected
- Database/session scope
- Query types used
## Observed patterns
For each pattern:
- Observation
- Evidence
- Interpretation
- Confidence
- Alternative explanation
## Friction / failure modes
## Preferences inferred from behavior
## Recommendations to test
## Open questionsDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

