Urgent.News

the world's headlines, one feed

Editions

Tech

Five files that go in before the agent writes a line

You open an empty folder, type "build me an app", and for about two days it's magic. Then week two arrives. The agent drops a database call straight into a component, because nothing ever told it not to. A folder you needed gets renamed. Somewhere in there it explains, with total confidence, a decision you never made. You start every session re-explaining the same things, and each explanation…

To prepare for a new coding project, there are five essential files that an agent should have before writing any lines of code.

First is the CLAUDE.md file, which serves as the agent's working memory for every session. This file should contain information about who you are and how to communicate with you, a map of where things are located in the project, and decisions with their reasons. It should also include what not to touch, so that the agent understands which parts of the project should remain unchanged.

The second file is .claude/settings.json, which contains rules that are not open to discussion. These rules should be written in prose and used for judgement, like naming conventions or stopping criteria. The deny list should be used for irreversible actions such as deleting sensitive files or resetting databases.

Next is the .env.example file, which outlines variable names and empty values. This file should not contain any actual values, as the agent only needs to know which variables exist. It's important to use the correct file name and format, as the agent will compile any prefixed NEXT_PUBLIC_ or VITE_ variables into the page at build time.

The fourth file is .gitignore, which should be added before the first commit. This file helps prevent sensitive information from being committed to the project's history, such as API keys or passwords. It's crucial to use the correct syntax for the file, as changes in the .gitignore file cannot be undone and may affect future commits.

Finally, the fifth file is .pre-commit-config.yaml, which runs a scanner before every commit. This file should be added to the repository once, after initializing the project with git init. The scanner helps prevent the introduction of security issues, such as leaked credentials or malicious code. It's essential to use a realistic key for testing the scanner, as using a fake key may result in false positives or false negatives.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.

Read the original at dev.to →

More in Tech