A terminal can look intimidating at first: a dark window, a blinking cursor, and none of the usual buttons. In practice, it's much simpler. It's a direct way to tell the computer what to do: one command shows files, another moves to the right folder, and a third starts a program.

Almost everything that goes wrong early on with an agent isn't about how you phrased the request - it's about the terminal sitting in the wrong folder. So we'll start with folders and paths, and reach the claude command later. At the end we'll apply all of that to javarush-project, where every task lives as a separate project.

The terminal - a direct way to control a project

A terminal is a window where you control the computer with text commands. Instead of searching through menus for the right button, you name the action directly: show the files, open a folder, start a program.

A mouse is faster right up to the moment you have to repeat the same action for the tenth time. Here is what the terminal gives you instead:

  • a command performs one specific action - the result appears in the same window, no guessing;
  • a sequence is easy to repeat - check the folder, list the files, move, and start the tool;
  • state that the interface hides becomes visible - the current folder above all.

You don't need to choose one approach. IDEA is convenient for finding files visually and opening them with a click; the terminal is convenient for running an exact command and seeing the answer immediately. In real work, both sit side by side.

Claude Code also starts with a command

When you enter claude, the agent starts from the terminal's current directory. That's why it helps to know where the terminal is before you start the agent.

Five commands for everyday work

Five actions. For a start, that really is enough. On Windows we use PowerShell; on macOS and Linux, the standard terminal. The short commands look the same in all three cases.

CommandExpanded formWhat it does
pwdprint working directory - "show the working directory"Prints the full path to the folder where the terminal currently is.
lslistShows the files and folders in the current directory.
cd demo-projectchange directoryMoves into the neighboring demo-project folder.
cd .... means the parent directoryMoves the terminal one folder up.
claudeThe name of the program being startedStarts Claude Code from the current directory.

In PowerShell, the short commands are simply convenient aliases: pwd calls Get-Location, ls calls Get-ChildItem, and cd calls Set-Location. No need to fear the long names, or memorize them yet. They do make the meaning of each command easier to see.

Now for a short run on macOS or Linux. The terminal starts in projects, then moves into demo-project:

Look at the last part of the path: projects changed to demo-project. No magic. The cd command didn't open or copy a file; it only moved the terminal into another folder.

Keys that save time

A couple of habits start saving time almost immediately. The terminal remembers your input history and helps complete long names:

  • ↑ - shows the previous command. Press it several times to move further back through history;
  • ↓ - moves toward newer commands in history;
  • Tab - completes a command, file name, or folder name. For example, enter cd dem and press Tab to get cd demo-project;
  • ← and → - move the cursor within the line so you can fix one character without typing the entire command again;
  • Ctrl+C - usually stops the running command if you started the wrong thing or the process doesn't finish;
  • Ctrl+L - clears the visible terminal area without deleting files or command history.

You'll probably use the up arrow and Tab most often. The first brings back a command you already entered; the second prevents typos in long paths.

Folder, directory, and path

You copy a path into a command, move to another folder - and the same command stops working. It isn't a typo: paths come in two kinds, and one of them depends on where the terminal is right now. We'll cover both.

First, the terminology, which is easier than it sounds. A folder and a directory mean the same thing. Interfaces usually say "folder"; terminal documentation often says "directory".

A path is the address of a directory on disk. On Windows, macOS, and Linux the separators look different, but the logic is the same: each part of the path takes you one level deeper. First comes the drive or system root, then the user, the shared projects folder, and finally the specific project.

A full path and an absolute path are the same thing, just two names for it. Such a path starts at the top of the file system: a drive letter on Windows or the / symbol on macOS and Linux. It points to the same place regardless of the terminal's current directory.

A relative path works the other way around: it describes the route from the current directory. It's shorter because the first part of the address can be omitted. Move to another folder, though, and the meaning of the path changes.

Suppose the project contains this file:

demo-project/
└── src/
    └── index.html

The terminal is open at the demo-project root. Here are two ways to reach the same index.html:

SystemFull, or absolute, pathRelative path from demo-project
WindowsC:\Users\student\projects\demo-project\src\index.html.\src\index.html
macOS/Users/student/projects/demo-project/src/index.html./src/index.html
Linux/home/student/projects/demo-project/src/index.html./src/index.html

The dot . means "the current directory". So .\src\index.html and ./src/index.html read as "from the current folder, enter src and take index.html". The dot is often omitted: src\index.html and src/index.html mean the same thing.

If you move from demo-project up into the shared projects folder, the old relative path no longer works. From the new location you need .\demo-project\src\index.html on Windows or ./demo-project/src/index.html on macOS and Linux. The full path doesn't change.

Wrap a path that contains spaces in double quotes; otherwise the terminal decides that a new argument starts after the space:

cd "C:\Users\student\My Projects\demo-project"

Why the current directory matters

A terminal is always in some directory, even before you enter the first command. This is called the current directory or working directory. Commands use it as the starting point for finding files and resolving relative paths.

You already pick the folder with a mouse

Say you need to copy a file from "Downloads" into "Accounting secrets" inside "Documents". You copy the file, walk the whole path to the right folder, and only there do you press "Paste". The file lands on the disk at one specific address. Nobody pastes a file "somewhere into Documents" - you reach the exact spot every time, you just do it with a mouse and never think about it.

The terminal does the same work, except that a path line takes the place of the file manager window. You still pick the directory, and the agent starts working from it.

You can technically open a terminal at the C:\ drive root. Is it a good idea? No. And not because Claude Code will rush off to read every file on the disk - it won't. The problem is that you chose a poor starting point:

  • the agent has no clear boundary around one project - system files, user folders, and your other projects all sit nearby;
  • relative paths begin somewhere you didn't expect - src is suddenly not the src you meant;
  • the path itself says nothing about which project you're working on now.

One more detail that's easy to miss: the file open in IDEA and the terminal's current directory are two separate states. You can be looking at a file from one project while the terminal is still in another. Switching editor tabs doesn't move an already open terminal.

The starting point

The project root is the top-level folder that contains the related files of one project: code, settings, documentation, and other material it needs. You don't have to memorize the formal definition. Think about its role instead: this folder holds one whole project.

For example, a shared projects folder might contain several independent projects:

projects/
├── demo-project/
│   ├── README.md
│   └── src/
└── calculator/
    ├── README.md
    └── src/

In this tree, projects is a container. The first project is rooted at demo-project, the second at calculator. You can technically start an agent from the shared folder, but the context is less useful: two unrelated projects sit next to each other.

In practice, the rule is short: find the top-level folder of the exact project you want to change, open a terminal there, and start your tools from it. Commands, files, and project instructions then stay within one clear area.

A folder that is too broad blurs the task boundary

The agent examines the structure and files around the task to understand the context. Start it too high and other projects appear nearby as well. If the request is vague, the agent may decide that they are related to the task and change something you never asked it to touch.

When you're busy, it's easy to see the expected result and miss extra edits in a neighboring project. The right working directory isn't a formality. It's a clear boundary for the agent.

How javarush-project is organized

And now for the JavaRush case. The IDEA plugin downloads tasks into one large javarush-project tree. From the outside it looks like one project, but there's an important twist inside: every task is a separate project.

Not one file in a shared pile, but a project of its own: its own folder, its own files, and its own agent rules in .claude. One task, one project. Literally.

The simplified tree looks like this:

javarush-project/
└── src/en/javarush/claude/course/level01/
    ├── task05/
    │   ├── .claude/          # agent rules for task05
    │   └── arkanoid.html     # the file for this task
    └── task09/
        ├── .claude/          # separate rules for task09
        ├── arkanoid.html
        ├── clicker.html
        └── tictactoe.html

The same rooms from the analogy above, now with numbers on the doors: task05 and task09. Each has its own documents and its own rules, and javarush-project is the building as a whole. Calling an assistant into the lobby isn't enough - you need to name the room where the work is.

A neighboring task doesn't add useful context to the current one. You don't need the files in task05 to solve task09, and the rules in one folder don't replace those in another. For JavaRush work, the project root is the folder of the specific task, not the shared javarush-project.

One task - one launch

Working on task09? Open the terminal in task09 and start claude there. The shared course root is too broad for this job.

Starting the agent in the task folder

Good news: you don't need to type the long address by hand. IDEA can open a terminal directly in the selected folder.

The steps below show the manual route. Yes, Claude Code can move between directories and run commands in the right folder itself. It's still worth understanding the process once: you don't have to rely on the agent to tell you, and you can see the current task boundary immediately.

  1. Find the taskXX you need in the project tree.
  2. Right-click the task folder.
  3. Select Open In - Terminal.
  4. Check the current directory with pwd.
  5. Check the files with ls.
  6. Make sure the path ends with the right taskXX, then run claude.

IDEA sometimes shows nested package folders as a single dotted line, for example en.javarush.claude.course.level01. Don't retype that line as a disk path. It's easier to open the terminal through Open In - Terminal, or copy the real path with Copy Path/Reference.

If the terminal is already open in javarush-project, you can move manually:

cd src/en/javarush/claude/course/level01/task09
pwd
ls
claude

New task - new working directory

Moved from task05 to task09? The open agent session won't follow the IDEA tab by itself. End it with /exit, open a terminal in the new task, check the path again, and start claude.

One session - one task

Don't mix different tasks in one session. Earlier files, decisions, and assumptions remain in the conversation, so the agent can carry old context into the new work. You end up with a mishmash of two tasks that is hard to untangle later.

We'll look at why session context matters and how to manage it later in the course. For now, keep one simple rule: new task, new session.

You can keep several terminal tabs open, but each one should have a clear task. At first it's easier to close the old session before switching, so you don't have to guess which project the agent is serving.

If the agent was started too high

Does the path end at C:\, your home folder, or javarush-project instead of taskXX? Stop the session, move to the task folder, and start the agent again. Fix the address first, then continue the work.

How this works with Claude Code

Let's put the whole picture together. The terminal gives Claude Code more than a launch command: it also sets the starting point for the project structure, relative paths, and local instructions. The current directory shows where the work begins, and the root of one project hands the agent a connected set of files without noise from neighboring projects.

Two consequences follow, and both are easy to forget when you're busy. An open IDE tab doesn't change the directory of an already running session, so moving to another task means a new directory and a separate session. And inside javarush-project, the root of one project isn't the top of the tree but the specific taskXX folder.

In practice, three quick checks are enough before the claude command:

  1. Check the path with pwd.
  2. Check the files with ls.
  3. Make sure you see only the one project you need, and only then start the agent.

That's it. The terminal doesn't make the work harder here. It makes an invisible setting visible: you know exactly where you are and which project you're handing to the agent.