Skip to main content

Grammar Check

Let AI proofread your writing — directly in your files.

In this task, you'll experience the paradigm shift firsthand. Instead of copying text into a chat box and waiting for suggestions, you'll point AI at your document and let it edit directly.

Prerequisites

Before starting, you should be comfortable with:


What You'll Do

  1. Create a test document with some errors
  2. Ask AI to check and fix the grammar
  3. Review and approve the changes

Time: ~10 minutes


Step 1: Set Up

Open your terminal and create a folder for this exercise:

mkdir grammar-check-demo
cd grammar-check-demo

Create a file called draft.md with some text that needs proofreading:

cat > draft.md << 'EOF'
# My Research Notes

The industriel revolution began in Britain during the late 18th century. It was a period of major changes in agriculture, manufacturing, and transportaton.

Many historians have argued that the revolution was driven by technological inovation, but recent scholarship has emphsized the role of social and economic factors as well.

The impact on working class families was profound. Children as young as five worked in factorys, and working conditions were often dangerous.
EOF

Notice the spelling errors: "industriel," "transportaton," "inovation," "emphsized," "factorys."


Step 2: Run the Grammar Check

Start Claude Code:

claude

At the prompt, type:

Check the grammar in draft.md and fix any errors

Claude will:

  1. Read your file
  2. Identify the errors
  3. Show you the changes it wants to make
  4. Ask for your approval before editing

Review the changes carefully. When you're satisfied, approve them.


Step 3: Review the Results

After Claude edits the file, check what changed:

cat draft.md

The errors should be fixed:

  • "industriel" → "industrial"
  • "transportaton" → "transportation"
  • "inovation" → "innovation"
  • "emphsized" → "emphasized"
  • "factorys" → "factories"

Done. You've just completed your first AI-assisted editing task.


What Just Happened

You gave AI a simple instruction: "Check the grammar and fix errors."

This worked because:

  1. The task was specific — grammar check, not "make it better"
  2. The scope was clear — one file, draft.md
  3. The action was defined — fix errors (not just identify them)

This is prompting in its simplest form.


Going Further: Make It Reusable

What we just did was a one-off task. To make AI follow the same rules every time, you can create an instruction file.

Create CLAUDE.md in your project folder:

# Project Instructions

When proofreading documents:

1. Fix grammar, spelling, and punctuation errors
2. Preserve the author's voice and style
3. Don't change technical terms or proper nouns
4. Present changes in a table before applying them

Now when you start Claude Code in this folder, it reads this file automatically.

Learn more: AGENTS.md Pattern


Key Concepts

ConceptWhat you learned
PromptingGiving clear instructions to AI
AgentsAI that takes action (not just responds)
AGENTS.mdReusable instruction files

What's Next

In the next task, you'll learn how to track changes — seeing exactly what AI modified using version control.

Continue to Track Changes →