Understanding File Navigation Through Dialogue
Paths Are Just Directions
When you give someone directions, you might say:
- Absolute direction: "Go to 123 Main Street, downtown" (complete address from a fixed starting point)
- Relative direction: "Go down this street and turn left at the next corner" (relative to where you are now)
File paths work exactly the same way. Your AI companion uses paths to navigate your computer's folder structure. Learning to understand paths through dialogue means you can supervise navigation safely and build a mental map of your project's organization.
By the end of this lesson, you'll be able to:
- Read navigation dialogues and understand what folder your AI is moving to
- Predict path outcomes by recognizing absolute vs. relative syntax
- Draw folder structures from navigation conversations with your AI
This isn't about memorizing cd syntax. It's about understanding directions.
Example 1: Absolute Paths—"Here's the Complete Address"
Let's watch a real conversation where your AI uses an absolute path (a complete, unambiguous address starting from the root of your computer).
You: "I want to work with the Python project files. Take me to that project folder and show me what's there."
Agent: I'll navigate to the Python project and list the contents.
$ cd /Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python
$ pwd
/Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python
$ ls
book-source/ specs/ .claude/ history/ README.md CLAUDE.md
Agent: "I've navigated to /Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python. This is the root of the entire project. Notice the path is complete—starting from the user's home directory and descending through folders. I'm now showing you what's visible at this location."
Understanding Absolute Paths
In that dialogue, notice three key moments:
1. You made a request in plain language You said "take me to the project folder"—you didn't say "cd to /Users/mjs..."
2. Your AI executed the path command
The cd (change directory) command moved your AI to that location. The path /Users/mjs/... is an absolute path—it's a complete address.
3. Your AI confirmed location with pwd
The second command pwd (print working directory) showed you where your AI ended up: /Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python
Key Insight: Absolute paths always start with / (the root of your computer). They're like saying "start from the main street and go through these neighborhoods in order."
Example 2: Relative Paths—"Go Here From Where You Are"
Now let's see a conversation using relative paths. Your AI is already in the project folder and wants to navigate to a subfolder.
You: "I want to look inside the book-source folder. Show me what's in there."
Agent: I'll navigate into the book-source subfolder from where we are.
$ cd book-source
$ pwd
/Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python/book-source
$ ls
docs/ sidebars.js package.json README.md
Agent: "Notice: I used cd book-source—just the folder name, not the full path. This is a relative path because it's relative to where I already am. I moved down one folder. Now pwd shows I'm inside book-source. If I wanted to go back up, I'd use cd .. (two dots means 'parent folder')."
Understanding Relative Paths
This dialogue shows something powerful:
1. Relative paths don't start with /
When your AI said cd book-source, it meant "from where I am, go into the folder named book-source."
2. Special symbols make relative navigation easy
..means "go up one level to the parent folder".means "the current folder"- No symbol means "go into this subfolder"
3. Your AI can navigate using context
Your AI knows it's in the project root and understands book-source is a subfolder. You didn't have to provide the full absolute path.
Example 3: Building a Mental Map Through Dialogue
Let's watch an extended conversation where your AI navigates multiple levels and you build a mental picture.
You: "Show me the lesson files. Navigate to the docs folder, then to the AI-Tool-Landscape folder, then to the bash-essentials folder. Show me what lessons are there."
Agent: I'll navigate down through the folders and show you the lesson files.
$ cd docs
$ pwd
/Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python/book-source/docs
$ cd 02-AI-Tool-Landscape
$ pwd
/Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python/book-source/docs/02-AI-Tool-Landscape
$ cd 07-bash-essentials
$ pwd
/Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python/book-source/docs/02-AI-Tool-Landscape/07-bash-essentials
$ ls
01-introducing-ai-workspace.md
02-safety-first-pattern.md
03-understanding-navigation.md
04-understanding-file-operations.md
05-configuration-secrets.md
06-packages-dependencies.md
07-pipes-complex-commands.md
08-real-project-troubleshooting.md
README.md
Agent: "I navigated down three levels, one folder at a time. Each pwd showed me my progress. I'm now inside the bash-essentials folder where all the lesson files are stored. Each file is numbered, showing the lesson sequence."
Why Path Understanding Matters for Safety
Paths are critical for safe navigation. Consider this scenario:
Unsafe approach:
You: "Delete the backup folder" Agent: Deletes a folder Oh no—which backup folder? There might be multiple!
Safe approach:
You: "Delete the backup folder. But first, show me where we are and what backup folders exist." Agent: Shows absolute path and lists folders You: "Yes, delete /Users/mjs/backup-2024 but NOT /Users/mjs/backup-important"
By understanding paths—knowing exactly where your AI is—you prevent mistakes.
Exercise 1: Draw the Folder Structure
Read this navigation dialogue and draw the folder structure it represents.
Dialogue:
User: "Start at the project root and navigate to show me the spec structure."
Agent: I'll show you the path to the specifications folder.
$ cd /Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python
$ cd specs
$ pwd
/Users/mjs/Documents/code/panaversity-official/tutorgpt-build/colearning-python/specs
$ ls
001-chapter-7-bash/
002-redesign-bash-chapter/
spec.md
tasks.md
Your task: Draw a folder diagram that shows:
- The project root folder
- The specs folder (subfolder)
- The two chapter folders inside specs
- The files inside specs
Your diagram should look something like:
colearning-python/
├── specs/
│ ├── 001-chapter-7-bash/
│ ├── 002-redesign-bash-chapter/
│ ├── spec.md
│ └── tasks.md
Exercise 2: Predict Path Outcomes
Your AI is currently in /Users/mjs/Documents/code/project/src. Predict where it will be after each command.
Scenario 1: cd ..
- A)
/Users/mjs/Documents/code/ - B)
/Users/mjs/Documents/code/project/ - C)
/Users/mjs/
Answer: B. .. goes up one level to the parent folder.
Scenario 2: cd tests (assuming tests is a subfolder in the current directory)
- A)
/Users/mjs/Documents/code/project/tests - B)
/Users/mjs/Documents/tests - C)
/tests
Answer: A. Relative path moves to a subfolder from the current location.
Scenario 3: cd /Users/mjs/Documents/code/project/backup (absolute path)
- A) The command may fail if backup is not in the project root
- B) It navigates to /Users/mjs/Documents/code/project/backup regardless of where you currently are
- C) It navigates relative to the current directory
Answer: B. Absolute paths work from anywhere because they're complete addresses.
Exercise 3: Path Explanation Practice
Read this dialogue and explain (in plain language) what the path represents and why your AI chose that navigation method.
Dialogue:
User: "Navigate to the lesson files and show me one."
Agent: I'll go to the bash lesson folder.
$ cd book-source/docs/02-AI-Tool-Landscape/07-bash-essentials
$ ls
01-introducing-ai-workspace.md
02-safety-first-pattern.md
03-understanding-navigation.md
...
Your explanation should answer:
- Is this an absolute or relative path? How do you know?
- Why would the agent use this relative path instead of an absolute path?
- How many folder levels down did the agent navigate?
Model answer:
- Relative path — it doesn't start with
/, so it's relative to the current location - The agent used a relative path because we were already in the project root; using relative saves typing and is contextually clear
- The agent navigated down 4 levels: book-source → docs → 02-AI-Tool-Landscape → 07-bash-essentials
Formative Assessment: Path Concepts
Answer these questions to check your understanding.
Question 1: What's the difference between /home/user/projects/python-app and projects/python-app?
- A) They're the same
- B) The first is absolute (complete address); the second is relative (relative to current location)
- C) The first is faster than the second
Correct: B
Question 2: If your AI is in /Users/mjs/Documents/code and executes cd .., where will it be?
- A)
/Users/mjs/Documents - B)
/Users/mjs - C)
/(root)
Correct: A. .. means parent folder, so up one level.
Question 3: Why is understanding paths important before asking your AI to delete files?
- A) Paths don't matter; just delete whatever the AI suggests
- B) Understanding the exact location prevents accidental deletion of wrong folders
- C) Paths are only for reading files, not deleting
Correct: B. Knowing exactly which folder your AI is about to delete is critical for safety.
Summative Assessment: Navigate and Map
Have a real conversation with your AI where you:
- Ask your AI to navigate to three different folders in your project (use plain language: "Show me the lesson files", "Take me to the specifications", etc.)
- Observe the paths your AI shows with
pwd - Draw a folder structure showing how these three folders relate to each other
- Explain whether your AI used absolute or relative paths and why
Success criteria:
- You can identify at least one absolute path and one relative path from the dialogue
- Your folder diagram accurately reflects the real structure
- You can explain why
..or.would take your AI to a specific location - You recognize how paths help you supervise file operations safely
Try With AI
Tool: Claude Code, ChatGPT Code Interpreter, Gemini CLI, or your preferred AI companion
Setup: You're building a mental map of your project structure by having navigation conversations.
Prompt 1: Show Me Your Folder Structure
Copy and paste this prompt:
Navigate through my project folders and show me the structure.
Start at the root of the project.
Navigate down to the docs folder.
Navigate down to the AI-Tool-Landscape folder.
Navigate down to the bash-essentials folder.
After each navigation, show pwd (current path) and ls (contents).
Explain: Are these absolute paths or relative paths? Why?
Expected Outcome:
- You see a series of
pwdoutputs showing the progression - Each path is more specific (goes deeper into the folder structure)
- Your AI explains whether it's using relative navigation (from folder to subfolder) or absolute paths
- You can now draw a diagram of how these folders relate
Prompt 2: Find Your Way Back
Now that we're deep in the folder structure, use relative paths to get back to the project root.
At each step, show pwd and explain what .. does.
Expected Outcome: You understand that .. consistently means "go up one level to parent folder"
Prompt 3: Challenge—Predict Before Looking
Don't execute yet. Just tell me:
If we're in /project/src and I want to go to /project/tests,
should I use cd ../tests or cd tests?
Why? Explain your thinking.
Then show me the correct command.
Expected Outcome: You demonstrate understanding by predicting which approach (absolute vs. relative) makes sense, then verify with the actual command.