ModsCode / Claude Code Mods / Ranking / lcu-approve
lcu-approve
Native per-app approval for LCU computer use in the Claude app and Claude Code (Allow this conversation, Always allow, Deny), and the /computer-use-apps panel of approved apps.
What it does
- Draws a pane, toasts
- Watches tool calls and can refuse them
- Hooks classic.Elicitation, classic.SessionStart, classic.UserPromptSubmit, session.start and 3 more
- Keeps its own state between turns
- Starts processes
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 lcu-approve by LCU (pane, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/amontlabs-lcu-approve/
// 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: "Approved apps" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const length = '…'
const name = '…'
const bundleId = '…'
const name2 = '…'
const bundleId2 = '…'
const name3 = '…'
const bundleId3 = '…'
const text = '…'
return (
<Box flexDirection="column" gap={1}>
<Box flexDirection="column">
<Text bold>
Approved apps
</Text>
<Box flexDirection="row" gap={2} alignItems="center">
<Box flexGrow={1}>
<Text dimColor>
Computer use can control these apps without asking.
</Text>
</Box>
<Button>
Refresh
</Button>
</Box>
</Box>
<Box flexDirection="column" gap={1}>
<Box flexDirection="column">
<Text bold dimColor>
{`Always allowed (${length})`}
</Text>
<Text dimColor>
None. Allow one below.
</Text>
</Box>
<Box flexDirection="column">
<Text bold dimColor>
{`Not installed (${length})`}
</Text>
</Box>
<Box flexDirection="column">
<Text bold dimColor>
{`This conversation (${length})`}
</Text>
<Text dimColor>
None.
</Text>
<Box flexDirection="row" gap={2} alignItems="center">
<Box flexShrink={0}>
<Text bold>
{name}
</Text>
</Box>
<Box flexShrink={1}>
<Text dimColor wrap="truncate-end">
{bundleId}
</Text>
</Box>
<Box flexGrow={1} />
</Box>
<Box flexDirection="row" gap={2} alignItems="center">
<Box flexShrink={0}>
<Text bold>
{name2}
</Text>
</Box>
<Box flexShrink={1}>
<Text dimColor wrap="truncate-end">
{bundleId2}
</Text>
</Box>
<Box flexGrow={1} />
</Box>
<Box flexDirection="row" gap={2} alignItems="center">
<Box flexShrink={0}>
<Text bold>
{name3}
</Text>
</Box>
<Box flexShrink={1}>
<Text dimColor wrap="truncate-end">
{bundleId3}
</Text>
</Box>
<Box flexGrow={1} />
</Box>
</Box>
<Input label="Allow an app" placeholder="App name, bundle id or path" submitLabel="allow" />
</Box>
<Text color="red">
{text}
</Text>
</Box>
)
})
on('session.start', async ($, e, next) => {
const label = '…'
const text = '…'
await $.ui.toast(`Approval for ${label} dismissed`)
await $.ui.toast(`Computer use approval: ${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.
adapters/claude-mod/lcu-approve/hooks/register.tsx lines 74–83 · Pane
on('ui.render', { component: 'Pane' }, async ($, e, next) => {
if (e.requestId === APPS_PANE) {
const state = await read($, apps)
return <AppsView ui={$.ui.resolve(e)} state={state} />
}
const entry = shown.get(e.requestId)
if (!entry) return next(e)
// Presses are handled by the `ui.press` hook below, with that dispatch's own `$`.
return <ApprovalView ui={$.ui.resolve(e)} surface={e.surface} approval={entry.approval} icon={entry.icon} graphics={entry.graphics} />
})adapters/claude-mod/lcu-approve/hooks/views.tsx lines 142–208 · Pane
export function AppsView({ ui, state }: { ui: any; state: AppsState }) {
const { Box, Text, Button, Input } = ui
const busy = Boolean(state.busy)
const present = state.always.filter(app => app.installed)
const missing = state.always.filter(app => !app.installed)
const row = (app: AppRow) => (
<AppRowView key={app.bundleId} ui={ui} name={app.name} bundleId={app.bundleId}>
{app.risk === 'high' && <RiskBadge ui={ui} />}
{app.blocked && <Text color="red">Blocked by Computer use</Text>}
<Button key={`${APPS_PREFIX}revoke:${app.bundleId}`} onPress={noop}>Revoke</Button>
</AppRowView>
)
return (
<Box flexDirection="column" gap={1}>
<Box flexDirection="column">
<Text bold>Approved apps</Text>
<Box flexDirection="row" gap={2} alignItems="center">
<Box flexGrow={1}>
<Text dimColor>Computer use can control these apps without asking.</Text>
</Box>
<Button key={`${APPS_PREFIX}refresh`} onPress={noop}>Refresh</Button>
</Box>
</Box>
{state.unavailable ? (
<Text color="yellow">{state.unavailable}</Text>
) : !state.isLoaded ? (
<Text dimColor>Loading...</Text>
) : (
<Box flexDirection="column" gap={1}>
<Box flexDirection="column">
<Text bold dimColor>{`Always allowed (${present.length})`}</Text>
{present.length === 0 && <Text dimColor>None. Allow one below.</Text>}
{present.map(row)}
</Box>
{missing.length > 0 && (
<Box flexDirection="column">
<Text bold dimColor>{`Not installed (${missing.length})`}</Text>
{missing.map(row)}
</Box>
)}
<Box flexDirection="column">
<Text bold dimColor>{`This conversation (${state.session.length})`}</Text>
{state.session.length === 0 && <Text dimColor>None.</Text>}
{state.session.map(app => (
<AppRowView key={app.bundleId} ui={ui} name={app.name} bundleId={app.bundleId}>
{app.risk === 'high' && <RiskBadge ui={ui} />}
<Text dimColor>Ends with this conversation</Text>
</AppRowView>
))}
</Box>
<Input
key={`${APPS_PREFIX}allow:${state.nonce}`}
label="Allow an app"
placeholder="App name, bundle id or path"
submitLabel="allow"
onSubmit={noop}
/>
</Box>
)}
{(state.busy || state.notice) && (
<Text color={state.busy ? undefined : state.notice?.tone === 'error' ? 'red' : 'green'} dimColor={busy}>
{state.busy ?? state.notice?.text}
</Text>
)}
</Box>
)
}adapters/claude-mod/lcu-approve/hooks/views.tsx lines 122–138 · Pane
function AppRowView({ ui, name, bundleId, children }: { ui: any; name: string; bundleId: string; children: any }) {
const { Box, Text } = ui
return (
<Box flexDirection="row" gap={2} alignItems="center">
<Box flexShrink={0}>
<Text bold>{name}</Text>
</Box>
{bundleId !== name && (
<Box flexShrink={1}>
<Text dimColor wrap="truncate-end">{bundleId}</Text>
</Box>
)}
<Box flexGrow={1} />
{children}
</Box>
)
}adapters/claude-mod/lcu-approve/hooks/views.tsx lines 85–119 · Pane
export function ApprovalView({ ui, surface, approval, icon, graphics = true }: { ui: any; surface: string; approval: Approval; icon?: string; graphics?: boolean }) {
const { Box, Text, Button } = ui
const isHigh = approval.riskLevel === 'high'
// A terminal that cannot draw the picture gets no icon cell, so the name starts at the pane's edge.
const shownIcon = surface === 'terminal' && !graphics ? undefined : icon
const key = (choice: string) => `${KEY_PREFIX}${approval.id}:${choice}`
return (
<Box flexDirection="column" gap={1} paddingY={surface === 'terminal' ? 0 : 1}>
<Box flexDirection="row" gap={surface === 'terminal' && !shownIcon ? 0 : 2} alignItems="center">
<Icon ui={ui} surface={surface} name={approval.label} icon={shownIcon} />
<AppTitle ui={ui} name={approval.label} bundleId={approval.app} />
</Box>
<Text>{`Computer use will be able to see and control ${approval.label}.`}</Text>
{isHigh && (
<Box flexDirection="column">
<RiskBadge ui={ui} />
{approval.warning && <Text color="yellow">{plainWarning(approval.warning)}</Text>}
</Box>
)}
<Box flexDirection="row" gap={1}>
<Button key={key('session')} variant="primary" autoFocus hotkey="a" onPress={noop}>
{LABEL_SESSION}
</Button>
{approval.scopes.includes('always') && (
<Button key={key('always')} variant="secondary" hotkey="l" onPress={noop}>
{LABEL_ALWAYS}
</Button>
)}
<Button key={key('deny')} role="dismiss" hotkey="d" onPress={noop}>
{LABEL_DENY}
</Button>
</Box>
</Box>
)
}adapters/claude-mod/lcu-approve/hooks/views.tsx lines 52–67 · Pane
function Icon({ ui, surface, name, icon }: { ui: any; surface: string; name: string; icon?: string }) {
if (surface === 'terminal') {
const { Image } = ui
return icon ? <Image source={{ png: icon }} columns={6} rows={3} alt=" " /> : null
}
const { Svg } = ui
const initial = esc([...name.trim()][0]?.toUpperCase() ?? '?')
const picture = icon
? `<image href="data:image/png;base64,${icon}" xlink:href="data:image/png;base64,${icon}" x="0" y="0" width="48" height="48"/>`
: ''
const source =
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" width="48" height="48">' +
'<rect width="48" height="48" rx="11" fill="#8a8a8a" fill-opacity="0.28"/>' +
`<text x="24" y="32" font-size="22" font-family="sans-serif" text-anchor="middle" fill="#8a8a8a">${initial}</text>${picture}</svg>`
return <Svg source={source} alt={`${name} icon`} width={48} height={48} />
}adapters/claude-mod/lcu-approve/hooks/views.tsx lines 69–77 · Pane
function AppTitle({ ui, name, bundleId }: { ui: any; name: string; bundleId: string }) {
const { Box, Text } = ui
return (
<Box flexDirection="column" flexGrow={1}>
<Text bold>{name}</Text>
{bundleId !== name && <Text dimColor>{bundleId}</Text>}
</Box>
)
}Licence text (MIT)
MIT License Copyright (c) 2026 Amont Labs 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.
This code is an example in the code reference: Pane (panel)
How to build this: Pane (panel), Deny a tool call
What its code calls
runs programsreads filesenv varstool callsrememberscalls tools
What its code shows
Read from the source at commit f32d497c6f70 on 2026-10-11. 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.adapters/claude-mod/lcu-approve/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.3 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, the same in both |
| 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.its repository's .claude-plugin/marketplace.json does not list it: no marketplace line to give; the page shows how to try the commit read |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).adapters/claude-mod/lcu-approve/hooks/register.tsx:263 /usr/bin/mdfind (not on Windows); adapters/claude-mod/lcu-approve/hooks/register.tsx:315 /usr/bin/mktemp (not on Windows); adapters/claude-mod/lcu-approve/hooks/register.tsx:321 /usr/bin/plutil (not on Windows); adapters/claude-mod/lcu-approve/hooks/register.tsx:328 /usr/bin/sips (not on Windows); adapters/claude-mod/lcu-approve/hooks/register.tsx:336 /usr/bin/osascript (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.adapters/claude-mod/lcu-approve/hooks/register.tsx:225 a program named at run time; adapters/claude-mod/lcu-approve/hooks/register.tsx:287 a program named at run time; adapters/claude-mod/lcu-approve/hooks/register.tsx:336 /usr/bin/osascript (a shell or interpreter); adapters/claude-mod/lcu-approve/hooks/register.tsx:406 a program named at run time |
| 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 an MCP server |
| 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).adapters/claude-mod/lcu-approve/hooks/register.tsx:52 an MCP tool named at run time; adapters/claude-mod/lcu-approve/hooks/register.tsx:422 an MCP tool named at run time |
| 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 ? |
| 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: classic.UserPromptSubmit, command.run, tool.call, tool.check · reads: classic.Elicitation, ui.press, ui.input, classic.SessionStart · also: ui.render (Pane), ui.close, session.start · timers: clock.after |
| 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: TMUX, KITTY_WINDOW_ID, GHOSTTY_RESOURCES_DIR, TERM, TERM_PROGRAM (+2); files: its own folder/…, a path computed at run time, …/icon.png |
| 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.writes no files, environment variables, settings or conversation rows |
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.
Its repository's .claude-plugin/marketplace.json does not list it, so there is no marketplace line to give.
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/amontlabs/lcugit -C lcu checkout f32d497c6f703b516f8fdc61721266835864a207claude plugin validate lcu/adapters/claude-mod/lcu-approveclaude --plugin-dir lcu/adapters/claude-mod/lcu-approveThe 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 about it
With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:
Read the ModsCode mod "amontlabs-lcu-approve" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- usage-meterMichael Goldenberg★ 6
- desktop-break-bellYash Thakker★ 3
- desktop-cost-watchYash Thakker★ 3
- hopAGI Hunt★ 2
- cockpitSyed Muhammad Hassaan★ 1
- file-explorerIT-BAER★ 1
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/amontlabs-lcu-approve/)