The first module of the Mars mentor course. Not about chatting with AI — it's about agentic coding tool: Claude Code in the terminal, MarsCode (our fork), and why one markdown file in a project changes everything.
You open ChatGPT. Copy a function. “Fix this bug.” You get code. Paste it into the editor. It doesn't work. Copy the error back. You do this five times. The context lives in your head, not with the model.
In your project folder, you write claude. The agent itself reads 7 files, finds the bug, fixes it, and runs tests. You look at the diff and say “merge.”
These are different categories. Chat is a conversational partner. An agent is an executor with tools. And an executor must have a contract. This contract is called CLAUDE.md.
In this module, you'll learn what an agentic coding tool is, how it differs from chat, and how to write your first CLAUDE.md (at the user level and in a Mars project) to stop explaining to the agent who you are and who you're writing code for every session.
/memory, that the necessary CLAUDE.md files have indeed loaded.~/.claude/CLAUDE.md (about you as a mentor) and ./CLAUDE.md in one training repo (about this group).AGENTS.md and CLAUDE.md and decide when to use which (or both via @AGENTS.md-import).Anthropic defines it in one phrase:
The main difference from chat is loop of tool calls, not a single reply. You write the task. The model decides: "First, I'll read the file." It calls the Read tool. It gets the content. It thinks further. It decides: "Now I'll edit." It calls Edit. Then Bash for tests. And so on until the task is closed or it hits a question for you.
Each downward arrow is a new model call. For large tasks, there are dozens. You see this as a translucent stream in the TUI: Reading src/auth.py, Editing tests/test_login.py, Running pytest.
Claude Code isn't tied to one window. It's the same configuration (CLAUDE.md, settings, MCP) across multiple surfaces. You choose based on the task, not habit.
Mars maintains its own agent — MarsCode, fork of sst/opencode. It's an OpenAI-compatible API that routes through Mars Token Factory — our LLM-proxy with a Mars coins wallet. Why a fork: an Anthropic-only stack is expensive for mass rollout to students, MarsCode routes to cheaper models via Token Factory. We provide mentors with a balance.
In the MVP course, we teach on Claude Code (baseline, Anthropic documentation covers 100%). MarsCode is mentioned now, with a switch in Module 5 (when we build our own Skills and want to save money).
Codex (OpenAI), Antigravity (Google) — parallels of the same category. We don't teach them in the course, but mentors should hear the names. If a student asks "what about Codex" — it's the same tool use loop, different vendor.
Case: mentor Zukhra, Yunusobod location, Python group 7-9 years old, 6 children. She opens Claude Code in a repo with starter projects. She asks for the same thing. First without a contract, then with one.
$ cd ~/mars-lessons/python-7-9 && claude# agent starts from a blank slate > help me add another game about math for my students Claude: I'm ready to help. A couple of questions to understand the context: 1. What is the age of the students? 2. In what language are the explanations in the comments? 3. Which libraries are allowed? 4. How detailed should the comments be? 5. Is OOP or procedural style allowed? # 3 minutes of ping-pong in each session.
$ cd ~/mars-lessons/python-7-9 && claude# agent reads ./CLAUDE.md automatically > help me add another game about math for my students Claude: I'll make a starter "Guess the Number" in the project style: • pygame + random, no f-strings • variables in Russian-Latin script • a comment for every 2 lines • a short header "What this program does" I read 01-circle.py for style. Creating 06-guess-number.py. Edit: 06-guess-number.py (+38) Bash: python3 -m py_compile ✓ # 40 seconds until result.
Here's the file that's in Zukhra's repo. Copy it as a starter — it's one of three ready-made pre-build templates:
./CLAUDE.md · mars-lessons/python-7-9# Mars IT School — Python for group 7-9 years old # Yunusobod branch, mentor Zukhra ## Who reads this code - Children 7-9 years old, four of them seeing programming for the first time. - Language of explanation: Russian. Uzbek Latin script is allowed in variable names if it helps (`tugma` instead of `button`). - Terminology: do not use "function", "class", "loop" without explanation through an everyday analogy in a comment. ## Code Conventions - **Every line is commented in Russian.** This is not production code, this is code for a lesson. - Variable names — simple words or transliteration (`schyot`, not `score_counter`). - Only `pygame` and `random`. Do not use f-strings, list comprehensions, dataclasses. - The file always starts with a short comment "What this program does" in 1 line. ## Workflow - Each file must be run via `python3 file.py` without arguments. - Before commit — `python3 -m py_compile file.py` (syntax check). - Do not edit `.solutions/` — it contains ready solutions for subsequent groups.
The same template "who reads / conventions / workflow" — but a different audience. Timur, Chilonzor branch, second year Python, preparing Olympiad participants 12-14. Compare with Zukhra's:
./CLAUDE.md · mars-lessons/python-olymp-12-14# Mars IT School — Python Olympiad for group 12-14 # Chilonzor branch, mentor Timur ## Who reads this code - Children 12-14, second year Python, preparing for the Republican Olympiad in Informatics. - Language of explanation: Russian. Variable names — English (Olympiad is in English, no point in teaching otherwise). - Know: functions, loops, dictionaries, generators. DO NOT know: classes, dataclasses, async. ## Code Conventions - Full typing: `def solve(n: int) -> list[int]:` — we teach how to read signatures. - Complex algorithms — must have `doctest` or `assert` with an example from the problem statement. - The solution must pass tests in `./tests/` (`pytest`). - Each file starts with a docstring: problem, constraints, time/memory complexity. - DO NOT use third-party libraries except `math`, `collections`, `itertools`, `heapq`, `bisect` — Olympiad set. ## Workflow - Before commit — `pytest -q` (all green). - Solutions in `./solutions/`, tests in `./tests/`.
Zukhra's — a ban on typing and list comprehensions, Timur's — mandatory typing. One template, two different contracts. The third template — Shahzod, Sergeli, React/TypeScript 15-17 — is located nearby in the file starters.md. Take one as an example and adapt it to your group.
CLAUDE.md lives in several places. Each level has its own scope. They are loaded in order "from broad to narrow" and concatenated into the context. A narrower scope supplements the previous one, and in case of conflict, it usually wins — because it appears last in the context and the model sees it as more current.
/Library/Application Support/ClaudeCode/CLAUDE.md (macOS), /etc/claude-code/CLAUDE.md (Linux). Set by IT/DevOps. Applies to everyone. For Mars MVP — empty, nothing here yet.~/.claude/CLAUDE.md · your personal preferences for all projects. Working language, how you like the agent to talk to you, what you do most often../CLAUDE.md or ./.claude/CLAUDE.md · team agreement. Stored in git. Children's age, stack conventions, library prohibitions. Most important for the mentor../CLAUDE.local.md · personal notes for a specific project. In .gitignore. Sandbox-URL, test data, personal reminders.~/.claude/CLAUDE.md it says "reply in English." In the ./CLAUDE.md project, it says "reply in Russian, explaining to children." Project is closer → Russian usually wins — it's the last in the context. Anthropic honestly warns: with conflicting instructions, Claude may choose arbitrarily; there's no guarantee of strict compliance. If it's important, write non-conflicting rules.
CLAUDE.md can include other files using the @path syntax. The recursion depth is up to 4 levels. This is handy when you need to pull in a README, package.json, conventions from another repo, or personal preferences from home.
./CLAUDE.md · fragment# Project overview See @README.md for context and @package.json for npm scripts. # Git workflow - follow @docs/git-instructions.md - my personal preferences: @~/.claude/my-mars-preferences.md
Claude Code reads CLAUDE.md, not AGENTS.md. But AGENTS.md is a format for various AI agents (as of 2026 — Cursor, opencode, MarsCode, etc., needs re-verification): one file can configure multiple tools. If there's already an AGENTS.md in the repo, we create a thin CLAUDE.md on top via import:
./CLAUDE.md · on top of AGENTS.md@AGENTS.md ## Claude-specific - Use plan mode for changes under `src/billing/`.
Then Claude reads AGENTS.md as part of its contract and adds its own nuances. For Mars: while the MarsCode-fork is in active development — write AGENTS.md and make CLAUDE.md → @AGENTS.md, so both tools look at the same file.
An alternative is a symlink (ln -s AGENTS.md CLAUDE.md). It works, but on Windows, it requires Developer Mode. Import is more reliable.
Additionally, the agent keeps its own notes in ~/.claude/projects/<project>/memory/MEMORY.md. Build commands, debug insights, patterns it noticed while working with you. The first 200 lines (or 25KB) are loaded automatically each session.
This is a supplement, not a replacement for CLAUDE.md. CLAUDE.md is what you want the agent to always know. Auto memory is what it itself learned during its work and decided to remember. The command /memory shows both and allows you to open them for editing.
Four parts. Do it manually in the terminal, don't just read it as theory. After this, you'll have a working user+project CLAUDE.md pair and a verified /memory.
On Mac/Linux: curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell: irm https://claude.ai/install.ps1 | iex. To check: claude --version. The first launch will ask for a login.
Create a file, copy the template below, and customize it. This is what Claude knows about you in any project.
~/.claude/CLAUDE.md# About me I am a mentor at Mars IT School, point <X>, I teach <stack> for ages <Y>. Working language: Russian. English for technical terms. # Agent interaction style - Explain the plan to me before editing files (use plan mode when appropriate) - If you're unsure about an API/library — ask, don't invent - When writing code that will go to children — short lines, simple names, comments in Russian - Always show git diff before committing, don't commit yourself # What I usually do - Prepare starter projects for classes - Check students' code - Write internal scripts for Mars~ 10 min
Choose one educational repo. Take one of the three ready-made templates in starters.md (Zukhra-Python-7-9, Timur-Python-Olympus-12-14, Shakhzod-React-15-17) as an example — copy-paste and adapt it to your group. Minimum three sections: “who reads this code”, “conventions”, “workflow”. Size — up to 200 lines, otherwise adequacy decreases.
Alternatively — the command /init in the repo: Claude Code will go through the code itself and generate an initial CLAUDE.md (and if the repo already has AGENTS.md — it will take its content into account).
Run claude in the same folder. In the session, type /memory — you should see both files in the list. If the user file didn't appear — check the path (it's exactly ~/.claude/CLAUDE.md, not ~/.claude/Claude.md).
Give a simple request: “add a greeting function”. Make sure the agent writes in the spirit of CLAUDE.md (language, style, prohibitions). If not — do a /memory, open the files, see what got in there.
.claude/rules/ (path-scoped) or to Agent Skill (Module 5).
Your ~/.claude/CLAUDE.md says “write in English.” The ./CLAUDE.md learning repo says “write in Russian, we’re explaining to kids.” You run claude in this folder and ask to add a function. In what language will the agent write comments?
Two weeks ago, you created a ./CLAUDE.md in the learning repo with the rule “do not use f-strings.” You open the repo again, type claude. Which file with your conventions will automatically load at the start of the session?
~/.claude/CLAUDE.md — the project file is pulled upon request.~/.claude/CLAUDE.md and ./CLAUDE.md — they are concatenated into the session’s starting context./memory in the session shows exactly what loaded — this is the first check if it seems like the agent “forgot” your rules.The Mars repo already contains AGENTS.md — it has general conventions for MarsCode and Cursor. You want to add one line specifically for Claude Code: “use plan mode before making edits in src/billing/.” What should you do?
CLAUDE.md with the first line @AGENTS.md and the Claude-specific rule below — both tools look at the same source.CLAUDE.md, but the @AGENTS.md syntax pulls content via import — without duplication. Option (a) works but creates two copies of the same rules, which quickly diverge. Option (c) breaks MarsCode and Cursor, which specifically look for AGENTS.md. An alternative to import is a symlink ln -s AGENTS.md CLAUDE.md, but on Windows, this requires Developer Mode._lib/claude-code-cheatsheet.md.
You now have a permanent signature — the agent in any Mars project knows who you are and for whom you’re writing. The next mandatory module is the fourth one (modules 2-3 come after feedback): about working memory and context engineering. What is /compact, why an agent "gets dumber" by the evening of a long session, and how to use sub-agents as a way to isolate context. This is the module the course exists for.
Modules 2-3 (Delegation × NTP, Description × Knowledge) and Module 5 (Your Own Sub-agents and Agent Skills) — after pilot feedback from the first mentors.