Free & open · no paywall, ever

IntegrAuth Academy

Identity, security and practical AI — free, from zero. Byte-sized lessons, real diagrams, hands-on labs, zero fluff. Two programs, each with its own exam and certificate.

20 tracks 241 lessons 242 hands-on labs 230+ diagrams 100% free

English is hard? Your browser can translate this page into Tamil, Telugu, Kannada, Malayalam or Hindi. Tech words stay in English so you learn the real names.

How?
  • Chrome on phone: ⋮ menu → Translate
  • Chrome on computer: right-click → Translate to …
  • Edge: the translate icon in the address bar
Practical AI Track 4 · Coding with AI
0/75 lessons read
CODING WITH AI · LESSON 2

Give it the right context

Priya's agent keeps using npm. Her project uses pnpm. Both install code packages. Your goal: give the agent what it can't guess, and nothing more.

🧪 Interactive lab — enable JavaScript to play with this one.

~/ personal fileyour preferences, every projectrepo/AGENTS.mdteam rules for the whole projectrepo/web/AGENTS.mdweb-only rulesrepo/db/AGENTS.mddatabase-only rulesContext windowtask: fix the checkout button in web/✓ personal preferences✓ project rules✓ web rules (added on top)+ your request, files it readsnot loaded:task never touches db/
Figure — Load what the task needs. Broad files load for every task. A folder's file joins only for work in that folder. Tools vary.
Key points
  • The agent sees only the text in its context window.
  • The instruction file loads in every session. Keep it short.
  • Write only what the agent can't guess, like commands and traps.
  • For a task, point at the exact file or error.
  • New task? New session.

What goes in the file

You met the instruction file in Context and memory. Common names are AGENTS.md and CLAUDE.md. Every line costs space. The agent forgets everything between sessions, like a new helper each morning. This file is the note on the door.

✅ Put it in❌ Leave it out
Commands it can't guess, like pnpm testWhat it can learn from the code
Style rules that differ from the usual onesRules a formatter already fixes
Traps, like files the build overwritesLong docs. Write a pointer to them instead.
Hard-won rules, like "never edit an old migration" (a saved database change)Things that change each week, and pep talk

Test each line: would removing it cause a mistake? If not, cut it. Add a line when the agent repeats a mistake.

Point, don't paste

For a task, point at a file to copy, the full error or a screenshot. Don't paste half the project.

Which files load for each task? Predict, then check.

🧪 Interactive lab — enable JavaScript to play with this one.

Go deeper: a starter file

A good file answers four questions in a few lines each:

  • What is this? The purpose, the language and where things live.
  • Which commands? How to build, test and check the format.
  • What are the rules? "Never delete or skip a test to make it pass." "Ask before you change anything outside the task."
  • What are the traps? What a newcomer always gets wrong here.

Skip lines like "write excellent code". They cost space and change nothing. Never put a key or password in the file. It is sent to the model in every session.

Go deeper: levels of instruction files

Most tools stack several files, from broad to narrow:

  • Personal: your own preferences, for every project. It is not shared.
  • Project: team rules at the top of the project. It is saved in git, so every teammate's agent gets it.
  • Folder: rules for one part, like web/. Some tools load it when the agent works there. Others load it only if you start the tool in that folder.
  • File pattern: a rule for certain files, like all test files. This is a path-scoped rule.

"Keep answers short" goes in your personal file, not the team's. Files at different levels are usually combined. Some tools give the nearer file more weight. If two files disagree, the model may follow either one. So keep them consistent.

As of October 2026, GitHub Copilot, Codex, Cursor and Google's Antigravity CLI read AGENTS.md. Claude Code reads it when a project has no CLAUDE.md. One shared file saves copying.

Go deeper: keep the file short

A longer file is often followed less well. The rule that matters gets lost among the rest. As of October 2026, Claude Code's docs suggest under 200 lines per file. Several tools can write a first draft for you, for example with /init. Treat the draft as something to cut down.

The file is advice, not a lock. The model usually follows it. Some rules must hold every time, like "never edit .env". For those, use a hook (Extend your assistant).

Priya's first file was 180 lines. The agent still used npm. She cut it to 22 lines. The web rules moved to web/AGENTS.md. Then the agent made one new mistake. She added one line, and the mistake stopped.

Go deeper: one task, one session

Every file the agent reads and every command's output piles up in the chat. Models often get less reliable as the context fills up (tokens and context windows).

  • New task, new session. Clear the chat between unrelated tasks, for example with /clear or /new.
  • Corrected it twice? Restart. The chat is now full of failed tries. Start fresh with a better first prompt that says what you learned.
  • Shrink on purpose. Compaction sums up the chat to free space. Summaries lose detail. So say what to keep, and save key facts in a file.
  • Send big searches to a helper. A subagent searches in its own context and sends back a short summary (agents and subagents).

For work over several days, write the state in a notes file. A fresh session can pick up from there.

Watch out

A downloaded project's instruction file loads like your own. It could tell the agent to run a script or send data away (prompt injection). Read it, and anything it tells the agent to run, before you start. Many tools ask if you trust a new folder. Yes means its files and settings load.

🧪 Try it free

Write or trim your AGENTS.md. See the format at agents.md. Aim for under 30 lines. Add a line when a mistake repeats.