AI-Assisted Coding
Back to Advanced Workflows

Custom Instructions & Memory

Persistent context: CLAUDE.md, .cursorrules, system prompts. Make AI always follow your project's conventions. FIND_VIDEO: search 'claude code CLAUDE.md cursorrules custom instructions' — recommended channel: Anthropic / Cursor. Aim for 10 min or under.

15 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Implementing Global Instructions — Create a root agents.md file to enforce baseline type hints across the project.
  2. Defining Multiple Global Rules — Add secondary rules like camelCase naming to demonstrate multi-rule agent compliance.
  3. Hierarchical Context and Overrides — Configure localized subdirectory instruction files that override root rules via relative links.
  4. Structured CLI and Environment — Structure instruction files with environment versions, package manager prefixes, and command examples.
PDF notes

Frequently asked questions

Why should CLI command prefixes like 'uv run' appear early in agents.md?

Placing execution rules near the top ensures the agent prioritizes environment constraints, preventing broken commands like direct Django migrations.

How does an AI agent handle conflicting instructions between root and local files?

The subdirectory `agents.md` takes precedence within its directory tree while inheriting non-conflicting root rules through relative links.

What is the primary advantage of agents.md over .cursorrules?

`agents.md` is an open, vendor-agnostic Markdown standard that works across multiple AI coding agents and development environments.

Do I need to rewrite all global rules inside subdirectory agents.md files?

No, link to the root file using `../agents.md` and only define the specific rules you wish to override.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.