hindsight
AGENTS.md0 starsChanged 4 months agoMITView on GitHub
Hindsight is a Claude Code plugin for analyzing session logs. If you see /hindsight in a conversation or a .claude/hindsight/ directory in a project, here's what you need to know: You do not need to understand hindsight's internals to use it. Invoke the skill and it handles the rest. Claude Code plugins are defined by .claude-plugin/plugin.json, which points to a skills directory. Each skill is a SKILL.md file with YAML frontmatter (name, description, args) and markdown instructions that Claude follows…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- lens-writingSkill
- hindsightSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 89
Do not attempt to read session JSONL files directly.
- Very specific: line 106
All code files start with a two-line ABOUTME: comment explaining what the file does.
- Distinctive: line 107
No mock implementations. The pipeline runs against real session data via the configured source.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hindsight — Agent Guide
If You Encountered Hindsight in Another Project
Hindsight is a Claude Code plugin for analyzing session logs. If you see /hindsight in a conversation or a .claude/hindsight/ directory in a project, here's what you need to know:
/hindsight <date-range> <lens>runs a session analysis pipeline. It reads session logs via ccvault or agentsview (auto-detected), extracts summaries, and produces a report through a configurable lens./hindsight:lens-writingis a subskill for creating and evaluating lenses.~/.claude/hindsight/lenses/contains user-global lens files.<project>/.claude/hindsight/lenses/contains project-scoped lenses.~/.claude/hindsight/reports/contains generated reports organized by date range and lens name.~/.claude/hindsight/evaluations/contains lens evaluation artifacts from the lens-writing skill.
You do not need to understand hindsight's internals to use it. Invoke the skill and it handles the rest.
If You Are Developing Hindsight
Project Structure
hindsight/
├── .claude-plugin/
│ ├── plugin.json # Plugin identity (name, version, skill path)
│ └── marketplace.json # Dev marketplace config
├── skills/
│ ├── hindsight/
│ │ └── SKILL.md # Main orchestrator — the five-phase pipeline
│ ├── hindsight:lens-writing/
│ │ └── SKILL.md # Lens creation and evaluation subskill
│ └── shared/
│ ├── extraction-prompt.md # Prompt template for per-session subagents
│ └── session-summary-schema.md # Standardized summary format
├── lenses/ # Default lenses shipped with the plugin
│ ├── standup.md
│ ├── knowledge-extraction.md
│ ├── workflow-optimization.md
│ ├── content-mining.md
│ ├── agent-autonomy.md
│ └── skill-review.md
├── scripts/
│ ├── install.sh # Creates user dirs, copies default lenses
│ ├── uninstall.sh # Removes user dirs after confirmation
│ └── migrate-to-hindsight.sh # One-time migration from cc-review
├── docs/
│ ├── backlog.md # Deferred work items
│ └── plans/ # Design and implementation docs
├── CLAUDE.md # Dev conventions for this repo
├── AGENTS.md # This file
└── README.md # Human-facing docsHow the Plugin System Works
Claude Code plugins are defined by .claude-plugin/plugin.json, which points to a skills directory. Each skill is a SKILL.md file with YAML frontmatter (name, description, args) and markdown instructions that Claude follows when the skill is invoked.
plugin.jsondeclares the plugin name, version, and skills path.marketplace.jsonregisters the plugin with a marketplace (or local dev directory) so Claude Code can discover it.- Skills are loaded by name.
hindsightmaps toskills/hindsight/SKILL.md. The colon-namespacedhindsight:lens-writingmaps toskills/hindsight:lens-writing/SKILL.md.
The Layer System
The pipeline has four layers. Know which layer you're modifying:
| Layer | File | What It Controls |
| 1 | skills/shared/session-summary-schema.md | Fields in every session summary |
| 2 | skills/shared/extraction-prompt.md | How subagents read sessions via the configured source |
| 3 | Lens ## Extraction Hints | Extra data a specific lens needs per-session |
| 4 | Lens ## Analysis Instructions | How the final report is synthesized |
Layers 1-2 are core. Changes here affect every lens. Test against multiple lenses before modifying. These are not lens-level concerns — if a lens needs something that layer 1-2 doesn't provide, that's a core contribution with a higher bar.
Layers 3-4 are lens-scoped. Each lens controls its own extraction hints and analysis instructions. Changes here only affect that lens.
Pipeline Phases
The main skill (skills/hindsight/SKILL.md) orchestrates five phases:
- Interpret & Validate — Parse input into date range + lens. Resolve natural language. Confirm interpretation with user.
- Collect Sessions — Query the available source(s) for sessions in the date range. If both ccvault and agentsview are installed, results are merged and deduplicated by session ID. See
skills/shared/sources.mdfor per-source CLI contracts. - Load Lens — Read the lens file, extract analysis instructions and extraction hints.
- Extract Summaries — Dispatch parallel subagents (batches of 5) to produce standardized summaries. Results are cached in
~/.claude/hindsight/reports/<date-range>/summaries/. - Cross-Cutting Analysis — Apply the lens to all summaries and produce the final report.
- Write Report — Save to
~/.claude/hindsight/reports/<date-range>/<lens-name>.md.
Session Source Dependency
Hindsight reads session data through one of two interchangeable local-first tools: ccvault or agentsview. Phase 0 auto-detects which is installed at runtime; if both are present, Phase 1 queries both and merges the results (deduped by session ID). The canonical per-source CLI contracts live in skills/shared/sources.md.
Do not attempt to read session JSONL files directly. Always go through the configured source.
Where to Modify What
| I want to... | Modify |
| Change what data every summary contains | skills/shared/session-summary-schema.md (layer 1) |
| Change how subagents read sessions | skills/shared/extraction-prompt.md (layer 2) |
| Add a new default lens | lenses/<name>.md + scripts/install.sh |
| Change how a lens analyzes data | The lens file's Analysis Instructions (layer 4) |
| Change what extra data a lens extracts | The lens file's Extraction Hints (layer 3) |
| Change the pipeline orchestration | skills/hindsight/SKILL.md |
| Change the lens creation/evaluation workflow | skills/hindsight:lens-writing/SKILL.md |
| Add a new skill to the plugin | Create skills/<name>/SKILL.md, no config changes needed |
Conventions
- All code files start with a two-line
ABOUTME:comment explaining what the file does. - No mock implementations. The pipeline runs against real session data via the configured source.
- Lens files use the format documented in the lens-writing skill.
- Design docs go in
docs/plans/YYYY-MM-DD-<topic>-design.md. Implementation plans go indocs/plans/YYYY-MM-DD-<topic>-implementation.md.
Does 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.

