HOW-TO GUIDE
How to keep Cursor, Claude Code, and Copilot from reading your .env files
Based on a guide by Mathias Andersen on DEV Community · Nov 29, 2026
You'll end with: A repo where eight ignore and permission files keep .env secrets out of Git and out of each AI coding assistant's reads and context.
Why it's worth having: .gitignore only controls Git, so an assistant inside your editor can still read .env files from disk and sweep keys into cloud prompts.
At a glance
WHO IT'S FOR
IT and OT engineers and developers who keep API keys and database URLs in .env files.
COST
Free. Every layer is a plain config file you write yourself.
YOU NEED
A repo with .env files · Your AI coding assistant's settings files
The method, in short
- 1Keep .env and .env.* in .gitignore, and cover .env* in .cursorignore, .windsurfignore, and .aiexclude.
- 2In .claude/settings.json, add permissions.deny rules for Read(./.env) and Read(./.env.*), and list both in .claudeignore.
- 3In .vscode/settings.json, map .env* files to dotenv and turn GitHub Copilot off for dotenv.
- 4Tell Copilot agents in .github/copilot-instructions.md never to read, grep, or echo .env files, and keep .env closed on screen shares.
Read the full guide from Mathias Andersen on DEV Community
The post lists all eight files, the exact rule for each assistant, and the screen-share risk.
More from The Feed
HOW-TO GUIDE
You'll end with: A recurring job that ran right once in chat, was saved and retested as a skill, and only then became a scheduled or event-driven routine.
WHO IT'S FOR
Plant managers, operations leads, and engineers who want bots to run recurring reports and checks.
COST
Free to read. The method runs in Grok Bot on your own plan.
YOU NEED
Grok Bot · One recurring task with clear steps · Safe test inputs
Read the full guide from @Metraxis_inc on X
Based on a post by Metraxis (@Metraxis_inc) on X · Nov 29, 2026
HOW-TO GUIDE
You'll end with: A token count for your own backlog: the MCP tool list, a Jira issue's JSON, and the same ticket as a markdown file with YAML front matter.
WHO IT'S FOR
Engineering, project controls, and IT teams who track work in Jira and use AI coding agents.
COST
Free. The checks use curl, a free token counter from npm, and your own Jira data.
YOU NEED
curl · Node.js · gpt-tokenizer · A Jira project · An AI coding agent
Read the full guide from Weiwen Weng on DEV Community
Based on a guide by Weiwen Weng on DEV Community · Nov 27, 2026
HOW-TO GUIDE
You'll end with: A PreToolUse guard hook that blocks with exit 2, sends its reason to Claude, and fails closed when it crashes.
WHO IT'S FOR
IT and OT engineers and developers who rely on Claude Code hooks as safety guards.
COST
Free. The hooks are bash or Python scripts that run in Claude Code.
YOU NEED
Claude Code · A PreToolUse hook in .claude/settings.json · bash or Python · jq
Read the full guide from jidonglab on DEV Community
Based on a guide by jidonglab on DEV Community · Nov 29, 2026