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
Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.
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/gallery/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.
What its code calls
runs programswrites filesdrives Claudetool calls
The design, read from code
Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.
What its code shows
Read from the source at commit 609ff7a2be08 on 2026-10-06. 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 install line to give |
| 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 files or environment variables and reaches the network.reads 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 |
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 the code below (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 install line to give. Read it as code, or follow its author's README.
Ask Claude about it
With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:
Read the modscode design "davekiss-env" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Ask Claude…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts
-
Ask Claude…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel
-
What it does
- Draws a pane, a band above the prompt
- Adds /lingo
- Hooks prompt.edit, prompt.submit, session.start
- Keeps its own state between turns
-
Ask Claude…GitHub inboxGitHubloading…Refresh rbuildbuildbuildClose xStealth IssuesNo open issues in this view.#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopen#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopen#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopenPull requestsNo open pull requests.#3 Fix login · main · draft · build · HiddenChecksReviewopen#3 Fix login · main · draft · build · HiddenChecksReviewopen#3 Fix login · main · draft · build · HiddenChecksReviewopenChecks for #3Plain
-
Ask Claude…ReviewPR #3 Fix loginbranche couranteà traiter ▸3 ▸3 ▸3 · en relecture ▸3 ▸3 ▸3▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review────────fil 31/3 Review ↗ GitHub
Review@alexReview@alexReview@alexReviewRéponse : Review publierEntrée publie · Esc annule la réponse · les touches n, p… tapent dans le champ… ReviewLe panneau n'a pas le clavier : ctrl+x tab ou un clic, et les touches marchent.p préc. n suiv. t PR suiv. x démarquer a tout démarquer f corriger (3) r répondre v résoudre o web q fermer