/insights should support project-level filtering
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Currently, /insights analyzes all Claude Code sessions globally across every project I've
worked on. There is no way to scope the analysis to a specific project.
I work across multiple independent projects simultaneously (e.g., Laravel backend, uni-app
mobile app, admin panels, mini-programs). Each project has very different tech stacks,
patterns, and friction points. When I run /insights, the report mixes data from all these
contexts together, which makes the suggestions and analysis less actionable for any individual
project.
For example, UI layout friction from a mini-program project gets mixed with DevOps friction
from a backend project, and the CLAUDE.md suggestions don't distinguish which project they
apply to. I want to understand how Claude performs specifically within one codebase so I can
optimize my CLAUDE.md and workflow for that project.
Proposed Solution
Add a project filter to /insights:
/insights(no flag) — default behavior, analyze current project's sessions only (based on
working directory or git repo root)
/insights --all— analyze all sessions globally (current behavior)/insights --project /path/to/project— analyze sessions from a specific project path
Since session data likely already contains the working directory, filtering by project path
before running the analysis should be straightforward.
The generated report should indicate the scope (e.g., "Analyzing 12 sessions for project:
dtbao-mobile" vs "Analyzing 53 sessions across all projects").
Alternative Solutions
There are no effective workarounds currently. I can only read the global report and mentally
filter which insights apply to which project, which defeats the purpose of automated analysis.
I considered manually inspecting the raw session data files, but they are not structured for
easy project-based filtering by end users.
Priority
Low - Nice to have
Feature Category
CLI commands and flags
Use Case Example
Example scenario:
- I have 5 active projects: a Laravel backend, a uni-app mobile app, a Taobao mini-program, an
admin panel, and a documentation repo
- I want to review how Claude performs specifically on my mobile app project (dtbao-mobile)
- I open the mobile app project and run
/insights - The report shows only the 15 sessions related to this project, with targeted suggestions
like "Add mescroll pagination patterns to CLAUDE.md" instead of generic cross-project advice
- I can then run
/insights --allif I want the global view across all projects - This helps me write better per-project CLAUDE.md files and optimize my workflow for each
codebase independently
Additional Context
- The session metadata likely already tracks the working directory, so project-based filtering
should be feasible without major changes
- This would pair well with per-project CLAUDE.md files — project-scoped insights could
generate more precise CLAUDE.md suggestions
- Related: it would also be useful if the report HTML indicated which project each analyzed
session belonged to, even in global mode
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗