ModsCode / Claude Code Mods / Ranking / env
env
Edit .env files in a pane inside Claude Code. Claude manages keys and asks you for values without ever seeing them.
What it does
- Draws a band above the prompt, a pane, toasts
- Adds /env
- Watches mcp__env__list, mcp__env__request, mcp__env__generate, mcp__env__copy calls and can refuse them
- Hooks session.append, session.send, session.start, ui.close
- 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 env by Dave Kiss (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/davekiss-env/
// 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 band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Markdown, Button, Input } = $.ui.resolve(e)
const key = '…'
const file = '…'
const reason = '…'
const i = '…'
const step = '…'
const i2 = '…'
const step2 = '…'
const i3 = '…'
const step3 = '…'
const url = '…'
const format = '…'
return (
<Box flexDirection="column" borderStyle="round" borderColor="yellow" paddingX={1} marginBottom={1}>
<Text bold color="yellow">
Claude needs a value
</Text>
<Box gap={1} marginTop={1}>
<Text bold>
{key}
</Text>
<Text dimColor>
{"→ "}
{file}
</Text>
</Box>
<Text wrap="wrap">
{reason}
</Text>
<Box flexDirection="column" marginTop={1}>
<Box gap={1}>
<Text bold color="yellow">
{i}
.
</Text>
<Text wrap="wrap">
{step}
</Text>
</Box>
<Box gap={1}>
<Text bold color="yellow">
{i2}
.
</Text>
<Text wrap="wrap">
{step2}
</Text>
</Box>
<Box gap={1}>
<Text bold color="yellow">
{i3}
.
</Text>
<Text wrap="wrap">
{step3}
</Text>
</Box>
</Box>
<Box gap={1} marginTop={1}>
<Markdown text={`[${url}](${url})`} />
<Button label="copy link" plain dimColor />
</Box>
<Text dimColor>
{"Looks like: "}
{format}
</Text>
<Box marginTop={1}>
<Input label="Paste ▸ " placeholder={`${key}, then Enter`} submitLabel="save" autoFocus />
</Box>
<Text color="green">
✓ looks right
</Text>
<Text color="red">
{"✗ doesn't look like "}
the expected format
; Enter still saves
</Text>
<Box gap={1} marginTop={1}>
<Button label="skip for now" plain dimColor />
<Button label="open /env pane" plain dimColor />
</Box>
<Text dimColor>
Click the field or press ctrl+x tab to paste.
</Text>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "env" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Button, Text, Input } = $.ui.resolve(e)
const name = '…'
const file = '…'
const note = '…'
const key = '…'
const template = '…'
return (
<Box flexDirection="column">
<Box gap={1} flexWrap="wrap" marginBottom={1}>
<Button label={`${name}`} variant="primary" />
<Button label={`${name}`} variant="primary" />
<Button label={`${name}`} variant="primary" />
<Button label="+ .env.local" plain dimColor />
</Box>
<Text color="red">
{file}
{" is not in .gitignore"}
</Text>
<Text dimColor>
{note}
</Text>
<Text dimColor>
No .env files in the project root yet.
</Text>
<Box flexDirection="column" marginBottom={1}>
<Input label={`${key} = `} placeholder="paste the value, Enter saves" submitLabel="save" autoFocus />
<Box gap={1}>
<Button label="generate random" />
<Button label="cancel" />
</Box>
</Box>
<Input label="New key: " placeholder="NAME, Enter to continue" autoFocus />
<Box flexDirection="column" marginTop={1}>
<Text dimColor>
{"Missing compared with "}
{template}
:
</Text>
<Box gap={1} flexWrap="wrap">
<Button label={`${key}`} plain dimColor />
<Button label={`${key}`} plain dimColor />
<Button label={`${key}`} plain dimColor />
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const key = '…'
await $.ui.toast(`Claude needs ${key}: paste it above the prompt`)
await $.ui.toast(`Claude needs ${key}`)
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.
hooks/register.tsx lines 736–746 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.surface !== 'terminal' && e.surface !== 'desktop') return next(e)
if (e.props.hasSurvey || !(await read($, isWaiting))) return next(e)
const asked = await read($, request)
if (!asked) return next(e)
// isWaiting trails the surface by up to a poll; ask the surface itself
// so the card leaves the moment the pane is placed
const pane = (await $.ui.panes()).find(p => p.id === PANE)
if (!pane || pane.isPlaced) return next(e)
return requestCard($, $.ui.resolve(e), asked, 'band')
})hooks/register.tsx lines 161–233 · Band
async function requestCard($: Engine, ui: ElementTable<'terminal' | 'desktop'>, asked: EnvRequest, where: 'pane' | 'band') {
const { Box, Text, Button, Input, Markdown } = ui
const pasted = await read($, fit)
return (
<Box flexDirection="column" borderStyle="round" borderColor="yellow" paddingX={1} marginBottom={where === 'pane' ? 1 : 0}>
<Text bold color="yellow">
Claude needs a value
</Text>
<Box gap={1} marginTop={1}>
<Text bold>{asked.key}</Text>
<Text dimColor>→ {asked.file}</Text>
</Box>
{asked.reason !== '' && <Text wrap="wrap">{asked.reason}</Text>}
{asked.steps.length > 0 && (
<Box flexDirection="column" marginTop={1}>
{asked.steps.map((step, i) => (
<Box key={`step:${i}`} gap={1}>
<Text bold color="yellow">
{String(i + 1)}.
</Text>
<Text wrap="wrap">{step}</Text>
</Box>
))}
</Box>
)}
{asked.url && (
<Box gap={1} marginTop={1}>
<Markdown text={`[${asked.url}](${asked.url})`} />
<Button
key="copy-url"
label="copy link"
plain
dimColor
onPress={press => void $.ui.copy({ text: asked.url ?? '', surface: press.surface })}
/>
</Box>
)}
{asked.format && <Text dimColor>Looks like: {asked.format}</Text>}
<Box marginTop={1}>
<Input
key="request"
label="Paste ▸ "
placeholder={`${asked.key}, then Enter`}
submitLabel="save"
autoFocus
onInput={value => void update($, fit, () => fitOf(value, asked.pattern))}
onSubmit={value => void store($, asked.file, asked.key, value.trim())}
/>
</Box>
{pasted === 'ok' && <Text color="green">✓ looks right</Text>}
{pasted === 'off' && <Text color="red">✗ doesn't look like {asked.format ?? 'the expected format'}; Enter still saves</Text>}
<Box gap={1} marginTop={1}>
<Button key="skip" label="skip for now" plain dimColor onPress={() => void abandon($, 'skipped')} />
{where === 'band' && (
<Button
key="open-pane"
label="open /env pane"
plain
dimColor
onPress={async () => {
const opened = await $.ui.open({ id: PANE, title: 'env', focus: true })
await update($, isWaiting, () => !opened.isPlaced)
}}
/>
)}
</Box>
{where === 'band' && <Text dimColor>Click the field or press ctrl+x tab to paste.</Text>}
</Box>
)
}hooks/register.tsx lines 748–899 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
if (e.surface !== 'terminal' && e.surface !== 'desktop') {
const { Text } = $.ui.resolve(e)
return <Text>Open a terminal or the desktop app to edit env files.</Text>
}
const ui = $.ui.resolve(e)
const { Box, Text, Button, Input } = ui
await read($, rev)
const names = await read($, files)
const file = await read($, active)
const edit = await read($, editing)
const shown = await read($, revealed)
const asked = await read($, request)
const pending = await read($, confirm)
const note = await read($, flash)
const lines = file ? await load($, file) : []
const list = env.entries(lines)
const template = names.find(env.isTemplate)
const isTemplate = env.isTemplate(file)
const missing =
template && !isTemplate
? env.entries(await load($, template)).map(entry => entry.key).filter(key => !list.some(entry => entry.key === key))
: []
const isUnignored = file !== '' && !isTemplate && !(await isIgnored($, file))
const keyWidth = Math.min(32, Math.max(8, ...list.map(entry => entry.key.length)) + 2)
const say = (text: string | null) => update($, flash, () => text)
const card = asked && (await requestCard($, ui, asked, 'pane'))
const valueEditor = (key: string) => (
<Box flexDirection="column" marginBottom={1}>
<Input
key="value"
label={`${key} = `}
placeholder="paste the value, Enter saves"
submitLabel="save"
autoFocus
onSubmit={value => void store($, file, key, value)}
/>
<Box gap={1}>
<Button key="gen" label="generate random" onPress={() => void store($, file, key, env.randomSecret(32, 'base64url'))} />
<Button key="cancel" label="cancel" onPress={() => void update($, editing, () => null)} />
</Box>
</Box>
)
const row = (entry: env.Entry) => {
const k = entry.key
if (edit && edit.file === file && edit.key === k) return valueEditor(k)
const isShown = shown === `${file}:${k}`
return (
<Box key={`row:${k}`} gap={1}>
<Box width={keyWidth} flexShrink={0}>
<Text bold wrap="truncate">{k}</Text>
</Box>
<Box flexGrow={1}>
<Text dimColor={!isShown} wrap="truncate">{isShown ? entry.value || '(empty)' : env.shape(entry.value, true)}</Text>
</Box>
<Button
key={`copy:${k}`}
label="copy"
plain
onPress={async press => {
const { isCopied } = await $.ui.copy({ text: entry.value, surface: press.surface })
await say(isCopied ? `Copied ${k}` : `Could not copy ${k}`)
}}
/>
<Button key={`edit:${k}`} label="edit" plain onPress={() => void update($, editing, () => ({ file, key: k }))} />
<Button
key={`show:${k}`}
label={isShown ? 'hide' : 'show'}
plain
onPress={() => void update($, revealed, now => (now === `${file}:${k}` ? null : `${file}:${k}`))}
/>
{pending === `${file}:${k}` ? (
<Button
key={`really:${k}`}
label="really delete?"
variant="primary"
onPress={async () => {
await save($, file, env.remove(await load($, file), k))
await update($, confirm, () => null)
await say(`Deleted ${k} from ${file}`)
}}
/>
) : (
<Button key={`del:${k}`} label="del" plain dimColor onPress={() => void update($, confirm, () => `${file}:${k}`)} />
)}
</Box>
)
}
const isNewKey = edit !== null && edit.file === file && edit.key !== null && !list.some(entry => entry.key === edit.key)
return (
<Box flexDirection="column">
{card}
<Box gap={1} flexWrap="wrap" marginBottom={1}>
{names.map(name => (
<Button
key={`file:${name}`}
label={name}
variant={name === file ? 'primary' : undefined}
dimColor={name !== file}
onPress={() => void update($, active, () => name)}
/>
))}
{!names.includes('.env.local') && (
<Button key="create" label="+ .env.local" plain dimColor onPress={() => void save($, '.env.local', [])} />
)}
</Box>
{isUnignored && <Text color="red">{file} is not in .gitignore</Text>}
{note && <Text dimColor>{note}</Text>}
{names.length === 0 && <Text dimColor>No .env files in the project root yet.</Text>}
{list.map(row)}
{isNewKey && edit?.key && valueEditor(edit.key)}
{edit && edit.file === file && edit.key === null ? (
<Input
key="name"
label="New key: "
placeholder="NAME, Enter to continue"
autoFocus
onSubmit={name => {
const key = name.trim()
if (KEY_NAME.test(key)) void update($, editing, () => ({ file, key }))
else void say(`"${key}" is not a valid key name`)
}}
/>
) : (
file !== '' && <Button key="add" label="+ add key" plain onPress={() => void update($, editing, () => ({ file, key: null }))} />
)}
{missing.length > 0 && (
<Box flexDirection="column" marginTop={1}>
<Text dimColor>Missing compared with {template}:</Text>
<Box gap={1} flexWrap="wrap">
{missing.map(key => (
<Button key={`fill:${key}`} label={key} plain dimColor onPress={() => void update($, editing, () => ({ file, key }))} />
))}
</Box>
</Box>
)}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Dave Kiss 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 programswrites filesdrives Claudetool calls
What its code shows
Read from the source at commit 609ff7a2be08 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.hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.6 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).hooks/register.tsx:731 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.git (reaches the network), mktemp, rm |
| 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.prompt.submit (as the person), adds command env, adds tool list, adds tool request, adds tool generate, adds tool copy, adds tool remove, adds tool push, adds tool pull |
| 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 (env), tool.call (mcp__env__list, mcp__env__request, mcp__env__generate (+4)), session.append · also: session.start, ui.close, session.send, ui.render (AbovePrompt, Pane) · timers: 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: a name computed at run time; files: a path computed at run time, .gitignore |
| 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.files: a path computed at run time; env: a name computed at run time; 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.
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/davekiss/envgit -C env checkout 609ff7a2be08c880e3a47e3edaface8a7aa95362claude plugin validate envclaude --plugin-dir envThe 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 "davekiss-env" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- glossary-browserFabrizio Duroni★ 5
- claudelingoKeisuke Yoda★ 2
- pr-commentsaguiddir★ 2
- sc-workspaceSimpleCORE★ 2
- a2a-modAliasgar Khimani★ 1
- gh-inboxmako-code★ 1
More by Dave Kiss
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/davekiss-env/)