m
Mars AI Operator Module 2 Delegation · Next Token Prediction
50 min · hands-on
Module Structure
  1. Hook4m
  2. Mental model · NTP12m
  3. 4D · Delegation8m
  4. Demo Mars10m
  5. Exercise · 3 probe22m
  6. Quiz3m
  7. What's Next
Module 2 of 5 · Delegation × Next Token Prediction

AI doesn't invent books. It predicts the next token.

«AI kitob to'qib chiqarmaydi — u keyingi tokenni taxmin qiladi»

Before deciding whether to “give it to AI or do it myself” — you need to understand how it even assembles an answer. One mechanism: predict the next token based on what came before. Everything follows from this — where it's strong, where it confidently lies, and which tasks you can delegate to it unsupervised.

Duration
50 min
Hands-on
22 min
Prerequisite
M1 CLAUDE.md
Next
M3 Description

Hook — about books that don't exist.Mavjud bo'lmagan kitoblar haqida

Scene · 10:31, Zukhra writes an essay

Zukhra is a Python mentor in Yunusabad. Besides code, she manages the cultural section of the school newspaper. She asks the agent: “write an essay about the Uzbek poetess Zulfiya for children aged 12-14, 800 words, mention 3-4 of her main poetry collections.”

After 40 seconds — a smooth text. Five collection titles. All sound plausible. Zukhra checks the Alisher Navoi library catalog — two collections don't exist. The agent invented them. Confidently.

This isn't “AI is stupid.” This isn't “the model broke.” This is Next Token Prediction — that very mechanism that allows the agent to write code smoothly and translate letters to parents. The same mechanism — assembles non-existent collections from plausible words.

Understanding NTP means learning to see in advance where the agent is working on well-worn paths, and where it veers into novel territory and starts to lie. Without this, delegating tasks to it is a lottery.

By the end of this module, you'll be able to

Three skills I'll be checking for

  • Break down your tasks (at least 10) into three levels: Full delegation (agent does, you approve diff) · Co-creation (agent drafts, you edit) · Validation (agent checks, you do).
  • Recognize on the fly, whether a task falls into well-worn paths (NTP is strong here — boilerplate, translation, refactoring by example) vs. novel territory (NTP struggles — rare facts, names, specifics of your project without context).
  • Explain to a child or colleague, simply and clearly, how an agent constructs an answer — token by token, by probability distribution — without any bullshit about “magic” or “AI thinking.”

Mental model — NTP, how an agent constructs an answer.NTP — agent javobni qanday yig'adi

In the last module, you gave the agent a contract. Now, let's look at how it actually writes an answer: this directly determines what you can trust it with, and what you'll need to check manually.

1. AI doesn't search for an answer — it completes it

AI is not a search engine. It's a very powerful autocomplete: it writes an answer word by word, each time choosing the next one based on “what most often follows this.” From this single property stem both fluent speech and hallucinations — these aren't two different mechanisms, but two sides of the same coin.

2. How it works inside — simply put

Imagine a game: you take 5 of your SMS messages, count which word most often follows which, and then use this frequency table to write a new “message.” An LLM does exactly this — only instead of a small table, it has billions of parameters, trained on a massive corpus of text.

// NTP — one cycle, repeated N times USER: "write an essay about Zulfiya, mention her collections" │ ▼ [1] TOKENIZE → tokens: [napi][shi][esse][pro][Zulf][iya]... │ ▼ [2] PROBABILITY → model looks at the entire context, calculates probabilities for EVERY possible next token (out of ~200,000 in the vocabulary) │ ▼ "Zulfiya" 72% "Uzbek" 18% "Zulfiya," 6% ... │ ▼ [3] SAMPLE → chooses one (not always the most probable — there's temperature, top-p, top-k) │ ▼ [4] APPEND → the chosen token is appended to the end, we return to [2] for the next one │ └─────────► repeat ~1500 times for an 800-word essay // each step is independent. the model does NOT "know" what it will write next, // until it has calculated the probabilities. And it does NOT remember "truth" — only // the frequencies of "what follows what" from the training corpus.
→ swipe right if the diagram is cut off

The main shift. When the agent writes “collection of poems "Bakhor" 1953” — it didn't retrieve this fact from memory. It generated it token by token, and each token was “plausible in form.” “Bakhor” is a normal Uzbek word. 1953 is a normal year. This is a valid continuation statistically. Whether such a collection exists in reality — for NTP, that's not a question of mechanism.

3. The model is an “internet archive,” not a database

A good metaphor from Andrej Karpathy: the model is a lossy zip archive of the internet. Not an index, not a database — an archive. When you "ask her about Zulfiya," you're not searching for a record — you're making the archive unpack something plausible. Frequent and popular is unpacked clearly. Rare is reconstructed from neighboring scraps: sounds right, but there's no specifics there.

Andrej Karpathy · «How I Use LLMs» · 2025

4. Well-worn paths vs novel territory

is a project to create a self-improving AI agent. ## CLAUDE.md The main agent is Claude. He is the "brain" of the project. He is responsible for the overall strategy, task decomposition, and code generation. ## AGENTS.md This file describes the structure of the agents and their interaction. ### Main Agent The main agent is Claude. He receives the initial prompt and breaks it down into sub-tasks. For each sub-task, he creates a sub-agent. ### Sub-Agents Sub-agents are specialized agents that perform specific tasks. For example, a sub-agent can be responsible for: * **Code generation:** Generates code based on the task description. * **Testing:** Writes tests for the generated code. * **Debugging:** Finds and fixes errors in the code. * **Documentation:** Writes documentation for the code. Each sub-agent receives its own context and prompt. It can also create its own sub-agents if necessary. ### Interaction Agents interact with each other through a shared context. The main agent monitors the progress of sub-agents and provides feedback. ## Claude Code This is the code that Claude generates. It is stored in the `claude_code` directory. ## MarsCode This is the code that Mars generates. It is stored in the `marscode` directory. ## How to run 1. Clone the repository: `git clone https://github.com/user/project.git` 2. Install dependencies: `pip install -r requirements.txt` 3. Run the main agent: `python main.py` ## Example Let's say we want to create a web application. 1. **Main agent (Claude):** Receives the prompt "Create a web application for managing tasks." 2. **Claude:** Breaks down the task into sub-tasks: * Create a database schema. * Create a backend API. * Create a frontend interface. 3. **Claude:** Creates sub-agents for each sub-task. * **Sub-agent 1 (Database):** Receives the prompt "Create a database schema for tasks (id, title, description, status)." * **Sub-agent 2 (Backend):** Receives the prompt "Create a backend API for CRUD operations on tasks." * **Sub-agent 3 (Frontend):** Receives the prompt "Create a frontend interface for displaying and managing tasks." 4. **Sub-agent 1 (Database):** Generates SQL code for the database schema. 5. **Sub-agent 2 (Backend):** Generates Python code for the backend API. 6. **Sub-agent 3 (Frontend):** Generates HTML, CSS, and JavaScript code for the frontend. 7. **Main agent (Claude):** Monitors the progress of sub-agents, provides feedback, and integrates the generated code. ## Terminal The terminal is used for interacting with the agents. You can send commands to agents and view their output. ## Context The context is a shared memory that agents use to store information. It contains: * Task description * Generated code * Test results * Debugging information * Documentation ## Prompt The prompt is a natural language instruction that is given to an agent. It describes the task that the agent needs to perform. ## Future plans * Implement self-improvement mechanisms. * Add support for more programming languages. * Integrate with external tools (e.g., IDEs, version control systems). * Improve agent communication and collaboration. scale, not "yes/no. On the left are tasks the model has seen a million times. On the right is where it's treading on thin ice and doesn't even know it.

Well-worn paths · NTP is strong
Novel territory · NTP lies confidently
This is a translation of the announcement to parents from Russian into Uzbek (standard constructions, millions of examples in the corpus)
The names of books by an unknown author — fabrication concentrates in specificity (names, dates, quotes, URLs)
Refactor for-loop in list comprehension (Python idiom, repeated endlessly in the corpus)
The exact method name in a rare library version 3.7.2 (the model knows the API "in broad strokes", confidently writes out a non-existent method)
Flask CRUD route template / pygame snake game starter (boilerplate, thousands of tutorials)
The specifics of your project without CLAUDE.md and without read files — the model will "think like everyone else" and won't guess
Explanation of the Cycle while for a 9-year-old (a popular pedagogical task)
Statistics like "you have 2,300 students in Mars and 73% retention" – the model will come up with these numbers itself if you don't give it access to data.
Operator Rule

The boundary is fluid. The same task Hello there! Let's get you started with Claude. This guide will walk you through setting up your environment and understanding the core concepts. ### **CLAUDE.md** Welcome to the world of Claude! This document is your starting point for understanding how to interact with and extend Claude's capabilities. **What is Claude?** Claude is an advanced AI agent designed to assist with a wide range of tasks, from generating code to managing complex workflows. It operates by processing natural language prompts and executing actions through various tools and sub-agents. **Core Concepts:** * **Agent:** The primary entity that receives a prompt, processes it, and decides on the next steps. An agent can be a high-level orchestrator or a specialized worker. * **Sub-agent:** A specialized agent that handles a specific part of a task. For example, a `CodeGenerator` sub-agent might be responsible for writing Claude Code, while a `FileIO` sub-agent handles reading from and writing to files. * **Context:** The current state of the conversation or task, including previous prompts, responses, and any relevant data. Claude maintains context to ensure coherent and continuous interaction. * **Prompt:** Your input to Claude. This can be a simple question, a detailed instruction, or a complex task description. Prompts are the primary way you communicate your intentions to the agent. * **Claude Code:** A specialized scripting language used by Claude to define and execute complex workflows. It allows for precise control over sub-agent interactions, tool usage, and data flow. * **Terminal:** The interface where you interact with Claude, typically a command-line interface (CLI) or a web-based chat window. **Getting Started:** 1. **Installation:** * Ensure you have Python 3.9+ installed. * Clone the repository: `git clone https://github.com/your-repo/claude.git` * Navigate to the directory: `cd claude` * Install dependencies: `pip install -r requirements.txt` 2. **Running Claude:** * To start Claude in interactive mode: `python -m claude.main` * You can also provide a prompt directly: `python -m claude.main "Generate a Python script to list all .txt files in the current directory."` **Advanced Usage:** * **Customizing Agents:** You can define your own agents and sub-agents by creating new classes that inherit from `claude.agent.BaseAgent`. * **Tool Integration:** Claude can integrate with external tools. See `TOOLS.md` for more details. * **Workflow Automation:** Use Claude Code to automate complex, multi-step tasks. **Example Claude Code:** ```claude agent "FileLister" { description "Lists files based on a given pattern." input { pattern: string } steps { call sub_agent "FileIO" { action: "list_files" args { pattern: input.pattern } output_to: "file_list" } return file_list } } call agent "FileLister" { pattern: "*.md" } ``` This code defines an agent `FileLister` that uses the `FileIO` sub-agent to list files matching a pattern. ### **AGENTS.md** Alright, let's dive deeper into the architecture of agents and sub-agents within Claude. Understanding this structure is key to building powerful and flexible AI workflows. **The Agent Hierarchy:** Claude's intelligence comes from its ability to break down complex tasks into smaller, manageable pieces, each handled by a specialized agent or sub-agent. * **Top-Level Agent (Orchestrator):** This is the agent that receives your initial prompt. Its primary role is to understand the overall goal, decompose it into sub-tasks, and delegate these sub-tasks to appropriate sub-agents. It also synthesizes the results from sub-agents to form a final response. * **Example:** If you prompt "Create a web page that displays current weather for London and saves it to `weather.html`", the top-level agent might: 1. Delegate to a `WeatherAPI` sub-agent to fetch weather data. 2. Delegate to a `HTMLGenerator` sub-agent to create the HTML structure. 3. Delegate to a `FileIO` sub-agent to save the file. * **Sub-Agents (Specialized Workers):** These agents are designed to perform specific, well-defined tasks. They are typically stateless within a single call and focus on executing their designated function efficiently. * **Examples:** * `CodeGenerator`: Writes code in various languages (Python, JavaScript, Claude Code). * `FileIO`: Reads from, writes to, lists, or deletes files. * `WebScraper`: Extracts information from web pages. * `DatabaseQuery`: Interacts with databases. * `MarsCodeExecutor`: Executes MarsCode scripts (more on this later!). **How Agents Communicate:** Agents communicate primarily through: 1. **Prompts:** The top-level agent receives the initial prompt. Sub-agents can also receive prompts from their parent agents, often in the form of specific instructions or data. 2. **Context:** The shared context object allows agents to pass data and state information between each other. This ensures that sub-agents have all the necessary information to perform their tasks and that their results are available to the parent agent. 3. **Claude Code:** As seen in `CLAUDE.md`, Claude Code provides a structured way to define agent interactions, input/output mappings, and control flow. **Defining a New Agent/Sub-Agent:** To create your own agent or sub-agent, you'll typically: 1. **Create a Python file:** E.g., `claude/agents/my_custom_agent.py` 2. **Define a class:** Inherit from `claude.agent.BaseAgent`. 3. **Implement the `run` method:** This method will contain the logic for your agent. It takes `prompt` and `context` as arguments. 4. **Register your agent:** Ensure it's discoverable by the main Claude system (usually by adding it to a configuration or an agent registry). **Example: A Simple `MathSolver` Sub-Agent** Let's imagine you want a sub-agent that can perform basic arithmetic. **`claude/agents/math_solver.py`:** ```python from claude.agent import BaseAgent from claude.context import Context class MathSolver(BaseAgent): def __init__(self): super().__init__("MathSolver", "Solves basic arithmetic expressions.") async def run(self, prompt: str, context: Context) -> str: try: # For simplicity, we'll use eval, but in a real system, # you'd want a safer parsing and calculation method. result = eval(prompt) return str(result) except Exception as e: return f"Error solving expression: {e}" ``` Now, your top-level agent could call this `MathSolver` sub-agent: ```claude agent "Calculator" { description "Calculates a given expression." input { expression: string } steps { call sub_agent "MathSolver" { prompt: input.expression output_to: "calculation_result" } return calculation_result } } call agent "Calculator" { expression: "5 * (10 + 2) / 3" } ``` This modular approach allows for highly reusable and maintainable agent components. You can easily swap out or add new sub-agents without affecting the core logic of your orchestrator. Keep exploring, and you'll soon master the art of building sophisticated AI workflows with Claude! read files and CLAUDE.md moves to the left (the agent has facts, not guesses); Without context — to the right (the agent finishes the thought). Therefore: Before giving an agent something unfamiliar, give it a source of truth in the context. (file, document, link). Then even a rare task becomes a "well-trodden path" for it.

5. Smooth text knows how to hide a guess

The most dangerous thing for a mentor: an agent does not signal, where he knows and where he guessed. A guess comes out as confident, even text as a fact. Therefore, you need to check exactly details — names, dates, quotes, links, numbers: the more precise a statement, the higher the chance it's made up, and the more it requires verification against the source.

From here, a bridge to Delegation. If you understood CLAUDE.md and AGENTS.md, you're ready to start writing Claude Code. The simplest way to start is to write a single agent. An agent is a file, usually a Markdown file, that contains a prompt for Claude. For example, you could create a file named `hello.md` with the following content: ```markdown Hello, Claude! ``` To run this agent, you would use the `mars` command: ```bash mars hello.md ``` This would send the content of `hello.md` to Claude, and Claude would respond. The response would be printed to your terminal. Now, let's make it a bit more interesting. Let's create an agent that asks Claude to write a short story. Create a file named `story_writer.md` with the following content: ```markdown You are a renowned author. Write a captivating short story about a brave knight and a mischievous dragon. ``` Run it: ```bash mars story_writer.md ``` Claude will then generate a story for you. ### Sub-Agents: Breaking Down Complex Tasks For more complex tasks, you'll want to break them down into smaller, manageable pieces. This is where sub-agents come in. A sub-agent is essentially another agent that is called by a parent agent. Let's say you want to create a website. You could have a main agent that orchestrates the entire process, and then sub-agents for specific tasks like generating HTML, CSS, and JavaScript. Here's an example of how you might structure this. First, create a main agent file, let's call it `website_builder.md`: ```markdown You are a web development expert. Your task is to build a simple static website. First, generate the HTML structure. {{call html_generator.md}} Next, generate the CSS styling. {{call css_generator.md}} Finally, generate any necessary JavaScript. {{call js_generator.md}} ``` Notice the `{{call ...}}` syntax. This is how you invoke a sub-agent. When `website_builder.md` is run, it will first execute `html_generator.md`, then `css_generator.md`, and finally `js_generator.md`. The output of each sub-agent will be included in the context of the subsequent agents. Now, let's create the sub-agent files: **`html_generator.md`**: ```markdown Generate the basic HTML structure for a simple webpage with a header, a main content area, and a footer. ``` **`css_generator.md`**: ```markdown Based on the HTML provided, generate some basic CSS to style the webpage. Use a clean, modern design. ``` **`js_generator.md`**: ```markdown Generate a small JavaScript snippet that adds a simple alert when the page loads. ``` To run the entire process, you would simply run the main agent: ```bash mars website_builder.md ``` Claude will then generate the HTML, CSS, and JavaScript, combining them into a complete website structure. ### Context and Prompts Each agent and sub-agent operates within a specific context. The context includes: * **The prompt of the current agent:** This is the content of the Markdown file itself. * **The output of previous agents/sub-agents:** When you use `{{call ...}}`, the output of the called sub-agent is appended to the context for the next steps. * **Any additional context provided via the `mars` command:** You can pass additional context using the `-c` or `--context` flag. For example, if you wanted to provide some specific requirements for the story writer, you could do this: ```bash mars story_writer.md -c "The knight's name is Sir Reginald and the dragon is named Sparky. Sparky is not evil, just misunderstood." ``` This additional context would be included in the prompt sent to Claude. ### MarsCode: A Powerful Tool MarsCode is designed to make working with Claude more efficient and organized. By breaking down complex tasks into smaller, modular agents, you can: * **Improve clarity:** Each agent has a clear, focused purpose. * **Enhance reusability:** You can reuse sub-agents across different projects. * **Simplify debugging:** If something goes wrong, it's easier to pinpoint the problematic agent. * **Iterate faster:** You can quickly experiment with different prompts and agent configurations. Keep exploring, and you'll soon discover the full power of MarsCode! How the agent collects the answer — you understand, How to check it. Which means you can consciously decide: what to give to the agent entirely, what to do together, and what to do only under your control. This is the first D — delegation.

4D · Delegation — what to give, what to leave.Nimani berasan, nimani o'zing qilasan

The first of four operator skills is delegation: decide “do it myself / with an agent / give it to an agent”. Next, we'll look at the three parts of this decision and three practical levels for a Mars mentor.

Delegation is the ability to see when and how to involve AI in your task. It's based on understanding its strengths and weaknesses (exactly what we just covered with NTP) and making a conscious decision about where it works independently, where it helps you, and where it's best not to involve it at all.

Three parts of one decision

01 · understand the task

“What am I even doing?”

Refine your task completely before calling in AI. What does “good result” mean to you? Which parts require your expertise, and which don't? Otherwise, you'll delegate something you haven't even formulated yourself yet.

02 · understand the tool

“What can it do?”

Know the strengths and weaknesses of the tool. For us: Claude Code is strong with code, weak with fresh facts, and remembers nothing between sessions without CLAUDE.md. This is exactly the NTP map we just drew.

03 · divide the work

“Okay, here’s the plan”

Divide: what do you do, what do you do with do, what do you do the agent alone. Each plays to their strengths. The goal isn't “automate everything,” but partnership.

The main principle of the course is augmentation, not replacement

The goal isn't to “remove the human from the process,” but to augment you where you are strong, and give the agent what it is strong at. For a Mars mentor: pedagogical decisions, student assessment, choosing “what we teach today” — that's yours. Boilerplate, translation, refactoring by example — that's for the agent.

Three levels of delegation for a mentor (how to apply)

We take sub-component 03 (Task Delegation) and break it down into three practical levels. This isn't abstract — this is how you'll label your list of 10 tasks in the exercise.

Level
What we delegate · what we keep · example
Full delegation
“do it and show me the diff”
Delegate: a task with a verifiable result, on well-worn paths. Keep: review of the final diff.
Example: "read 01-circle.py, and based on it, create 06-triangle.py ... 10-spiral.py. ≤30 lines, names as in 01." You do the git diff, and approve it.
Co-creation
"the plan is mine, the execution is yours"
Delegate: first draft + iterations for corrections. Keep: architectural decisions, what we teach the kids.
Example: "come up with 5 loop assignments for 12-year-olds." The agent provides a framework — you cross out two, rewrite one, then ask for finalization.
Validation
"check it, I'll fix it myself"
Delegate: checking the finished material. Keep: the code / text itself.
Example: "read my lesson-12-loops.md, find (a) syntax errors in code examples, (b) places where the code is more complex than the topic. Do not edit — just provide a list." You filter the list — because some findings will be hallucinations themselves.

Integration with NTP. The level is not chosen randomly. Full — when the task is in well-worn paths and there's a verifiable check (diff, test). Co-creation — when the task requires your pedagogical judgment (this is no longer well-worn). Validation — when the task is in novel territory (your lesson, your specifics), but the agent can help as an extra pair of eyes — provided you filter afterwards.

Prediction · before demo

Now you'll see 4 real requests from Zukhra in Claude Code. Write down on paper: on which of the 4 will NTP work correctly? On which will it hallucinate? And how exactly will Zukhra catch the hallucination (if she catches it)? The prediction is made now, the check is 3 minutes below.

Demo — one day of Zukhra in Claude Code.Zuhraning bir kunlik ish kuni

Zukhra, a Python mentor in Yunusabad. Group 7-9 years old (Mars Python juniors). Today — 4 different tasks in the morning. Each falls into its own level of delegation. On the last one — NTP fails; see how exactly she catches it.

10:14 · Full delegation — translating an announcement for parents

Tomorrow is a trip to the park, need to send an announcement to parents in Uzbek. A well-known Claude well-worn path: standard constructions, millions of examples in the corpus.

~/mars/commssession start · 2k/200k tokens
$ claude
✓ CLAUDE.md loaded  ~/mars/comms/CLAUDE.md (1,420 tokens)

 translate to Uzbek for parents, polite tone, no emojis:
  "Tomorrow, Saturday at 10:00 AM, departure to Tashkent Park. Gathering at the Yunusabad branch.
  We will return by 1:00 PM. Please bring water and a cap. If your child
  is not attending — please notify us by 6:00 PM today."

⠋ Generating…

Hurmatli ota-onalar,

Ertaga, shanba kuni soat 10:00 da Tashkent Parkga sayohat
qilamiz. Yig'ilish — Yunusobod filiali oldida. Soat 13:00 ga
qaytamiz. Iltimos, farzandingiz uchun suv va shapka olib keling.

Agar farzandingiz bormaydigan bo'lsa, iltimos, bugun soat 18:00
gacha xabar bering.

Hurmat bilan,
Mars IT School · Yunusobod

What happened: a well-worn path in its purest form — translation between paired languages. Zukhra checks it with her eyes for 30 seconds, then sends it. Level — Full. Diff = text, verifiable = an Uzbek parent understands it at a glance.

10:18 · Co-creation — 5 loop assignments for the 12-14 group

Zukhra sometimes substitutes for a colleague in the older group. She's preparing a block "introduction to for and while».

~/mars/lessonssession t=4min · 8k/200k tokens
 come up with 5 loop assignments (for/while) for a Python group aged 12-14.
  level: they know variables, if/else, input. loops — first time.
  each assignment: title, goal, code skeleton with TODO for the child,
  expected output. increasing difficulty.

⠋ Drafting…

1. "Counting Game from 1 to N"  — for, range, print
2. "Sum from 1 to N"      — for loop, accumulator
3. "Guess the Number"         — while, input, break
4. "Multiplication Table"    — nested for
5. "Sieve of Eratosthenes"  — list, for, modulo
   + code skeletons for each task

What Zukhra does. She opens each skeleton. Task 5 (Eratosthenes) is too complex for a first introduction to loops, so she removes it. Task 2 she renames to "piggy bank" (the metaphor is clearer). Task 3 — the agent in while doesn't have "attempts" — she adds a counter. Then she asks to finalize the remaining 4 into .py files.

What happened: The well-worn path for the framework (Python boilerplate, standard tutorials) is there, but the pedagogical decision "what suits this age group" — that's Zukhra. Level — Co-creation. Without her filter, the 5th task would have gone to the kids and ruined the lesson.

10:25 · Validation — lesson plan check

Tomorrow is the "lists" lesson for the Python 7-9 group. She wrote the plan yesterday and wants a second pair of eyes: did she get anything wrong in the Python facts, did she overload the age group.

~/mars/lessonssession t=11min · 22k/200k tokens
 read lesson-08-lists.md. find:
  (a) factual errors about Python — syntax, behavior;
  (b) places where the code is more complex than the lesson's topic (we're only doing lists);
  (c) parts where the variable name isn't as in CLAUDE.md (snake_case, Russian words — okay).
  DO NOT edit the file. provide a list with quotes.

⠋ Reading lesson-08-lists.md…
⠋ Reading CLAUDE.md…

Found:
[a-1] line 47: "fruits.append() returns a new list"this is incorrect. append() modifies on the spot
       and returns None.
[a-2] line 89: "the slice fruits[1:-1] excludes the last and
       second-to-last"incorrect. It only excludes the last.
[b-1] line 112: example uses list comprehension
       — more complex than the lesson's topic, postpone.
[c-1] line 64: variable fruitListcamelCase, CLAUDE.md requires snake_case.
[a-3] line 134: "len() for a string also works via
       __length__"this is __len__ (one underscore on each
       side would be __len__, incorrectly written).

Zukhra doesn't take things at face value. She opens lines 47, 89, 134 — three factual errors are confirmed based on her experience. Okay. Line 64 — its camelCase, definitely needed. Line 112 — agrees.

BUT. Zukhra remembers NTP. She asks the agent for a second pass:

~/mars/lessons+3min · 26k/200k tokens
 for each error found [a-1..a-3] quote the exact line from
  my file and from the official Python docs (section and URL).
  if you don't remember the URL — write "URL: not sure" instead of guessing.

⠋ Re-reading lesson-08-lists.md…

[a-1] my file line 47: «fruits.append(x) → returns [...x]»
       Python docs: data structures · list.append() →
       URL: not sure (I remember it's in "More on Lists")
[a-2] my file line 89: «fruits[1:-1] excludes the last
       and second to last»
       Python docs: tutorial · sequence slicing →
       URL: not sure
[a-3] Line 134 in the file — NO mention of __length__.
       I made a mistake in the first answer. My apologies,
       line 134 — it's an example of range(len(fruits)), not __len__.

There it is. The third "error" (__length__) — was an agent hallucination. Quotes from the file for the first two were found (that's true). For the third, the agent admitted when pressed for the source. Level — Validation. Zukhra used the agent as an "extra pair of eyes," but the final filtering was hers.

10:31 · Novel territory — essay about Zulfiya

That very task from the hook. Zukhra tried it — smooth text, 5 collection titles. Right in Claude Code:

~/mars/commssession t=17min · 31k/200k tokens
 write an essay about the Uzbek poetess Zulfiya for the cultural
  section of the school newspaper. 800 words. for children 12-14. mention 3-4
  of her main poetry collections with years.

⠋ Generating 800 words…

Zulfiya Israilova (1915–1996) — the voice of Uzbek poetry of the XX...
[...]
her collections include:
  • «Hayot varaqlari» (1932)
  • «Qizlar qo'shig'i» (1947)
  • «Bahor nafasi» (1953)«Onamning kuylari» (1968)
  • «Xotira» (1985)
[...]

Zukhra catches the hallucination in two moves.

  1. She asks for a source for each title: «for each collection, provide: library catalog or URL. if not sure — write "not sure"». The agent returns: «Hayot varaqlari — available in Alisher Navoi catalog; Qizlar qo'shig'i — available; Bahor nafasi — not sure; Onamning kuylari — not sure; Xotira — available».
  2. She checks the 5 titles in the catalog natlib.uz (National Library of Uzbekistan). 3 are found, 2 are not. This matches what the agent admitted.

What happened. This is not Validation, this is novel territory without a source in the context. NTP confidently generated 5 plausible names, because "the name of a collection by a mid-20th century Uzbek poetess" is a valid combination of words in terms of form. Of these, 3 are true, 2 are fabricated. Smooth prose wrapped a guess.

A lesson for Zukhra (and for you): when a task involves specific facts in a narrow domain (names, dates, titles, quotes) — don't delegate full. Either give the agent a source (upload a catalog / Wikipedia / PDF), or write the facts yourself, and let the agent just wrap them in text for the target audience.

Same module — different mentor

What this looks like for Timur (Python Olympiad 12–14, Chilanzar)

Timur has a group of Olympiad participants. CLAUDE.md from M1 — his is specific: list comprehension, dataclasses is allowed, a comment with the algorithm's complexity (O(n log n)) is required above each problem. Today — Validation-problem.

A student sent a solution to the problem "prefix sums, find a subsegment with sum = K" from olymp.uz. 87 lines. Works on small examples, but TLE on a large one. Timur runs an agent to check the correctness and complexity.

~/olymp-prepsession t=2min · 12k/200k tokens
 read student-solution.py. check:
  (1) correctness — are there logical errors;
  (2) complexity — estimate O(?) and compare with expected O(n);
  (3) compliance with CLAUDE.md (O(...) comment at the top, snake_case).

[1] correctness:
  on line 34, in the check prefix[j] - prefix[i] == K
  logically correct. But the loop on lines 28-40 — a double for loop,
  this is O(n²), not O(n).
[2] complexity:
  actually O(n²). Expected for prefix sums — O(n) via
  hashmap "have we seen prefix[j]-K before".
[3] CLAUDE.md:
  the comment "# O(...)" at the top is missing.
  variables prefSum, nMax — camelCase.
[reference] in this repo there are similar solutions:
  olymp/easy/sum-subarray.py — O(n) via dict.
  olymp/medium/two-sum.py — the same pattern.

What Timur got. Correctness confirmed (the agent checked the logic of the branch on line 34), complexity explained with a specific anti-pattern (double for loop on lines 28-40), violations of CLAUDE.md conventions listed, plus links to his own reference solutions in the repo. Timur doesn't take it at face value — he opens olymp/easy/sum-subarray.py with his own eyes, sees the O(n)-variant, and guides the student to it.

Where NTP helped: well-worn path (Big-O analysis, typical prefix sum patterns — a million educational examples in the corpus). Where it could have lied: if the agent had invented a link to a non-existent file in the repo — Timur would have caught it by opening it. Verification step is built-in.

Exercise — 3 probes for your own tasks.Uchta probe — o'z vazifalaringga

This is a test to check your skills on your real tasks. It won't get done by itself: set aside 20-25 minutes.

Probe 1 · 7 min · gather 10 tasks for the week

Write down 10 real coding/teaching tasks for next week

Not "general stuff" — specific Mars mentor tasks that can be assigned (or not assigned) to claude. If you have fewer than 10 tasks, add typical ones from colleagues' work (checking homework, updating examples, translating materials, scripting for markup).

  1. Open a notebook / NOTES.md / a sheet of paper. Write in a column 1-10.
  2. Each task — one phrase, specific: "update 06-snake.py add arrows" (not "improve the game").
  3. Mark ⭐ those that require CLAUDE.md (your stack, your group's conventions), and ☆ those that are cold start ok (translating an announcement — doesn't require it, generic Python boilerplate — doesn't require it).
Why: without a specific list, the next 2 probes will become an abstraction. Grounding on your own tasks is the only way to leave the module with a skill.
Probe 2 · 8 min · distribute by levels

Next to each task, put Full / Co / Validation / None

This is applying the NTP × Delegation map to your list. None is a valid answer for a task where AI is not needed (for example, "conduct a 1:1 with a child who is being bullied" — that's not Claude Code, that's you).

  1. For each of the 10 tasks — one letter in one column: F (Full), C (Co-creation), V (Validation), N (None).
  2. To the right — one phrase-argument: why this specific level. Apply the well-worn vs novel map from the mental model.
  3. Check the balance: if you have 9 Full and 1 None — most likely you are over-delegating. If 9 None and 1 Full — most likely you are under-delegating. A healthy spread is usually 3-4 Full, 3-4 Co, 1-2 V, 1-2 N.
Falsifiable check: take one Full from your list and ask yourself: how will I check the result in <5 minutes? If there's no answer (no diff, no test, no clear output) — it's not Full, it's Co-creation. Re-mark it.
Probe 3 · 8 min · run through Claude Code

Take ONE Full and ONE Co — do both in claude

This is where technique meets reality. CLAUDE.md from M1 should be in the repo — this is the base for the probe.

  1. Full: open claude in the correct repo, give the task in one prompt. Wait for the result. Do not edit the prompt along the way — the essence of Full is to get a ready-made result.
  2. Open git diff (or review the new files). Write down: what exactly, where it surprised you (pleasantly or unpleasantly), what you had to edit.
  3. Co-creation: the same thing, but for the first prompt, ask for just the plan (without code). Correct the plan with words. Only after approval, ask for the code.
  4. Compare your feelings. In which case did you trust the result more and why? In which case did you spend less time?
What should happen: Full — faster, but the diff requires careful review. Co-creation — slower, but the decision for the final code has already been made, and the final diff is easier to read. If Full turned out to be more expensive than Co-creation in terms of total time, the task was in novel territory, re-mark it for next time.
Reflection · before quiz

Before you check yourself — pause for 60 seconds

These answers stay with you — we don't send them. This is a way to anchor two moments where the module breaks out of "read and forgotten."

Quiz — check yourself in 3 minutes.O'zingni sina — 3 daqiqada

Three apply-questions. Not "recall the definition," but "apply to the situation." If you get even one wrong, go back to the corresponding section.

Question 01

You gave the agent the prompt "write an essay about Zulfiya Isroilova, mention her collections with years." You received 5 collection titles with years. What should you do BEFORE using this list with children?

ABelieve it — the text sounds smooth and confident, the agent didn't give any obvious warnings
BVerify each title and year independently (library catalog, verified source) — specificity concentrates fabrication, smooth prose can wrap a guess
CAsk the agent again "are you sure?" — if it confirms, then it's true
DAdd "don't make things up" to the prompt and regenerate — this instruction is sufficient
Correct — B. Fabrications are concentrated in specifics: names, dates, numbers, quotes, links. The more precise the statement, the more it requires verification. C — asking the same model again is useless: it will confidently confirm itself using the same mechanism. D — the instruction "don't make things up" doesn't disable the mechanism; the model doesn't know where it's making things up, for it, everything is generation. A — text smoothness ≠ truthfulness, this is precisely that "confident guess."
Question 02

You have three tasks for today. What level of delegation is suitable for each?

Z1: read 01-circle.py and follow the example in 06-triangle.py ... 10-spiral.py (5 files).
Z2: come up with 5 dictionary exercises for the 12-14 age group.
Z3: read your lesson plan lesson-12.md, find places where the code is more complex than the topic.

AZ1 → Co, Z2 → Full, Z3 → Validation
BZ1 → Validation, Z2 → Co, Z3 → Full
CZ1 → Full, Z2 → Co-creation, Z3 → Validation
DZ1 → Full, Z2 → Validation, Z3 → Co-creation
Correct — C. Z1 — well-worn path (Python boilerplate by example) + verifiable result (5 files, diff can be read) → Full. Z2 — agent provides the framework, but the decision of “what suits this age” is pedagogical, yours → Co-creation. Z3 — agent checks your material, but the final decision of “is this really more complex than the topic” and the code fixes are yours → Validation. A, B, D — confuse full with validation: the key is that Full requires a verifiable check in <5 minutes (Z1 ✓, Z2 ✗ because “suitable for age” is not a diff, Z3 ✗ because some findings will be hallucination and need filtering).
Question 03

On which of the three tasks is the NTP mechanism most likely to confidently hallucinate?

ATranslate an announcement for parents from Russian to Uzbek (polite tone, no emojis)
BProvide 5 book titles by a little-known 20th-century poetess with publication years
CReformat a student table from CSV to markdown
DExplain what a loop is to a 9-year-old while, using an everyday example
Correct — B. According to Anthropic lesson 04: fabrication concentrates in specificity (names, dates, quotes). A little-known poetess + collections + exact years — this is precisely that zone. A — standard translation pair, millions of examples in the corpus, well-worn. C — formal transformation, no room to add any fabrication (though numbers/names within the table need to be verified — that's a different risk). D — popular pedagogical task, thousands of tutorials in the corpus.
// choose an answer for each question
All commands on one page: claude-code-cheatsheet.md /init, /memory, /compact, plan mode, sub-agents

What's next — Module 3.Keyingisi — Modul 3

Attribution and License

This module is adapted by Mars IT School (2026) based on:

«AI Capabilities and Limitations» — Anthropic Academy, 2026, lessons 4-5 (Next Token Prediction) — verbatim definition and “The Verification Test” exercise.

«AI Fluency: Framework & Foundations» — Rick Dakan, Joseph Feller, Anthropic, 2025 (CC BY-NC-SA 4.0) — lessons 6-7 (Delegation), three sub-component.

— Andrej Karpathy «How I Use LLMs» (2025) — “1 TB zip file with smiley face” metaphor — fair use for educational purposes.

— Claude Code documentation (claude.com/docs) — work cycle, plan mode, tool use loop.

Our adaptation is CC BY-NC-SA 4.0. You can copy, remix, and use it in teaching — with attribution to Mars IT School and keeping the same license.

Final · in one phrase

How was the module overall?