SLOPSHOPPER

edit-heatmap

Count successful Edit and Write calls by path.

newpaneguardcommand
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · edit-heatmap
│ ┃ Edit Heatmap ✕ › fix the failing auth test and add an audit log call │ ┃ Edit Heatmap │ ┃ ⏺ Read(src/auth.ts) │ ┃ Count successful Edit and Write calls by ⎿ Read 6 lines │ ┃ path. ⏺ Update(src/auth.ts) │ ┃ ⎿ Added 2 lines, removed 1 line │ ┃ Successful file tool calls; Bash edits are ⏺ Bash(bun test) │ ┃ not counted. ⎿ 3 pass, 1 fail │ ┃ │ ┃ ############ 1 /work/app/src/auth.ts ● Done. refresh now rejects expired claims and logs an audit event. │ ┃ │ ┃ ############ 1 /work/app/src/audit.ts ✻ Worked for 42s · done 4:20 PM │ ┃ │ ┃ ############ 1 /work/app/src/cache.ts › /edit-heatmap │ ┃ │ ┃ r: Refresh │ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts

Draws

Pane · Edit Heatmap
Edit Heatmap Count successful Edit and Write calls by path. Successful file tool calls; Bash edits are not counted. ############ 1 /work/app/src/auth.ts ############ 1 /work/app/src/audit.ts ############ 1 /work/app/src/cache.ts r: Refresh
README

Edit Heatmap

Count successful Edit and Write calls by path.

Use it when: See which files receive the most attention.

Edit Heatmap render preview

Screenshot of this mod's render tree in the fixture preview, with sample data. This is not a capture of the Claude Code application. How previews are made.

Install and open

claude plugin marketplace add whyashthakker/awesome-claude-code-mods
claude plugin install edit-heatmap@awesome-claude-code-mods

Run /reload-plugins in an existing session, then /edit-heatmap. Use Tab and Enter to operate controls; Esc closes the pane. Terminal and Desktop Code tab supported; pane UI is unavailable in claude -p and the VS Code chat panel.

Try the source without installing:

claude --plugin-dir ./mods/edit-heatmap

Access and behavior

Observes edited file paths; no content reads or persistence.

Module variables reset on hot reload. Diagnostic history begins when the mod loads and lasts until reload or process exit; it does not reconstruct earlier activity. All display output is bounded; viewers may truncate long content to 9,000 characters. Relative file paths and Git commands use the session working directory.

Verify

Tested with Claude Code 2.1.288. Minimum documented mods version: 2.1.287. The API can change; validate against your installed version.

claude plugin validate mods/edit-heatmap --strict
claude plugin test mods/edit-heatmap

Tests cover plugin commands, pane isolation, both UI surfaces, and the behavior described in tests/register.test.ts. Drawing tests validate element trees; they do not verify pixels painted by the native apps. Validation details.

MIT licensed. No runtime packages or build step required.

Source 2 files
hooks/register.js 46 lines
1import { clean, text, code, row, frame, bar, pretty, bounded, entries, safePath } from './ui.js'
2const ID = "edit-heatmap"
3let files = {}
4export function register(on) {
5  on('session.start', async ($, e, next) => {
6
7    await $.command.register({name:ID, description:"Count successful Edit and Write calls by path.", immediate:true, argumentHint:""})
8    return next(e)
9  })
10  on('command.run', {command:"edit-heatmap"}, async ($, e) => {
11
12    await $.ui.open({id:ID,title:"Edit Heatmap",focus:true,closeOnEscape:true})
13    return {}
14  })
15
16on('tool.call', {tool:['Edit','Write']}, async ($, e, next) => {
17 const r = await next(e)
18 if(!r.deny && !r.isError && typeof e.file_path === 'string') {
19   if(Object.keys(files).length < 200 || files[e.file_path]) files[e.file_path]=(files[e.file_path]||0)+1
20   $.ui.invalidate('ui.render')
21 }
22 return r
23})
24
25  on('ui.render', {component:'Pane'}, async ($, e, next) => {
26    if(e.requestId !== ID) return next(e)
27    const E = $.ui.resolve(e)
28    try {
29      const body = await draw($, E)
30      return frame(E,"Edit Heatmap","Count successful Edit and Write calls by path.",body)
31    } catch(error) {
32      return frame(E,"Edit Heatmap",'Unable to inspect this data.',[text(E,error.message,{color:'yellow'}),E.Button({key:'refresh',label:'Refresh',onPress:()=>$.ui.invalidate('ui.render')})])
33    }
34  })
35}
36async function draw($, E) {
37  const refresh = E.Button({key:'refresh',label:'Refresh',hotkey:'r',plain:true,onPress:()=>$.ui.invalidate('ui.render')})
38
39const sorted = Object.entries(files).sort((a,b)=>b[1]-a[1])
40const max = sorted[0]?.[1] || 1
41return [text(E,'Successful file tool calls; Bash edits are not counted.'),
42 ...sorted.map(([path,n])=>text(E,'#'.repeat(Math.ceil(n/max*12)).padEnd(13)+n+'  '+path)),
43 ...(sorted.length ? []:[text(E,'No successful file edits observed yet.')]),refresh]
44
45}
46
hooks/ui.js 36 lines
1// Pure UI helpers. No engine access; each plugin contains its own copy.
2export function clean(value, limit = 9000) {
3  return String(value ?? '').replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/g, '').slice(0, limit)
4}
5export function text(E, value, props = {}) {
6  return E.Text({ ...props, children: [clean(value)] })
7}
8export function code(E, value, language = 'text') {
9  return E.Code({ source: clean(value), language })
10}
11export function row(E, children) {
12  return E.Box({ flexDirection: 'row', columnGap: 2, flexWrap: 'wrap', children })
13}
14export function frame(E, title, subtitle, children) {
15  return E.Box({ flexDirection: 'column', gap: 1, children: [
16    text(E, title, { bold: true, color: 'cyan' }),
17    text(E, subtitle, { dimColor: true }), ...children,
18  ] })
19}
20export function bar(percent, width = 24) {
21  const p = Math.max(0, Math.min(100, Number(percent) || 0))
22  const n = Math.round(p / 100 * width)
23  return '[' + '#'.repeat(n) + '-'.repeat(width - n) + '] ' + p.toFixed(1) + '%'
24}
25export function pretty(value) { return JSON.stringify(value, null, 2) }
26export function bounded(value, max = 9000) {
27  if (value.length > max) throw new Error('Input exceeds ' + max + ' characters. Use a smaller selection.')
28  return value
29}
30export function entries(value) { return value && typeof value === 'object' ? Object.entries(value) : [] }
31export function safePath(value) {
32  const path = value.trim()
33  if (!path || path.startsWith('-') || /[\x00-\x1f]/.test(path)) throw new Error('Enter a path without control characters or leading flags.')
34  return path
35}
36