claude-code-memory-explorer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Bump version, tag, push, and create a GitHub release with auto-generated notes
3
+ argument-hint: "[version e.g. 1.13.0 or rc4]"
4
+ ---
5
+
6
+ # Release
7
+
8
+ Create a new release for this project.
9
+
10
+ ## Inputs
11
+
12
+ - `$ARGUMENTS` — target version or shorthand. Examples:
13
+ - `1.13.0` — full version
14
+ - `rc4` — shorthand for next RC (e.g. if current is `1.19.0-rc.3`, becomes `1.19.0-rc.4`)
15
+ - If not provided, ask the user.
16
+
17
+ ## Steps
18
+
19
+ 1. **Determine version**: Use `$ARGUMENTS` or ask user. Handle `rc<N>` shorthand by reading current version from `package.json` and replacing/appending the RC suffix. Validate it's different from the current version.
20
+
21
+ 2. **Detect prerelease**: If version contains `-rc.`, `-alpha.`, `-beta.`, treat as prerelease.
22
+
23
+ 3. **Check working tree**: Run `git status`. If there are uncommitted changes, warn the user and stop.
24
+
25
+ 4. **Bump version**:
26
+ ```
27
+ npm version <version> --no-git-tag-version
28
+ ```
29
+
30
+ 5. **Commit & push** (push to current branch, not hardcoded `main`):
31
+ ```
32
+ git add package.json package-lock.json
33
+ git commit -m "🔖 chore: Bump version to <version>"
34
+ git push origin HEAD
35
+ ```
36
+
37
+ 6. **Tag & push tag**:
38
+ ```
39
+ git tag v<version>
40
+ git push origin v<version>
41
+ ```
42
+
43
+ 7. **Generate release notes**: Collect commits since the previous tag using `git log --oneline <prev-tag>..HEAD`. Write a **user-facing summary** grouped by:
44
+ - Features (✨) — describe what was added, not raw commit messages
45
+ - Fixes (🐛)
46
+ - Other notable changes
47
+ Include a "Full Changelog" compare link at the bottom.
48
+
49
+ 8. **Create GitHub release** (add `--prerelease` flag for RC/alpha/beta):
50
+ ```
51
+ gh release create v<version> --title "v<version>" --notes "<notes>" [--prerelease]
52
+ ```
53
+
54
+ 9. **Report**: Show the release URL to the user.
@@ -0,0 +1,36 @@
1
+ name: Deploy static site to Pages
2
+
3
+ on:
4
+ push:
5
+ branches: ["main", "master"]
6
+ paths:
7
+ - "docs/**"
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+ pages: write
13
+ id-token: write
14
+
15
+ concurrency:
16
+ group: "pages"
17
+ cancel-in-progress: false
18
+
19
+ jobs:
20
+ deploy:
21
+ environment:
22
+ name: github-pages
23
+ url: ${{ steps.deployment.outputs.page_url }}
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@v4
28
+ - name: Setup Pages
29
+ uses: actions/configure-pages@v5
30
+ - name: Upload artifact
31
+ uses: actions/upload-pages-artifact@v3
32
+ with:
33
+ path: "docs"
34
+ - name: Deploy to GitHub Pages
35
+ id: deployment
36
+ uses: actions/deploy-pages@v4
package/CLAUDE.md ADDED
@@ -0,0 +1,49 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## What This Is
6
+
7
+ Dashboard for visualizing all memory sources that influence Claude Code behavior. Shows the full memory stack: CLAUDE.md files (user/project/local), rules (`.claude/rules/*.md` with optional path-scoped frontmatter), auto memory (`~/.claude/projects/<encoded>/memory/`), and `@import` chains.
8
+
9
+ ## Commands
10
+
11
+ - `npm start` — run server (port 3459)
12
+ - `npm run dev` — run with auto-open browser
13
+ - `npx @biomejs/biome check public/app.js public/style.css` — lint
14
+ - `npx @biomejs/biome format --write public/app.js public/style.css` — format
15
+
16
+ ## Architecture
17
+
18
+ Single-file Express backend + vanilla JS frontend. No build step, no framework.
19
+
20
+ - **`server.js`** — Express server with two main responsibilities:
21
+ 1. **Filesystem scanning** (`discoverMemorySources`) — walks `~/.claude/`, ancestor directories, project `.claude/rules/`, and auto memory dirs to build the full memory source stack
22
+ 2. **API endpoints** — `/api/stack`, `/api/summary`, `/api/file`, `/api/rules/match`, `/api/imports` etc.
23
+ - **`public/app.js`** — SPA with tree panel (left) + preview panel (right) split layout. Fetches from API, renders tree grouped by scope, shows syntax-highlighted preview with frontmatter badges and clickable `@import` links.
24
+ - **`public/style.css`** — CSS variables on `:root` (dark default), `body.light` overrides. Scope colors: user=blue, project=green, local=yellow, rule=purple, memory=orange, policy=red.
25
+
26
+ Both JS files use `// #region` / `// #endregion` markers for code organization.
27
+
28
+ ## Key Server Concepts
29
+
30
+ - **Project path encoding**: Claude Code stores auto memory in `~/.claude/projects/<encoded-path>/memory/`. The encoding replaces `/` with `-` and strips `:` from drive letters. `findMemoryDir()` tries exact match first, falls back to substring matching.
31
+ - **Import resolution**: `@path/to/file.md` references are parsed from content. `resolveExistingImports()` resolves paths and filters out non-existent files. Imported files are recursively added to the stack (max 5 levels).
32
+ - **Frontmatter parsing**: YAML frontmatter in rules files (`paths`, `type`, `name`, `description`) determines conditional loading. `parseFrontmatter()` handles both inline values and YAML array syntax.
33
+ - **Rules matching**: `micromatch` glob matching against rule `paths` frontmatter via `/api/rules/match?file=`.
34
+ - **Cache**: 30-second TTL on `discoverMemorySources` results, cleared on project switch or manual refresh.
35
+
36
+ ## Conventions
37
+
38
+ - Dark theme default, light theme via `body.light` class
39
+ - Accent color: `#e86f33`
40
+ - Fonts: IBM Plex Mono (data/code), Playfair Display (headings)
41
+ - Keyboard-driven: j/k navigation, t=theme, r=refresh, e=open in editor, ?=help
42
+ - Port 3459 (cost=3458, marketplace=3460)
43
+ - `zoom: 1.25` on body for proportional scaling
44
+ - No token/context budget estimation — only line/byte counts (deliberate decision)
45
+
46
+ ## Prior Art
47
+
48
+ - `../claude-code-cost` — same stack, data visualization patterns
49
+ - `../claude-code-marketplace` — file tree, markdown preview, project picker, Highlight.js usage
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # Claude Code Memory
2
+
3
+ [![npm version](https://img.shields.io/npm/v/claude-code-memory-explorer)](https://www.npmjs.com/package/claude-code-memory-explorer)
4
+ [![license](https://img.shields.io/npm/l/claude-code-memory-explorer)](LICENSE)
5
+ [![npm downloads](https://img.shields.io/npm/dm/claude-code-memory-explorer)](https://www.npmjs.com/package/claude-code-memory-explorer)
6
+
7
+ > See everything Claude Code knows about your project — CLAUDE.md files, rules, auto memory, and imports.
8
+
9
+ ## Getting Started
10
+
11
+ ```bash
12
+ npx claude-code-memory-explorer --open
13
+ ```
14
+
15
+ Open http://localhost:3459 (or use `--open` to auto-launch the browser).
16
+
17
+ That's it. No config — the dashboard reads your existing Claude Code memory files.
18
+
19
+ ![Dark theme](assets/main-dark.png)
20
+ ![Light theme](assets/main-light.png)
21
+
22
+ ## Features
23
+
24
+ - **Full memory stack** — User CLAUDE.md, project CLAUDE.md, CLAUDE.local.md, rules, auto memory, and managed policies
25
+ - **Import resolution** — Follows `@path/to/file.md` references and `[text](file.md)` markdown links up to 5 levels deep
26
+ - **Rules inspection** — Shows path-scoped frontmatter (`paths`, `type`, `name`) with conditional load indicators
27
+ - **Auto memory** — Visualizes MEMORY.md with startup cutoff line, on-demand topic files, and frontmatter badges
28
+ - **Tree + preview** — Left panel grouped by scope (user/project/rules/memory), right panel with syntax-highlighted preview
29
+ - **Keyboard-driven** — j/k navigation, h/l group jump, e to open in editor, t for theme, ? for help
30
+ - **Resizable sidebar** — Drag handle between tree and preview, width persisted
31
+ - **Browser history** — Back/forward navigates file selection, bookmarkable URLs
32
+ - **Dark & light theme** — Dark default, light toggle with `t` key
33
+ - **Hub integration** — Works as a tab in Claude Code Hub alongside Cost and Marketplace
34
+
35
+ ## Configuration
36
+
37
+ ```bash
38
+ PORT=8080 npx claude-code-memory-explorer # Custom port
39
+ npx claude-code-memory-explorer --open # Auto-open browser
40
+ npx claude-code-memory-explorer --dir=~/.claude-work # Custom Claude config dir
41
+ npx claude-code-memory-explorer --project=/path/to/project # Specify project path
42
+ ```
43
+
44
+ If port 3459 is in use, the server falls back to a random available port.
45
+
46
+ ### Global install
47
+
48
+ ```bash
49
+ npm install -g claude-code-memory-explorer
50
+ claude-code-memory-explorer --open
51
+ ```
52
+
53
+ ## How It Works
54
+
55
+ Claude Code stores memory across multiple locations:
56
+
57
+ | Source | Path | Load Behavior |
58
+ |--------|------|---------------|
59
+ | Managed policy | `/etc/claude-code/CLAUDE.md` | Always |
60
+ | User CLAUDE.md | `~/.claude/CLAUDE.md` | Always |
61
+ | Project CLAUDE.md | `./CLAUDE.md` or `./.claude/CLAUDE.md` | Always |
62
+ | CLAUDE.local.md | `./CLAUDE.local.md` | Always |
63
+ | Rules | `.claude/rules/*.md` | Conditional (path-scoped) |
64
+ | Auto memory | `~/.claude/projects/<encoded>/memory/` | Startup (MEMORY.md) or on-demand |
65
+
66
+ The dashboard:
67
+ 1. **Scans** all memory locations — `~/.claude/`, ancestor directories, project rules, auto memory
68
+ 2. **Parses** YAML frontmatter in rules files for path globs and metadata
69
+ 3. **Resolves** `@import` chains recursively (max 5 levels), tracking both hard imports and soft markdown links
70
+ 4. **Groups** sources by scope with parent-child nesting for imports
71
+ 5. **Renders** with Highlight.js syntax highlighting — no build step, vanilla JS
72
+
73
+ Nothing is modified — the dashboard is read-only.
74
+
75
+ ### Memory Path Encoding
76
+
77
+ Claude Code encodes project paths for auto memory storage: `C:\Users\me\dev\myproject` becomes `C--Users-me-dev-myproject` under `~/.claude/projects/`. The dashboard tries exact match first, then falls back to substring matching.
78
+
79
+ ## FAQ
80
+
81
+ **Does it modify any files?**
82
+ No. Completely read-only — only reads markdown files from the Claude Code memory locations.
83
+
84
+ **Does it work with Claude Code Hub?**
85
+ Yes. Exposes `/hub-config` endpoint for hub tab integration.
86
+
87
+ **Can I switch projects?**
88
+ Yes. Use the project picker (Shift+P) or pass `?project=/path` as a URL parameter.
89
+
90
+ ## License
91
+
92
+ MIT
Binary file
Binary file
package/biome.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
3
+ "formatter": {
4
+ "enabled": true,
5
+ "indentStyle": "space",
6
+ "indentWidth": 2,
7
+ "lineWidth": 120
8
+ },
9
+ "linter": {
10
+ "enabled": true,
11
+ "rules": {
12
+ "style": {
13
+ "noDescendingSpecificity": "off"
14
+ },
15
+ "suspicious": {
16
+ "useIterableCallbackReturn": "off"
17
+ }
18
+ }
19
+ },
20
+ "javascript": {
21
+ "formatter": {
22
+ "quoteStyle": "single"
23
+ }
24
+ },
25
+ "css": {
26
+ "formatter": {
27
+ "quoteStyle": "single"
28
+ }
29
+ },
30
+ "files": {
31
+ "includes": ["public/app.js", "public/style.css"]
32
+ }
33
+ }
Binary file
Binary file