MODULE 01

FROM CHAT WINDOW TO COMMAND LINE

Move from browser-based AI to terminal tools, then build a persistent beat environment with a CLAUDE.md context file — so every session starts with the AI already knowing your work.

Welcome to the course

TRANSCRIPT

Welcome to Advanced Prompt Engineering for Journalists. Over the next four weeks, we're going to work together to try to build something real. A journalism tool, or app, or workflow, or automation built with AI that lives on GitHub and that is ready to share with your colleagues for you and them to use. Each module in this course represents one stage of that process.

Here's how this is going to go. The first week, we're going to have you install a command line interface or CLI tool and we're going to have you write a context file for your beat or your area of focus and we're going to use that tool and our context or memory file to work on real data or documents. This can be press releases, data sets, town council meeting transcripts, you name it and we're going to do all of this from the terminal or PowerShell or command line, whichever you prefer. By the end of week one, you will have a working project on GitHub and you'll have a familiarity with the command line as the new tool and interface that you'll be using to talk to your favorite large language model or AI tool.

Week two, we're going to take those repetitive tasks and workflows that you use and we're going to turn them into an actionable command or skill that the AI can use in a repeatable fashion so that it does the same thing each time. These slash commands and skills take your best prompts and workflows and turn them into a repeatable and shareable skill.

In week three, we'll move towards describing an automation or a process in plain language and working with an AI tool via the command line to build that tool in front of your eyes. You'll test it, debug it and fine tune it to make sure it works and it works the way you want and along the way you will learn this loop in this process so that you can repeat this over and over again for different tasks.

In week four, we take those systems and those automations that you've worked to develop and we'll connect them to live real living data via API, MCP, Model Context Protocol or another proprietary CLI tool set that allows you to talk to your data in real time and connect it to your AI tools. We'll also talk about how to handle things that break, security vulnerabilities and best practices to make sure that your API keys and your bank account doesn't get leaked across the entire internet and we'll make sure that our project is ready to publish and make public on GitHub.

Each module and week of this course builds on the previous weeks and the things that you've learned along the way and in the end, we will have a single repository with context files, documents and data, skills and workflow scripts and data connections that allow anyone who clones that repository to use it for themselves by plugging in their own inputs and making it useful for their organization.

The key shift across this four week course is most of you are used to using these tools in the web interface. You're talking to ChatGPT.com or claude.ai. All of that's happening in a chat window and what we need to do is we need to escape that chat window and bring these tools into the folders and files on our computer and in our GitHub repositories where they can do real work and actually manipulate and build tools to work with this data that work in the real world, not just in the chat window.

The good news is the AI and these LLM tools via the command line handle all of the heavy lifting when it comes to the coding and even pushing and pulling from your repositories which we'll talk about later. All you need to do is make sure that you are clearly articulating exactly what you need, how you need it and what it needs to do and that's something most of you are already pretty familiar with and I would say probably pretty good at.

Now before we get started there are three things that will help you succeed and get the most out of this course. One, you need to do the exercises. These are useful even if they may seem basic or rudimentary at some level. They're really useful when understanding the interplay and the relationship between the tools, the data and the platform where we're going to publish all this stuff, namely GitHub. Two, you need to engage and post in the forums. Talk to your fellow classmates. Ask questions of me. Engage with the material in a way that allows you to explore this stuff at a level that's a little bit deeper than simply reading the readings, which side note is also very important for this course. And the third thing is to get started early. Install all the necessary products. Make sure your computer is up to date. Make sure you have a paid subscription to one of the three major AI tools. That's ChatGPT, Codex, Gemini or Claude or Claude Code in this case. This course is about serious work and you cannot get serious work done with these tools if you're using the free version. The key here is to have these tools ready to go early so that when we start the course you're not spending a bunch of time debugging and reinstalling and trying to figure out how to get them to open in the first place.

So if you're ready, here's what you can do right now. Start by reading the course requirements document and going over the syllabus. Check to make sure you have the required level of administrator access in order to install these tools and use them on a regular basis. And check out the required and additional recommended readings in the introductory module of the syllabus. And when you're ready, I'll see you in module one.

Escaping the browser

In this video, Joe walks through why CLI tools matter, demonstrates Claude Code vs. Claude.ai side by side on a research task, sets up a CLAUDE.md using /init, and shows how global and project-level context files work.

TRANSCRIPT

All right. Hey there. I'm Joe Amditis. I am Associate Director of Operations at the Center for Cooperative Media at Montclair State University, and this is Advanced Prompt Engineering for Journalists.

This is a follow-up to my earlier course from last year, which focused on beginner prompt engineering principles, tactics, and tools. And this course is primarily about getting you out of the web chat interface, where you open the browser and go to chatgpt.com and use your custom GPTs. We're gonna escape that. We're gonna get out of the browser and bring these tools onto your local machine where they can interact with, edit, create, or delete, in some cases, real files and folders.

And I know some of you, uh, are probably using company machines or laptops or computers where you don't even have access to that kind of, uh, admin privileges, and the IT department or IT guy that you frequently interact with would probably lose his mind, uh, if you ask them for a direct route access into the shell of a company machine. So fear not, if you are unable to or unwilling to, uh, use the terminal or command line, um, there are other options. You can use your favorite IDE, your favorite integrated development environment, like VS Code, Antigravity, if you're one of those people, Cursor, Windsurf. There's a million of these things out here.

Um, so whichever one you like best, as long as you're able to interact with a large language model, in particular a paid subscription or API usage version of either Gemini, ChatGPT, Codex, uh, or Claude and Claude Code. As long as you have access to one of those, I don't care if you use it in Antigravity or you're using it in the terminal, just know that I will be using PowerShell primarily. Um, and so any of the things that I do or things that I explain will be geared towards that modality. I do have a bunch of resources on the, uh, MOOC website that we, uh, I created for this course, mooc.amditis.tech.

Uh, I also have tools.amditis.tech. I'll put both of the links on the screen right here, uh, and I'll make sure that that is kept up to date for you to browse and copy or fork or whatever. But that's where, how we're gonna be working with this stuff. Another, uh, platform that we're gonna be using that is not necessarily required but highly recommended if you don't already have one, is a GitHub account.

Personally, I've spent about the last year really burying myself in GitHub and trying to understand how it can be useful, and, uh, it, it's only somewhat recently that a lot of the things have started to click. Uh, I'm gonna be talking and approaching these things from the perspective of someone who is completely, almost completely self-taught on this. And, uh, the reason why I feel qualified to do that is because I think a lot of you are also in a similar position, uh, where you don't have the time, money, or attention span maybe to, uh, to enroll or invest in yourself in that way and get a full software engineering degree, and that's fine. Um, we're gonna be focusing on a lot of the stuff in this course from the perspective of someone who is not an expert software engineer.

So if you are, and you notice something that I say is either wrong or could be bet- phrased better or there's a better solution, go to the instructor forums. Go to the discussion forums. Uh, let me know. We're gonna talk about all that stuff as we go on, but the f- the main thing that you should know about this is you need a paid account for one of the three major models.

That's ChatGPT or Codex, Gemini, Gemini CLI, or Claude and Claude Code from Anthropic. The twenty dollar a month plan is fine. If you decide to use the API, that's also fine, although I've done the calculations on this, and it's very obvious that it's way more expensive to do the cost-by-use API style, uh, subscription, but if that's what you have access to, that's fine. The only thing is you will not be able to do most of the things that we are doing here with a free account.

The only exception is possibly Gemini, uh, which does have a free plan that allows you to use their CLI agent, um, in whatever tool you're deciding to use. There are also other, uh, tools that you can use that are still browser-based but do somewhat similar functions, things like, uh, the Google AI Studio, Replit, Lovable, and if you've used any of those tools already, um, you probably have some idea of what I'm talking about. But for what we're doing, I'm gonna be showing you PowerShell stuff, mostly with Claude Code. But what you need to know for now is we're escaping the browser.

We're getting out of the browser. We're getting onto our machines. And the reason is that these tools are much, much more powerful, and you can accomplish and achieve and build a lot more and more useful things if you are able to take advantage of the processing power and the ability to run scripts and workflows, schedule cron jobs and recurring tasks, uh, scrapers, letting something run overnight without having to be mediated through the web browser. Um, so that's the value here.

That's why we're, we're so focused on getting you out of the browser, even though we will return to the browser for various things, one-off tasks, maybe even to manage remote sessions on the Claude web app from your phone on your mobile browser. But, uh, the majority of what we're doing is gonna be in the, in the PowerShell or in the terminal. When it comes to GitHub, GitHub is gonna serve as our sort of, um, a very simplified, maybe oversimplified comparison, but a sort of like our Google Drive for our code. And I say that specifically because before I knew about GitHub and before I became familiar with it over the last year, uh, I straight up was using Google Drive to store and sync up my code.

And what it resulted in was a nightmare of version history mismatches and version control nightmares and rewrites and overwrites, um, you know, accidental deletions. It was a nightmare, and, uh, GitHub, uh, saved me from all of those nightmares. So if you are unfamiliar with it or if you're really familiar with it, uh, it's important. We're gonna be using it, uh, even though not all of our projects necessarily would require GitHub.

So why don't we pause there, and let's start at the beginning, and let's get you set up with one of your agentic CLI agents on your own machine. All right. Now, before we officially begin, there are a few core concepts that I think it's important that we understand or at least touch on before we jump in, and one of them is why we want to escape the chat window of the browser. Um, and for this, I recommend reading Ethan Mollick's piece on the harnesses that the AI tools like this use.

Um, but essentially, it boils down to a sort of an argument that the tools you're interacting with, the models, the large language models, um, they behave differently based on the environment in which they are operating. And the different harness that you give this model impacts its capabilities and its reactions, but also the, the tools that it has access to. And so when you're in something like a web browser chat app, not only are you saddled with the system administrator prompt deep in the background that tells the bot that it's interacting in a chat interface on the web, possibly in a mobile browser or a desktop browser, um, and therefore to guide and gear its responses toward a more chatty, conversational atmosphere or environment, um, you're also limited by the actual harness of the mediated technological relationship, the, the connection, uh, and the tools that are incapable of being deployed by a, a model that's running in a cloud, you know, in your browser, uh, and connecting to you over the internet versus the harness of something like a Claude Code harness, which is the, uh, set of tools and the environment in which it allows the command line interface version of the Claude models, uh, to interact with. It gives it different tools.

It premises it with a different system prompt to let it know that it's gonna be doing certain types of tasks and that it will have access to file structures and folders. Um, and, and this kind of apparatus that, uh, these tools are given, uh, changes how valuable, how effective, and how focused they are on different tasks and purposes. So with that out of the way, I'm gonna show you my setup, and we're gonna walk through some of the basic commands and what it looks like when you first start up Claude Code. All right, so the first thing I wanna do if I wanna get Claude Code into my terminal is I gotta open the terminal, and I'm gonna use PowerShell, Windows PowerShell, and I need to get Claude Code into a specific folder where I want it to live.

Because I don't wanna open it inside of the core folders that make up the base foundation of my computer's hard drive. So in order to do that, I'm just gonna create a new folder on my desktop. I'm gonna call it MOOC, or I can call it Claude Code, or you can call it whatever you want. And I'm gonna open that folder.

And now, what I wanna do is I wanna navigate to that folder. So I'm gonna copy the address, the path for this folder. You can also do it by right-clicking and selecting Copy as Path. And then I'm gonna type CD, which means change directory, and I'm just gonna paste that path. So now I hit Enter, I've changed the directory. Now I'm in this directory, and you can see that's on my desktop.

And now the only thing left is to just type the name of the agent that you want to appear. For us, it's Claude, so I'm gonna type Claude. And if you've gone through the installation process correctly, this should pop up or some version of this should pop up, and you should see Claude Code. If you haven't gone through the process of installing and setting it up, go look at the documentation or the instructions on each of the major three AI LLM bots. ChatGPT, Gemini, and Claude all have setup instructions that are pretty easy to follow. And if you have any trouble, you can always ask Claude in the web or ChatGPT to walk you through that process and it usually works every time.

So I'm gonna select Yes, I trust this folder. And we can see right away that Claude is loading up. And we can look around here, this interface. This is the interface that you're gonna be using. You can type in here. You can use backspace. You can paste things by right-clicking or Control-Shift-V or Control-V. There's a slightly different way to interact with the terminal than you would a normal text interface, but you'll pick it up quickly enough.

We can also see the version and model of Claude Code. We can see that it's found one setting issue for me. We're not gonna worry about that. I have my status line down here set up to tell me what model I'm using. You can see the subscription model, and then I can always type a slash to pull up the different commands that are available. I want you to go ahead and play with all of this, but one thing you can do is you can just start with saying hello.

And as you can see, it does it just like your normal Claude or ChatGPT interface. It's a regular natural language interface that you're gonna talk to Claude with. And just to show you the difference between what the terminal-based version can do versus the web, let's go ahead and open a new browser window, and I'm gonna put Claude on the left here, and I'm gonna put Claude on the web on the right, and we're gonna ask the same thing.

I'm gonna say, "Look on the internet and find everything you can about the Center for Cooperative Media, and then give me a report on it." And I'm gonna copy this, and I'm gonna put it over here, and we're gonna send them both off at the same time. They're both gonna be using Opus 4.6. Let's go, and let's see what the difference is. You'll see on the left, Claude is automatically loading up a skill using Firecrawl, and it's gonna be asking me for permissions. So before it even is able to do anything, it is asking me for permission to do it. So I'm gonna say yes, and don't ask again.

And Claude on the web is already responding. Claude Code is asking for more permission. And Claude on the Web is already done. So Claude Web wins this one so far. It's got some citations here. Claude over here is still asking for permission. And if we look, we've already got two folders in here, and Claude Code has gone through, and it has extracted all of the data or all of the content using Firecrawl from its research, whereas Claude on the Web just gave us links to citations.

Speed, Claude Web clearly wins. Depth, Claude Code seems to be going much further. We've got a much more complete list of current staffers. We've got bulleted lists. We've got all kinds of information here that is more deep and thorough than the report that Claude on the Web gave us. And that is not the only difference here, because now what I can do here is I can come over to Claude Code, and I can ask it to make more files. As you can see, it's already created some files based on its research. Now I can come back, and I can say, "Use the information you found to create detailed profiles on each staff member and project and put them as individual markdown files in a new folder in my directory."

And now the beauty of this approach is these files and this folder, everything in this folder now exists and will be used or capable of being used by every additional or subsequent session of Claude Code. Whereas if I'm using something like this on the web, the closest thing I can get is using projects on the web. And even then, the files aren't guaranteed. There's a lot less customization you can do.

Meanwhile, Claude on the Web has already reached its tool use limit. So I can click Continue here and see what it's able to do, but we've already hit a hard wall, and everything that we've done in this chat now, it lives only in this chat. And Claude Code is already finished. All of them include structured metadata, descriptive content with a background, key roles, and staff leads.

So already we've seen the benefit here of the expanded context window, the additional ability to run tasks and run tools. Not just the fact that it has more space and more power, but that it can do things and save them in the background so that if we do get cut off at any point, I can simply go back and see what it's put together, and I have something ready to go.

And now we're gonna transition a little bit. Now that we have some materials in the base folder here in our MOOC directory, we wanna give Claude an opportunity to get a sense of what is in this directory, and we're gonna give it a document that allows it to understand and remember how it is supposed to interact with the files and the folders inside of this folder every time that we come back to it, every time we open up a new chat.

I can do /q to quit, and then I can hit the up arrow and call Claude again in that same folder, and I'm starting a brand-new session now. I don't have any of this stuff here. So this is a brand-new chat, and what I can do now is because we have stuff in this folder, we're gonna go ahead and tell Claude to explore it and set up a set of instructions called the claude.md file. If you're using ChatGPT, it'll be called agents.md. Gemini is called gemini.md. You create them using all three of them in the same exact way. You type /INIT, and this is gonna initialize a new claude.md file with complete code-based documentation.

Just popping in here to let you know that there are a variety of other commands and ways that you can interact with Claude Code with slash commands. You can use the @ sign to tag specific files or folders, and all of that is detailed and laid out at tools.amditis.tech. I put that together so you can go through and find all of the different ways that you can interact with Claude Code.

Now it's given me its breakdown of the claude.md file, and I'm gonna say, "Go ahead and create the file." And there it goes. It has written the file, and we now have a new claude.md file in our repository. This is gonna be your bread and butter. You're going to treat this like the core instructions that it's gonna read every time you start Claude Code in this setting because that's exactly what's gonna happen.

Every time Claude Code launches in this directory, it is first going to ingest and read the claude.md file. So if I edit this and I say, "This is for Joe Amditis. You are always to refer to Joe as Senator Joe, and end every response with, 'That is all, Senator.'" And now I'm gonna save that, and we're gonna launch a new Claude Code instance and see if it actually follows instructions.

There it is. What is this folder about? And you can see here, I'm just talking with it like I normally would. I'm writing in plain English. I'm not even capitalizing. I'm not doing proper punctuation. I can iterate. I can ask follow-ups. And there it is. "That is all, Senator." So it instantly and immediately ingests the information in claude.md, and it responds and follows those instructions most of the time.

Now, there are different versions of the claude.md file that we just made. There's one that lives at your user level. This is sort of your global version. It's in a folder called .claude, and you can find it inside of the folder for your user for that machine. And then there are individual project-level ones for each of the projects that you work on, and those should be updated and refreshed frequently.

So for the global one, you're gonna wanna put things like your style preferences, the way you like to have it write, the files you're working on. Oftentimes, I will put things that I am proficient in so that it doesn't treat me like a baby and then also include things that I am a novice in so that it does treat me like a baby. For the project-level Claude files, that's where you're gonna wanna put things that you need it to remember about working on that project.

When it makes mistakes or it misunderstands or misinterprets one of your instructions, go ahead and add a reminder to claude.md for that project. When you have specific information or workflows that you need it to remember, that goes in the project-level claude.md. Over time, you'll get used to this back and forth, and you can and should have Claude work with you to update it by simply telling it to add that to the claude.md or add that to our memories or create a new lesson based on that learning.

There are also several different configuration files and settings that you can set up in Claude Code. One of my favorite modes is called explanatory output mode, and you can access that by doing /usage and then go through the configuration settings there and toggle them on or off. Explanatory output is a really useful tool because instead of just giving you an answer, it gives you a breakdown that explains why it did what it did and why it's important.

Now it's your turn. You're gonna take everything you've learned and everything that we've gotten from the readings and the resources so far, and you're going to set your station up. We're gonna get you set up with your Claude Code, your claude.md or agents.md. You're gonna play around with the settings. You're gonna get comfortable with it, and then it's time to move forward to a little bit more advanced usage, and we're gonna actually start to do things with it. So we will see you in the discussion forums, and I will see you in the next video.

Learning objectives

  • > Install Claude Code and run your first interactive session
  • > Explain the practical differences between browser-based and terminal-based AI workflows
  • > Execute basic AI prompts from your terminal
  • > Explain what project context files are and how they differ across tools (CLAUDE.md, GEMINI.md, AGENTS.md)
  • > Create a CLAUDE.md context file using the /init command and customize it for your beat
  • > Process journalism documents with and without context, and compare the results
  • > Identify journalism tasks that benefit from programmatic AI access

Before you start

You've used AI through a browser — typed a prompt, read the response, copied it somewhere. That works for quick questions, but a chat box can't run a scraper overnight, process a 500MB dataset, or write files to your hard drive. CLI tools give the AI access to a real machine with real compute power. You can leave a task running while you do other work, process documents too large to paste into a text field, and access local files directly — no uploading, no downloading, no clipboard. The model is the same. The difference is what it can reach.

The second half of this module solves a different problem: every time you open a new chat, the AI starts blank. It doesn't know your beat, your publication's style, or what you were working on last session. A context file — CLAUDE.md for Claude Code — is where you put that background once, so you never have to retype it.

Key concepts

Why leave the browser?

Web-based AI tools like ChatGPT and Claude.ai are convenient, but they run in a sandbox — you can't leave a scraper running, process a dataset that won't fit in a text box, or write output directly to your project folder. CLI tools give the AI access to your actual machine: your filesystem, your network, your compute power. It can read and write files, chain operations together, run long tasks in the background, and integrate with version control. CLI tools give you a real machine, not a sandbox.

What is a CLI?

A command-line interface (CLI) is a text-based way to interact with your computer. Instead of clicking buttons, you type commands. This might feel unfamiliar at first, but it gives you precise control and the ability to automate repetitive work. Think of it as learning keyboard shortcuts for your entire computer.

Node.js and npm

Node.js is a runtime that lets you run JavaScript outside a web browser. npm (Node Package Manager) comes with it and lets you install tools others have built. Many AI CLI tools, including Claude Code, are distributed through npm.

The terminal vs. web interface trade-off

Web interface advantages: No setup required, visual formatting, easy to share conversations.

CLI advantages: Direct file access, real compute power (run scrapers, process large datasets), automation, piping between tools, no copy-paste friction, works offline (for local models).

Working inside a session

Once you type claude and press Enter, you're inside an interactive session. The terminal becomes a conversation interface — paste prompts the same way you would in a browser.

  • Ctrl+C — interrupt whatever Claude is doing; press twice to exit

To continue a previous session after a break, run claude --resume from the same directory. Session commands like /help, /plan, /compact, and /clear are covered in Module 2.

What goes in a context file

A context file contains the things that make your project different from every other project — not things that are true of all journalism. Good content: your beat entities, beat-specific terminology, style preferences that differ from defaults, source attribution standards you want enforced, phrases to avoid. Bad content: "be helpful," "write clearly," "verify facts" — generic instructions the tool already tries to follow.

Think of it as a briefing document for a new reporter joining your beat. Not the journalism 101 stuff — the specific things about your coverage area and your newsroom's conventions.

The deletion test

Before saving a line to your context file, ask: if I delete this, would the AI's output change for someone who already knows my beat?

An experienced city hall reporter doesn't need to be told "verify facts before publishing." But they might need to know "the city uses 'resolution' for binding votes and 'ordinance' for legislation — don't confuse these." The first is generic. The second is beat-specific context that changes the output.

If deleting a line changes nothing for a knowledgeable reporter, cut the line.

Context files should be versioned

Your CLAUDE.md is infrastructure. Not a note to yourself — infrastructure. It gets committed to Git, versioned alongside your project files, and shared with colleagues when you share the project. When you push a project to GitHub, your context file goes with it. When a colleague clones the repo, your accumulated beat knowledge is already there.

This module introduces Git basics — what a repository is, what a commit does, what cloning means — because context files, skills, and workflow scripts are all shared through GitHub repos. You don't need to memorize Git commands; your CLI tool can run them for you. But you need to know what you're asking for and why.

EXERCISE

PART 1 — CLI SETUP AND COMPARISON

GOAL: Run the same task in a browser interface and in Claude Code, then compare what each one required of you.

01 Install Node.js

Download and install Node.js from nodejs.org. Choose the LTS (Long Term Support) version. The installer will also install npm.

After installation, open your terminal and verify:

terminal
node --version
npm --version

You should see version numbers for both. If you get "command not found," restart your terminal or computer.

02 Install Claude Code

Claude Code is Anthropic's official CLI for Claude. Install it with:

terminal
curl -fsSL https://claude.ai/install.sh | sh

Then type claude to launch it. The first time, you'll go through a one-time setup — granting permissions and logging in with your Anthropic account. After that, typing claude opens a session immediately.

terminal
claude

Follow the prompts to log in. You'll need an Anthropic account with API access.

03 Try the task in a browser

Go to claude.ai and paste this prompt:

claude.ai
Summarize this news brief in one sentence:

The city council voted 5-2 yesterday to approve a $2.3 million budget for road repairs. Council member Jane Smith opposed the measure, citing concerns about contractor selection. The repairs will begin in March and affect Main Street, Oak Avenue, and Park Road.

Note what it took: open a browser, navigate to the site, paste the text manually, read the response. That works fine for one article.

04 Do the same task in Claude Code

Open your terminal and type claude to start a session. Then paste this prompt:

claude code
Create a file called test-article.txt with this content: "The city council voted 5-2 yesterday to approve a $2.3 million budget for road repairs. Council member Jane Smith opposed the measure, citing concerns about contractor selection. The repairs will begin in March and affect Main Street, Oak Avenue, and Park Road."

Then read the file and summarize it in one sentence. Save the summary to summary.txt.

Claude creates the files, reads them, and saves the output — without you touching the clipboard. Try following up: "Now do the same for every .txt file in this folder."

05 Compare the experience

In the video, you saw this comparison in action — the same research task run in Claude on the web and Claude Code simultaneously. Claude on the web finished faster but hit its tool use limit. Claude Code saved files to the filesystem that persist after the session. Now try a simpler version yourself.

Consider these questions:

  • > Which workflow required more steps from you?
  • > Which would scale better if there were 50 articles in a folder?
  • > What happened to the output in each case — where did it go?

PART 2 — PROJECT CONTEXT

GOAL: Set up a CLAUDE.md context file using /init, customize it for your beat, and verify it works across sessions.

06 Run /init to create your context file

Inside your Claude Code session, type the /init command. This walks you through creating a CLAUDE.md file with sensible defaults based on your project directory.

claude code
/init

Claude will scan your project and generate a CLAUDE.md with sections for project overview, conventions, and key files. Review what it created before moving on.

07 Customize it for your beat

The /init output is a starting point. Now add the beat-specific context that makes it yours. Ask Claude to help:

claude code
Read my CLAUDE.md and add these sections: my beat covers city hall in Greenfield — add the key entities (mayor, city council, departments), my style rules (AP style, Oxford comma, "the city" on second reference), terminology that's specific to my beat (resolution vs. ordinance), and a "things to avoid" section with phrases I don't want in output.

Adapt the prompt above for your own beat. The goal is to add information that would change how Claude handles your documents — not generic journalism instructions it already follows.

08 Test it in a new session

Quit Claude Code with /q, then relaunch it from the same directory. This starts a fresh session that reads your updated CLAUDE.md on startup.

terminal
claude

Now ask it something that tests whether the context loaded:

claude code
What do you know about my beat and my style preferences?

If Claude can describe your beat, your style rules, and your terminology, the context file is working. If it can't, check that CLAUDE.md is in the directory where you launched the session.

PART 3 — CONTEXT IN ACTION

GOAL: Process journalism documents with and without your context file, and compare the results.

Pick whichever scenario is closest to your work. The steps below use "city hall beat" as the example, but adapt the folder name, sample documents, and context file to match your choice:

  • A. City hall / municipal beat — press releases, council minutes, interview notes, reader tips. Good if you cover local government.
  • B. Data tracking project — public spending records, census tables, grant databases, FOIA responses. Good if you work with datasets or public records.
  • C. Content processing workspace — story drafts, source transcripts, editorial calendars, style guides. Good if you're building newsroom tools or managing production workflows.

09 Fork and clone the starter kit

Go to the course starter repo and click Fork (top right). This creates your own copy on GitHub that you can push to freely.

Once you've forked it, clone your fork and step into the folder:

terminal
git clone https://github.com/YOUR-USERNAME/mooc-starter-kit.git
cd mooc-starter-kit
claude

Replace YOUR-USERNAME with your GitHub username. The repo already contains sample journalism documents in sample-docs/, skill templates, starter scripts, and a CLAUDE.md with placeholder sections you'll customize.

This step matters: Claude Code reads context files from wherever you launch it. When you launch claude inside this folder, it reads the CLAUDE.md automatically.

10 Explore what's in the repo

You're inside a Claude session. Ask it to show you what you're working with:

claude code
List all the files in this project and give me a one-sentence description of what each one contains

The repo is already a Git repository (you cloned it from GitHub). Claude can read every file in it. Notice that it found the CLAUDE.md and the sample documents in sample-docs/ — those are the files you'll work with in the next steps.

11 Process documents without context

You're already inside a session from Step 9. The repo has a CLAUDE.md, but it's still the starter template with placeholders — Claude has no real knowledge of your beat yet. Paste these four prompts one at a time:

claude code
Read sample-docs/press-release-park-closure.md and write a 3-sentence summary suitable for a news brief
claude code
Read sample-docs/council-minutes-excerpt.md. List every factual claim made by a council member, and note which are attributed to a named source vs. unattributed
claude code
Read sample-docs/interview-notes-martinez.md. What follow-up questions should I ask? Flag any claims that need independent verification
claude code
Read sample-docs/tip-email.md. Is this tip actionable? What would you need to verify before pursuing it?

Note the responses — you'll compare them to the with-context versions in Step 13.

12 Write your CLAUDE.md

Your repo already has a CLAUDE.md with placeholder sections. Open it and replace the placeholders with your own beat information. You can do this by asking Claude:

claude code
Read my CLAUDE.md and show me the placeholder sections I need to fill in. Then help me customize it for a city hall beat covering Greenfield city government.

Required sections:

  • Beat description — what you cover, key entities (city name, current officials, agencies)
  • Style rules — AP style, Oxford comma, how to refer to the city on second reference
  • Source standards — how to handle attribution, what to flag as unverified
  • Terminology — beat-specific terms the AI might confuse
  • Things to avoid — phrases or patterns you don't want in the output
  • Hard-won lessons — leave this section empty for now. Add entries as you correct the AI over time.

Apply the deletion test before saving: read each line and ask whether it would change the AI's output for a knowledgeable reporter. If not, cut it.

Then commit it — your context file is infrastructure, not a draft:

claude code
Commit my updated CLAUDE.md with the message "Customize context file for city hall beat"

13 Process the same documents with context

Exit the current session (Ctrl+C twice) and relaunch from the same directory. This starts a fresh session that picks up your new CLAUDE.md:

terminal
claude

Run the exact same four prompts from Step 11. Don't change anything — the only difference is that CLAUDE.md now exists and Claude read it before you typed a word.

Compare the responses side by side. Look for specific differences: terminology, attribution handling, style choices, what Claude flagged as needing verification.

Checkpoint

Self-check: Make sure you can answer these before moving on.

  • ? What command shows your installed Node.js version?
  • ? Why might a journalist prefer CLI tools over web interfaces for batch processing?
  • ? What is the deletion test, and how do you apply it to a line in your CLAUDE.md?
  • ? What filename does Gemini CLI use for its context file? What about Codex?
  • ? What does a Git commit do? Why should your CLAUDE.md be committed?
  • ? What changed in the AI's output once CLAUDE.md was present? Give one specific example.

Resources

Read before the exercise

  • [DOCS] Claude Code documentation — official setup guide, command reference, and CLAUDE.md documentation
  • [DOCS] Claude Code memory and CLAUDE.md — official documentation
  • [DOCS] Gemini CLI configuration and GEMINI.md — official documentation
  • [GUIDE] Introduction to Node.js — background on the runtime

Read after the exercise

  • [READ] What is Git? — Pro Git book, chapter 1
  • [COURSE] The Missing Semester: The Shell — MIT's free course on command-line fundamentals

Troubleshooting

"command not found: node"

Node.js isn't in your system PATH. Try restarting your terminal. On macOS, you may need to restart your computer. On Windows, make sure you checked "Add to PATH" during installation.

"permission denied" when installing globally

The native installer handles permissions automatically. If the curl install fails, see code.claude.com/docs for platform-specific instructions.

Claude Code says "unauthorized"

Your authentication may have expired or your API key may be invalid. Run claude again to re-authenticate, or check your Anthropic account for API access issues.

CLAUDE.md doesn't seem to be working

Make sure the file is named exactly CLAUDE.md (all caps) and is in the same directory where you're running the CLI tool. Run ls to confirm.

The AI is ignoring a rule in my context file

Check whether the rule is specific enough to affect output. Vague instructions ("write clearly") rarely change behavior. Specific ones ("refer to the agency as 'the Department' on second reference") do. If the rule is specific and still ignored, try moving it higher in the file.

Git says "not a git repository"

You need to run git init (or ask the CLI tool to do it) in your project directory before using Git commands. Check that you're in the right folder with pwd.

The AI can't find my document file

File names are case-sensitive on macOS and Linux. Make sure the name in your prompt matches the actual filename exactly. Use ls to list files in the current directory.