Skip to content

Classify sessions by intent, optionally by Claude from all prompts - #10

Merged
Expecho merged 4 commits into
mainfrom
session-intent
Nov 4, 2026
Merged

Expecho merged 4 commits into
mainfrom
session-intent

Conversation

@Expecho

@Expecho Expecho commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Classifies every session by intent: bug fix, new development, refactoring, tests, planning & design, docs & content, ops & config, review, research & analysis, or other.

Rules (default, offline). The strongest signal wins:

  1. conventional commit messages and PR titles the session wrote (fix:, feat:, refactor: …)
  2. review commands (/code-review, /review, /security-review)
  3. words in the session title, then the git branch prefix (fix/, feature/ …), then the first prompt
  4. what it changed: only plan/spec documents, docs, tests or config files; mostly new files; or nothing at all (research)

The adoption report gets a Session intent section (sessions, share, PRs, edits, tokens and cost per intent) and a summary line. JSON gives each session's intent and intentEvidence.

Classified by Claude (skill).

  • New ccreports intents report: each session's intent and evidence. With -j it also includes the signals: title, every prompt typed in the session, branches, commit messages, changed files by kind, and the rules' guess.
  • New --intents <file> option: applies intents assigned elsewhere ({"<session id>": "<intent>"}) to any report, replacing the rules' guess, with evidence claude.
  • The skill exports the signals, classifies each session from all of its prompts, and reruns the report with --intents.

The loaders record the git branch (Claude Code and Copilot; Cursor logs none), the prompts, commit messages and PR titles, and the changed files.

Prompt text is never shown in a report. It only appears in intents -j, the signals export the skill reads.

Overlap with #9

This branch is based on main and doesn't include the working habits metrics (#9). Both branches add file tracking to the loaders (editFiles / writeFile, patchFiles). Whichever merges second will have small conflicts to resolve: patchFiles returns { updated, added } here, but a plain list in #9.

Test plan

  • npm test: 60 tests pass, including new test/intent.test.mjs, loader signal tests, and tests for parseIntents, the --intents override and the intents report
  • Spot-checked the rules on 120 real sessions; fixed misfires found along the way (plan documents under specs/ read as tests, a bare /clear taken as the first prompt, "create a tool" not counted as new development)
  • Ran the skill flow end to end: export signals → classify → adoption --intents

🤖 Generated with Claude Code

Expecho and others added 4 commits November 4, 2026 10:20
Every session gets an intent - bug fix, new development, refactoring,
tests, planning & design, docs & content, ops & config, review, research &
analysis or other - from rules over its commit messages and PR titles,
review commands, title, git branch prefix, first prompt and the files it
changed. The adoption report adds a Session intent section and a summary
line; JSON carries each session's intent and the evidence for it. Claude
Code, Copilot and Cursor loaders record the branch, first prompt, commit
messages and changed files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new `intents` report lists each session's intent and evidence; in JSON
it also carries the signals (title, first prompt, branches, commit
messages, changed files per kind, the rules' guess). `--intents <file>`
applies intents assigned elsewhere to any report, replacing the rules'
guess with evidence "claude". The skill exports the signals, classifies
the sessions itself and reruns the report with --intents.

Bare slash commands (/clear) no longer count as the first prompt, and
"create a tool / app / page" counts as new development.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The intents signals now carry every prompt typed in a session, in order
(resumed copies once, bare slash commands and interrupts left out, each
cut at 500 characters), instead of only the first. The skill reads them
all and judges the session as a whole. The rules keep using the first
prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/adoption.mjs
#	src/cursor.mjs
#	src/loader.mjs
@Expecho
Expecho merged commit 9ae11af into main Nov 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant