agentleFS
2389-research2389-research/hindsight/AGENTS.md

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.

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
  1. Distinctive:

    Do not attempt to read session JSONL files directly.

    line 89
  2. Very specific:

    All code files start with a two-line ABOUTME: comment explaining what the file does.

    line 106
  3. Distinctive:

    No mock implementations. The pipeline runs against real session data via the configured source.

    line 107

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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-writing is 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 docs

How 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.json declares the plugin name, version, and skills path.
  • marketplace.json registers the plugin with a marketplace (or local dev directory) so Claude Code can discover it.
  • Skills are loaded by name. hindsight maps to skills/hindsight/SKILL.md. The colon-namespaced hindsight:lens-writing maps to skills/hindsight:lens-writing/SKILL.md.

The Layer System

The pipeline has four layers. Know which layer you're modifying:

LayerFileWhat It Controls
1skills/shared/session-summary-schema.mdFields in every session summary
2skills/shared/extraction-prompt.mdHow subagents read sessions via the configured source
3Lens ## Extraction HintsExtra data a specific lens needs per-session
4Lens ## Analysis InstructionsHow 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:

  1. Interpret & Validate — Parse input into date range + lens. Resolve natural language. Confirm interpretation with user.
  2. 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.md for per-source CLI contracts.
  3. Load Lens — Read the lens file, extract analysis instructions and extraction hints.
  4. Extract Summaries — Dispatch parallel subagents (batches of 5) to produce standardized summaries. Results are cached in ~/.claude/hindsight/reports/<date-range>/summaries/.
  5. Cross-Cutting Analysis — Apply the lens to all summaries and produce the final report.
  6. 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 containsskills/shared/session-summary-schema.md (layer 1)
Change how subagents read sessionsskills/shared/extraction-prompt.md (layer 2)
Add a new default lenslenses/<name>.md + scripts/install.sh
Change how a lens analyzes dataThe lens file's Analysis Instructions (layer 4)
Change what extra data a lens extractsThe lens file's Extraction Hints (layer 3)
Change the pipeline orchestrationskills/hindsight/SKILL.md
Change the lens creation/evaluation workflowskills/hindsight:lens-writing/SKILL.md
Add a new skill to the pluginCreate 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 in docs/plans/YYYY-MM-DD-<topic>-implementation.md.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.