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.
LEVEL
Beginner
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

  1. 1Keep .env and .env.* in .gitignore, and cover .env* in .cursorignore, .windsurfignore, and .aiexclude.
  2. 2In .claude/settings.json, add permissions.deny rules for Read(./.env) and Read(./.env.*), and list both in .claudeignore.
  3. 3In .vscode/settings.json, map .env* files to dotenv and turn GitHub Copilot off for dotenv.
  4. 4Tell Copilot agents in .github/copilot-instructions.md never to read, grep, or echo .env files, and keep .env closed on screen shares.

The post lists all eight files, the exact rule for each assistant, and the screen-share risk.

More from The Feed

HOW-TO GUIDE

How to turn one Grok Bot task into a tested skill, then a routine

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.
LEVEL
Beginner
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

Based on a post by Metraxis (@Metraxis_inc) on X · Nov 29, 2026

HOW-TO GUIDE

How to compare a Jira MCP's token cost with markdown tickets in Git

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.
LEVEL
Intermediate
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

Based on a guide by Weiwen Weng on DEV Community · Nov 27, 2026

HOW-TO GUIDE

How to make a Claude Code hook actually block a command with exit 2

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.
LEVEL
Intermediate
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

Based on a guide by jidonglab on DEV Community · Nov 29, 2026