ModsCode / Claude Code Mods / Ranking / pulse-filetree
pulse-filetree
An IDE-style file tree for Claude Code that shows what Claude is doing and where in files
What it does
- Draws a pane, toasts
- Adds /filetree
- Watches Read calls
- Hooks classic.CwdChanged, classic.FileChanged, classic.SessionStart, prompt.attachment and 5 more
- Keeps its own state between turns
Good points
- No network calls
- Written in TypeScript
- Has a desktop-specific branch
- Handles errors
Code to start from
A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like pulse-filetree by Kurt Buhler (pane, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/mrvalraven-pulse-filetree/
// Written by ModsCode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the pane: open it with $.ui.open({ id: 'my-pane', title: "‹title›" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Client, Input, Button } = $.ui.resolve(e)
const repoName = '…'
const subPath = '…'
const t = '…'
const t2 = '…'
const t3 = '…'
const t4 = '…'
const t5 = '…'
const t6 = '…'
const head = '…'
const ahead = '…'
const behind = '…'
const upstream = '…'
const t7 = '…'
const t8 = '…'
const t9 = '…'
const t10 = '…'
const t11 = '…'
const t12 = '…'
const gitIcon = '…'
const query = '…'
const selected = '…'
const icon = '…'
const label = '…'
const hash = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row">
<Box flexDirection="row" flexShrink={1} overflow="hidden">
<Text bold wrap="truncate-start">
{repoName}
</Text>
<Text wrap="truncate-start">
{`/${subPath}`}
</Text>
</Box>
<Box flexGrow={1} />
<Box flexDirection="row" flexShrink={0}>
<Text>
{t}
</Text>
<Text>
{t2}
</Text>
<Text>
{t3}
</Text>
<Text>
{t4}
</Text>
<Text>
{t5}
</Text>
<Text>
{t6}
</Text>
<Text>
{" clean"}
</Text>
</Box>
</Box>
<Box flexDirection="row" height={1} overflow="hidden">
<Text>
{"⑂ "}
</Text>
<Box flexShrink={0} overflow="hidden">
<Text bold wrap="truncate-end">
{head}
</Text>
</Box>
<Box flexDirection="row" flexShrink={0}>
<Text>
{` ↑${ahead}`}
</Text>
<Text>
{` ↓${behind}`}
</Text>
</Box>
<Box flexShrink={100} overflow="hidden">
<Text wrap="truncate-end">
{` ${upstream}`}
</Text>
</Box>
<Box flexGrow={1} />
<Box flexDirection="row" flexShrink={0}>
<Text>
{t7}
</Text>
<Text>
{t8}
</Text>
<Text>
{t9}
</Text>
<Text>
{t10}
</Text>
<Text>
{t11}
</Text>
<Text>
{t12}
</Text>
<Text>
{" clean"}
</Text>
</Box>
</Box>
<Text wrap="truncate-end">
{gitIcon}
Git status starts after git init
</Text>
<Box flexDirection="row" flexWrap="wrap" columnGap={1}>
<Text>
·
</Text>
<Client module="./button.tsx" />
<Text>
·
</Text>
<Client module="./button.tsx" />
<Text>
·
</Text>
<Client module="./button.tsx" />
</Box>
<Box flexDirection="row" columnGap={1}>
<Box flexGrow={1} minWidth={14}>
<Input placeholder="Search files" submitLabel="jump" autoFocus value={`${query}`} />
</Box>
<Button plain dimColor label="Clear search" />
<Client module="./button.tsx" />
<Client module="./button.tsx" />
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={1}>
<Text>
·
</Text>
<Client module="./button.tsx" />
<Text>
·
</Text>
<Client module="./button.tsx" />
<Text>
·
</Text>
<Client module="./button.tsx" />
</Box>
<Client module="./rows.tsx" />
<Box flexGrow={1} />
<Text wrap="truncate-end">
────────
</Text>
<Box flexDirection="row">
<Box flexShrink={1}>
<Text wrap="truncate-start">
{"selected: "}
{selected}
</Text>
</Box>
<Box marginLeft={1} flexShrink={0}>
<Client module="./button.tsx" />
</Box>
<Box flexGrow={1} />
<Box flexDirection="row" marginLeft={2} flexShrink={0}>
<Text>
{`${icon} `}
</Text>
<Text>
{`${label}…`}
</Text>
<Text>
{` ${hash}`}
</Text>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const shortPath = '…'
const message = '…'
const text = '…'
await $.ui.toast(`could not list ${shortPath}: ${message}`)
await $.ui.toast(`Copied ${text}`)
return next(e)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
pulse-filetree/hooks/register.tsx lines 1354–1513 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e, next) => {
if (e.surface !== 'terminal' && e.surface !== 'desktop') return next(e)
if (e.surface === 'terminal' && e.props.placement === 'inline') {
noDock = true
void $.ui.close({ id: PANE }).catch(() => undefined)
const { Box: Empty } = $.ui.resolve(e)
return <Empty />
}
const isDesktop = e.surface === 'desktop'
const unicode = glyphSetting === 'plain' || (glyphSetting === 'auto' && (noNerd || isDesktop))
const { Box, Text, Button, Input, Client } = $.ui.resolve(e)
const t = await get($)
const theme: Theme = (await $.state.get(THEME)).value ?? DEFAULT_THEME
const palette: Palette = buildPalette(theme, isDesktop)
// The desktop tab never hands the wheel or the scrollbar drag to the pane, so
// there it draws every row and lets the engine scroll the body.
nativeScroll = isDesktop
const button = (b: ButtonProps) => <Client key={`button-${b.id}`} module="./button.tsx" props={{ id: b.id, label: b.label, dim: b.dim } satisfies ButtonProps} />
// What the hovered button does, beside the title, when it fits in the columns the title
// and whatever else shares its row leave; the buttons are Clients only so that they can
// say when the pointer is over them.
const hint = (buttons: { id: string; hint: string }[], used: number) => {
const text = buttons.find(b => b.id === hovered)?.hint
if (!text) return null
const room = e.props.bodyColumns - used - 2
return text.length <= room ? <Text color={palette.muted}>{`${text} `}</Text> : null
}
const divider = (columns: number) => <Text color={palette.faint} wrap="truncate-end">{'─'.repeat(Math.max(1, columns))}</Text>
if (t.preview) {
if (previewed?.path !== t.preview) await loadPreview($, t.preview)
const p = previewed
const markdown = /\.(md|markdown|mdx)$/i.test(t.preview)
const all = (p?.text ?? '').split('\n').length
previewRows = nativeScroll ? all : Math.max(4, (e.props.scroll?.bodyRows ?? 40) - (p?.note ? 2 : 1))
const win = previewLines(p?.text ?? '', nativeScroll ? 0 : Math.min(t.previewTop, Math.max(0, all - previewRows)), previewRows, markdown)
const name = t.preview !== t.root && inside(t.root, t.preview) ? relative(t.root, t.preview) : shortPath(t.preview)
const backLabel = isDesktop ? 'Close preview' : unicode ? '← files' : '\u{f004d} files'
const external = { id: 'external', label: isDesktop ? 'Open in default app' : unicode ? '↗ open' : '\u{f08e} open', dim: true, hint: 'open in default app' }
return (
<Box flexDirection="column" minHeight={Math.max(1, e.props.scroll?.bodyRows ?? 1)} backgroundColor={theme.bg || undefined}>
<Box flexDirection="row">
<Button key="back" plain label={backLabel} onPress={() => void closePreview($)} />
<Text> </Text>
<Box flexShrink={1} flexGrow={1}>
<Text bold color={palette.text} wrap="truncate-start">
{name}
</Text>
</Box>
{hint([external], widthOf(backLabel) + 2 + widthOf(name) + widthOf(external.label))}
{button(external)}
</Box>
{p?.note ? <Text color={palette.muted}>{p.note}</Text> : null}
{isDesktop && divider(e.props.bodyColumns)}
<Client
key="rows"
module="./rows.tsx"
props={{ rows: [], active: '', activeBg: palette.cursorBg, hoverBg: palette.hoverBg, tones: palette.shimmer, pointer: false, preview: { text: win.text, path: t.preview, startLine: win.top + 1, markdown } } satisfies RowsProps}
/>
</Box>
)
}
const now = await $.clock.now()
const live = (await activities($)).filter(a => now - a.at < (a.state === 'running' ? RUNNING_MAX_MS : ACTIVITY_TTL_MS))
const latest = [...live].reverse().find(a => a.state === 'running') ?? live[live.length - 1]
const bright = new Set(t.flashOn ? t.flash : [])
const dimmed = new Set(t.flashOn ? t.flashDim : [])
const ignored = new Set(t.ignored)
const untracked = new Set(t.untrackedDirs)
const width = Math.max(24, e.props.bodyColumns)
const rows = visibleRows(t)
// The controls. Labels say what a press does; all are drawn alike, so state is read from
// the label. The desktop puts Go up and Reload beside the search field and the view
// toggles on a row of their own; the terminal puts every control on a row that wraps.
// Follow cwd shows only while the tree is not following, and Clear selection sits beside
// the selection in the footer.
const say = (text: string) => (isDesktop ? text.charAt(0).toUpperCase() + text.slice(1) : text)
const columnLabel = showAge ? 'ages' : 'dates'
const sizeLabel = t.showSize ? `show ${columnLabel}` : 'show sizes'
const upButton = { id: 'up', label: say('go up'), dim: true, hint: 'parent folder' }
const reloadButton = { id: 'refresh', label: say('reload'), dim: true, hint: 'reload tree and git' }
const viewButtons = [
{ id: 'hidden', label: say(t.showHidden ? 'hide dotfiles' : 'show dotfiles'), dim: true, hint: t.showHidden ? 'hide hidden files' : 'show hidden files' },
{ id: 'size', label: say(sizeLabel), dim: true, hint: sizeLabel },
{ id: 'collapse', label: isDesktop ? 'Collapse all' : 'collapse', dim: true, hint: 'collapse all' },
...(follow ? [] : [{ id: 'cwd', label: say('follow cwd'), dim: true, hint: 'follow the cwd' }]),
]
const clearSelectionButton = { id: 'unselect', label: isDesktop ? 'Clear selection' : 'unselect', dim: true, hint: 'clear selection' }
const toolbarButtons = isDesktop ? viewButtons : [upButton, reloadButton, ...viewButtons]
const allButtons = [upButton, reloadButton, ...viewButtons, ...(t.selected ? [clearSelectionButton] : [])]
// How many rows the terminal's toolbar wraps to, filled greedily as the row lays out:
// each label, and the dot between two labels, a column apart.
const toolbarRows = (() => {
if (isDesktop) return 0
const itemWidths = toolbarButtons.flatMap((b, index) => (index === 0 ? [widthOf(b.label)] : [1, widthOf(b.label)]))
let lines = 1
let used = -1
for (const itemWidth of itemWidths) {
if (used >= 0 && used + 1 + itemWidth > width) {
lines += 1
used = itemWidth
} else used = used < 0 ? itemWidth : used + 1 + itemWidth
}
return lines
})()
const fixed = 2 + toolbarRows + (t.top ? (t.branch ? 1 : 0) : showHints ? 1 : 0) + (t.selected || latest ? 1 : 0)
const room = nativeScroll ? Math.max(1, rows.length) : Math.max(5, (e.props.scroll?.bodyRows ?? 40) - fixed)
const isLit = (id: string) => bright.has(id) || dimmed.has(id)
const focus = followClaude && t.flashOn ? ([...t.flash].reverse().find(id => id !== BRANCH_ROW) ?? t.cursor) : t.cursor
const at = Math.max(0, rows.findIndex(r => r.node.id === focus))
const lit = followClaude && t.flashOn ? rows.findIndex(r => isLit(r.node.id)) : -1
const cap = Math.max(1, Math.floor(room / 3))
let from = Math.max(0, Math.min(lit >= 0 && at - lit < room - 2 ? Math.max(0, lit - 1) : at - Math.floor(room / 2), rows.length - room))
let pinned = !nativeScroll && followClaude && t.flashOn ? rows.slice(0, from).filter(r => isLit(r.node.id)).slice(-cap) : []
if (pinned.length) {
const rest = Math.max(3, room - pinned.length)
from = Math.max(0, Math.min(at - Math.floor(rest / 2), rows.length - rest))
pinned = rows.slice(0, from).filter(r => isLit(r.node.id)).slice(-cap)
}
const max = Math.max(0, rows.length - room)
if (t.scroll !== null) {
from = Math.max(0, Math.min(t.scroll, max))
pinned = []
}
view = { from, max }
const shown = rows.slice(from, from + room - pinned.length)
if (t.showSize) wantSizes($, [...pinned, ...shown].filter(r => r.node.kind === 'dir' && !(r.node.id in t.dirSizes)).map(r => r.node.id))
const totals: [number, number] = t.top ? (t.diff[t.root] ?? [0, 0]) : [0, 0]
const isBarShown = !nativeScroll && rows.length > shown.length + pinned.length
const isNarrow = width < NARROW_COLUMNS
const countSegs = (counts: [number, number, number] | undefined): Seg[] => {
if (!counts) return []
const out: Seg[] = []
if (counts[0] > 0) out.push({ t: ` ?${counts[0]}`, c: palette.added })
if (counts[1] > 0) out.push({ t: ` M${counts[1]}`, c: palette.modified })
if (counts[2] > 0) out.push({ t: ` D${counts[2]}`, c: palette.deleted })
return out
}
const lineSegs = (loc: [number, number] | undefined): Seg[] => {
if (!loc) return []
const out: Seg[] = []
if (loc[0] > 0) out.push({ t: ` +${loc[0]}`, c: palette.addedLines })
if (loc[1] > 0) out.push({ t: ` -${loc[1]}`, c: palette.deletedLines })
return out
}
const rootCounts = t.top ? countSegs(t.counts[t.root]) : []
const repoName = t.top ? (t.top.split('/').pop() ?? t.top) : t.root.split('/').pop() || t.root
const subPath = t.top ? t.prefix.replace(/\/$/, '') : ''
const header = [repoName, subPath].filter(Boolean).join('/')
// Every row's trailing cells, first, so the main column can be as wide as its widest cell
// and line up down the tree: a detail cell (a folder's file counts, or line counts beside
// sizes), the main cell (date, age, size, or the line counts of a file or folder) and the
// git status mark. A narrow pane leaves a folder's line counts to the summary, so names
// keep room, and shows the folder's file counts in the main cell instead.
type Cells = { detail: Seg[]; main: Seg[]; mark: Seg; isDate: boolean }
const cellsOf = (r: (typeof rows)[number]): Cells => {
const n = r.node
const status = t.git[n.id] ?? (underAny(dirname(n.id), untracked, t.root) ? '?' : undefined)Licence text (MIT)
MIT License Copyright (c) 2026 Tiago Costa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
How to build this: Pane (panel), Deny a tool call
What its code calls
runs programsreads filesenv varstool callsremembers
What its code shows
Read from the source at commit 5d1454ecadbe. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.pulse-filetree/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.8 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, with its own branch for the desktop |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).pulse-filetree/hooks/register.tsx:127 uname (not on Windows); pulse-filetree/hooks/register.tsx:351 find (not on Windows); pulse-filetree/hooks/register.tsx:375 touch (not on Windows); pulse-filetree/hooks/register.tsx:410 du (not on Windows); pulse-filetree/hooks/register.tsx:786 rm (not on Windows) |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.pulse-filetree/hooks/register.tsx:906 sh (a shell or interpreter); pulse-filetree/hooks/register.tsx:916 a program named at run time; pulse-filetree/hooks/register.tsx:1006 a program named at run time; pulse-filetree/hooks/register.tsx:1015 sh (a shell or interpreter) |
| Reads and sends | Whether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads environment variables, files and reaches the network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets ModsCode show its code; otherwise the code is linked.MIT |
| Settings hooks | Hooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone |
| Servers it ships | MCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/ |
| Skills, commands, agents | What its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows |
| Tools and MCP | Whether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command |
| Asks of the model | Completions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command filetree |
| Events it hooks | By what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: command.run (filetree), tool.call (Read), prompt.submit · reads: ui.message, classic.SessionStart, classic.CwdChanged, classic.FileChanged, prompt.attachment · also: session.start, ui.focus (Pane), ui.scroll (Pane), ui.render (Pane) · timers: clock.after, clock.every |
| Reads, by name | The environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: OS, TMPDIR, HERDR_ENV, HERDR_BIN_PATH, HOME (+3); files: a path computed at run time, …/… |
| Writes, by name | The files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.the clipboard |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and ModsCode does not vouch for what this code does. Read its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
From its marketplace
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add MrValraven/pulse-mods/plugin install pulse-filetree@pulse-mods/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (5d1454ecadbe). Compare them before you install. /reload-plugins loads it into a session that is already open.
Try the commit ModsCode read
No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:
git clone https://github.com/MrValraven/pulse-modsgit -C pulse-mods checkout 5d1454ecadbe81ad3b198fcfb916218b96c4d04bclaude plugin validate pulse-mods/pulse-filetreeclaude --plugin-dir pulse-mods/pulse-filetreeThe validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.
Ask Claude or ChatGPT about it
With ModsCode added as a connector, Claude or ChatGPT can read this mod's code, what it reaches and how its controls are wired, and build on them. Ask it like this:
Read the ModsCode mod "mrvalraven-pulse-filetree" with its code and make me one like itAdd the ModsCode MCP to Claude or ChatGPT
Similar mods
- filetreeKurt Buhler★ 173
- grounded-engineeringGrounded Engineering★ 3
- claudelingoKeisuke Yoda★ 2
- file-explorerAvid★ 2
- reply-commentsMalkiz★ 2
- a2a-modAliasgar Khimani★ 1
More from this repository
More by Kurt Buhler
Badge for your README
If this is your mod, paste this into your README. It links to this page.
[](https://modscode.com/claude-mods/mods/mrvalraven-pulse-filetree/)