From e43872e9bdd8f9bf0c770a95f570d714f4f51d65 Mon Sep 17 00:00:00 2001 From: Luong NGUYEN Date: Sun, 26 Apr 2026 22:28:34 +0200 Subject: [PATCH] fix(cli): correct agent priority order to match official docs (#98) (#100) Lesson 10 stated CLI > User > Project, contradicting Lesson 04 (CLI > Project > User) and the official Claude Code docs. Project-level agents override user-level agents when their names collide. - Fix priority order in 10-cli/README.md (lines 437-439) - Add cross-link to Lesson 04 for the full priority table - Update matching quiz question Q7 in lesson-quiz question-bank Closes #98 --- .claude/skills/lesson-quiz/references/question-bank.md | 4 ++-- 10-cli/README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.claude/skills/lesson-quiz/references/question-bank.md b/.claude/skills/lesson-quiz/references/question-bank.md index 8d13a9d..6ed86b6 100644 --- a/.claude/skills/lesson-quiz/references/question-bank.md +++ b/.claude/skills/lesson-quiz/references/question-bank.md @@ -813,9 +813,9 @@ ### Q7 - **Category**: conceptual - **Question**: What is the agent definition priority order? -- **Options**: A) Project > User > CLI | B) CLI > User > Project | C) User > CLI > Project | D) All are equal priority +- **Options**: A) Project > User > CLI | B) CLI > Project > User | C) User > CLI > Project | D) All are equal priority - **Correct**: B -- **Explanation**: CLI-defined agents (--agents flag) have highest priority, then User-level (~/.claude/agents/), then Project-level (.claude/agents/). +- **Explanation**: CLI-defined agents (--agents flag) have highest priority, then Project-level (.claude/agents/), then User-level (~/.claude/agents/). - **Review**: Agents configuration section ### Q8 diff --git a/10-cli/README.md b/10-cli/README.md index 21e39d3..a394aee 100644 --- a/10-cli/README.md +++ b/10-cli/README.md @@ -435,10 +435,10 @@ claude -p --agents "$(cat agents.json)" --model sonnet "analyze performance" When multiple agent definitions exist, they are loaded in this priority order: 1. **CLI-defined** (`--agents` flag) - Session-specific -2. **User-level** (`~/.claude/agents/`) - All projects -3. **Project-level** (`.claude/agents/`) - Current project +2. **Project-level** (`.claude/agents/`) - Current project +3. **User-level** (`~/.claude/agents/`) - All projects -CLI-defined agents override both user and project agents for the session. +CLI-defined agents override both project and user agents for the session. Project-level agents override user-level agents when their names collide. See [Lesson 04 — Subagents](../04-subagents/README.md#file-locations) for the full priority table including plugin-level agents. ---