ClaudeLens / src
CLAUDE.md64 starsChanged 3 months agoMITView on GitHub
This directory contains the Electron renderer process: a single-page React app that displays ClaudeLens UI. App.tsx — Root component ProjectOverview.tsx (tabs/ProjectOverview.tsx) — Root navigation shell Hooks (hooks/useIPC.ts) Components (components/)
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- arch-analysisSkill
- build-dmgSkill
- github-issueSkill
- github-prSkill
- new-claude-modelSkill
- run-appSkill
- transcript-driftSkill
The file
We split this CLAUDE.md into the rules it gives an agent
11 rules. About 0 are common, 0 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
All feature components live in components/project/
- Very specific: line 23
All results follow { data: T | null, error: string | null } shape
- Very specific: line 53
Add a new case to the View type in components/project/types.ts
- Very specific: line 54
Add a new hook to useIPC.ts if data fetching is needed
- Very specific: line 55
Create a new component in the appropriate components/project/<domain>/ folder
- Very specific: line 56
Add the case to the switch(view.type) in tabs/ProjectOverview.tsx
- Very specific: line 57
Update navigation handlers to call onNavigate({ type: '...' })
- Very specific: line 61
Navigation state: Keep it in one useState in ProjectOverview.
- Very specific: line 62
Data fetching: Always use hooks from useIPC.ts.
- Very specific: line 63
Error handling: Use unwrap() or check error field.
- Very specific: line 65
Date/time: Use fmtDate() for localized display (currently it-IT).
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
src/ — Renderer (React SPA)
This directory contains the Electron renderer process: a single-page React app that displays ClaudeLens UI.
Architecture
App.tsx — Root component
- Sets up the outer layout (header + main)
- Calls
useDataChangedRefetch()to invalidate the affected queries when~/.claude/changes (the main process tags eachdata:changedwith the namespaces the changed path can touch; an untagged event still invalidates everything) - Renders
<ProjectOverview />
ProjectOverview.tsx (tabs/ProjectOverview.tsx) — Root navigation shell
- Manages all UI state in a single
Viewdiscriminated union (no router) - Views (~30 cases, see
components/project/types.ts):global-home|overview|global-claudemd|global-skills|skill-detail|skill-create|global-agents|agent-detail|agent-create|global-mcp|mcp-detail|studio|studio-create|studio-blueprint|project-skills|project-agents|project-mcp|project-tasks|project-plans|plan-detail|project-workflows|workflow-detail|project-teams|team-detail|project-claudemd|project-memory|sessions|analytics|chat|memory-topic|ai-assistant|live-monitor|agents-live|monitor|search|exchange|duplicates|settings|project-config|remote - Thin shell: top bar +
.cl-shell(project rail +.cl-mainscroll area) +switch(view.type)→ delegates to feature components. The rail (overview/ProjectRail, design 5a) replaced the horizontal subtab bar, so the body below the top bar is a row, not a column; it mounts in project scope only - All feature components live in
components/project/
Hooks (hooks/useIPC.ts)
- React Query hooks wrapping IPC calls to the main process
- All results follow
{ data: T | null, error: string | null }shape unwrap()helper raises on error- Mutations (
useCreateTopic,useUpdateTopic,useDeleteTopic) invalidate['memory:project', hash]cache on success - Types:
MemoryTopic,MemoryProject,SessionSummary,ClaudeMdLayer,RuleFile, etc.
Components (components/)
Markdown.tsx— Renders markdown with syntax highlightingproject/types.ts—Viewunion type +TYPE_STYLES/SCOPE_STYLESdesign tokensproject/utils.ts— Pure formatters:fmt,fmtCost,fmtDate,fmtModel,modelColorproject/shared/— Atomic UI:BackButton,StatChip,TopBar,CreateFormKit(shared building blocks for create pages)project/chat/— Chat rendering:ChatView,MessageBubble,ToolDetailPanel,ToolGroupCard, atoms, utilsproject/memory/—MemoryTopicView, utilsproject/claudemd/—GlobalClaudeMdView,ProjectClaudeMdViewproject/skills/—GlobalSkillsView,SkillDetailView,CreateSkillPageproject/agents/—GlobalAgentsView,AgentDetailView,RunAgentDialog,CreateAgentPageproject/agents-live/—AgentsLiveView(background/live agent sessions)project/monitor/—MonitorView(global "what is running right now": a full-bleed band per blocked process, a hairline grid for everything else)project/mcp/—GlobalMcpView,McpServerCard,McpServerDetailViewproject/analytics/—AnalyticsViewproject/ai-assistant/—AiAssistantViewproject/sessions/—TagBar,TagChip,TagPicker(session tagging)project/tasks/—TasksSectionproject/plans/—PlansSection,PlanDetailViewproject/teams/—TeamsSection,TeamDetailView(agent teams)project/overview/—ProjectOverviewContent,GlobalHomeView,Lens,ProjectRail,DuplicateProjectsNoticeproject/remote/—RemoteView(Claude Code on another machine, over the system ssh — #242)
When adding a new view
- Add a new case to the
Viewtype incomponents/project/types.ts - Add a new hook to
useIPC.tsif data fetching is needed - Create a new component in the appropriate
components/project/<domain>/folder - Add the
caseto theswitch(view.type)intabs/ProjectOverview.tsx - Update navigation handlers to call
onNavigate({ type: '...' })
Conventions
- Navigation state: Keep it in one
useStateinProjectOverview; pass callbacks to child components - Data fetching: Always use hooks from
useIPC.ts; React Query caches automatically - Error handling: Use
unwrap()or checkerrorfield; show user-friendly messages - Styling: Tailwind CSS + the
--cl-*brand tokens /cl-*classes inindex.css(terracotta accent#C15F3C); do not introduce new accent hues — see rootCLAUDE.md - Date/time: Use
fmtDate()for localized display (currentlyit-IT);fmt()usesen-USthousands separators
Testing
Pure modules are covered by Vitest unit tests under test/ (run npm test).
Stateful hooks are covered too, in jsdom, against a fake preload bridge:
// @vitest-environment jsdom
import { installFakeElectronAPI } from './helpers/fake-electron-api';
const bridge = installFakeElectronAPI(); // stands in for window.electronAPI
bridge.channels.chatChunk.emit({ sessionId, text: 'hi' }); // drive the renderer
expect(bridge.api.sessions.sendMessage).toHaveBeenCalledWith(/* … */);window.electronAPI is the renderer's only seam to the main process, so
replacing it runs hooks and components unmodified with no Electron and no
~/.claude on disk. The environment is opted into per file (node stays the
default). See test/use-live-chat.test.tsx for the pattern; the fake's surface
is partial by design — widen it as tests reach further.
Anything below that — layout, styling, how a view actually looks — has no
automated coverage. Validate it against real ~/.claude/ data by running:
npm run devThen navigate the ClaudeLens UI, inspect DevTools (Cmd+Shift+I), and check that views render correctly.
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.

