Tutorial · 5 min read
Build Your First Claude Code Agent
Hands-On: Build Your First Claude Code Agent
A Support Ticket Analyzer that anyone on your team can run — no prior coding experience required
20 minutes
Beginner
Claude Code
Updated: Feb 28, 2026
Prerequisites
Before we start, you need three things installed on your machine:
- ✓
Claude Code CLI — install via:
npm install -g @anthropic-ai/claude-code - ✓ An Anthropic API key — get one at console.anthropic.com
- ✓ Node.js 18+ — download at nodejs.org
What You’ll Build
By the end of this guide, you will have:
- ✓ A structured Claude Code Project running locally.
- ✓ A “Brain” configured with CLAUDE.md
- ✓ A “Eyes” create sample tickets.
- ✓ Run the agent to write a formatted Markdown report.
Hands-On: Build Your First Claude Code Agent
What We’re Building — and Why This Example
The core insight from Epic’s Claude Code deployment was this: the people who benefited most were not developers. They were support and implementation staff — people drowning in repetitive knowledge work that a well-configured AI agent could handle in seconds.
So our example mirrors that reality. We will build a Support Ticket Analyzer: an agent that reads a folder of incoming support tickets, categorizes each one by issue type and urgency, identifies patterns across the batch, and produces a structured daily briefing — automatically.
No dashboard. No backend. No cloud deployment (yet). Just Claude Code, a folder of text files, and 20 minutes.
Why this matters: A support team processing 50 tickets/day spends 2–3 hours on triage and routing. This agent does it in under 60 seconds, and produces a summary that a team lead can act on immediately.
Set your API key as an environment variable so Claude Code can authenticate:
Mac / Linux
export ANTHROPIC_API_KEY=your_api_key_here
Windows (PowerShell)
$env:ANTHROPIC_API_KEY = ‘your_api_key_here’
Non-developer tip: An environment variable is just a setting your computer remembers for the current session. You paste it into your terminal (the black/white text window) and press Enter. That’s it.
Project Structure: The “Eyes, Brain, Output” Architecture
We will use a three-file structure. Each file has one job:
support-analyzer/
├── CLAUDE.md
← The Brain: tells Claude who it is and how to behave
├── tickets/
← The Eyes: raw input (your support tickets as .txt files)
├── ticket_001.txt
├── ticket_002.txt
└── ticket_003.txt
└── reports/
← The Output: where Claude writes the daily briefing
Create this folder structure on your desktop or documents folder. We’ll fill each piece in the next steps.

Alternatively, navigate to the support-analyzer directory, execute the claude command, and within the Claude environment run the dir command to display the directory structure.
Step 1 — The Brain: Configure CLAUDE.md
CLAUDE.md is the most important file in any Claude Code project. It is a plain text file that tells the agent its role, its rules, and the format it should follow for every output. Think of it as the job description and standard operating procedure combined.
Create a file called CLAUDE.md inside your support-analyzer folder with the following content:
Key insight: This CLAUDE.md is what makes the agent predictable and production-ready. Without it, Claude improvises. With it, every output follows your organization’s exact standards — every single time.
Step 2 — The Eyes: Create Sample Tickets
Create three plain text files inside the tickets/ folder. These simulate real incoming support tickets:
Step 3 — Run the Agent
This is the moment where Claude Code earns its name. Open your terminal, navigate to the support-analyzer folder, and run one command:
bash — support-analyzer
Saturday, February 28, 2026
$ cd support-analyzer
$ claude “Read all tickets in the tickets/ folder and produce a daily briefing”
Watch what happens next. Claude Code will:
- Read your CLAUDE.md and understand its role and output rules
- Scan and read every file in the tickets/ folder
- Reason through category and urgency for each ticket
- Identify cross-ticket patterns (e.g., multiple access issues = potential system problem)
- Write a formatted Markdown report to reports/daily_briefing.md
The entire process takes under 30 seconds for this example. For 50 tickets, expect 2–3 minutes.

Within Claude environment, type the prompt: Read all tickets in the tickets/ folder and produce a daily briefing
What the Output Looks Like
Open reports/daily_briefing.md. You will see something like this:
# Daily Support Briefing — 2026-02-28
## Executive Summary
Three tickets received this morning. One CRITICAL issue requires immediate attention: an enterprise client (ACME-CORP-ENT) has 12 users locked out ahead of a board deadline. A technical regression in v2.4.1 is affecting at least one Business-tier client. One low-priority billing inquiry requires no immediate action.
## Ticket Breakdown
| Ticket | Category | Urgency | Summary |
|---|---|---|---|
| ticket_001 | ACCESS | CRITICAL | 12-user lockout, ERR-4421, board deadline |
| ticket_002 | BILLING | LOW | Plan comparison question, no urgency |
| ticket_003 | TECHNICAL | HIGH | Webhook metadata field missing post-v2.4.1 |
## Patterns & Trends
- ticket_001 and ticket_003 may share a root cause: the v2.4.1 release yesterday. The session token error (ERR-4421) and the missing metadata field could both stem from the same deployment. Recommend cross-checking with the engineering team before treating these as isolated issues.
## Recommended Actions
- [IMMEDIATE] Escalate ticket_001 to Tier 2 — enterprise SLA at risk.
- [TODAY] Confirm with engineering whether v2.4.1 introduced regressions affecting both ticket_001 and ticket_003.
- [THIS WEEK] Respond to ticket_002 with standard plan comparison doc.

Within Claude environment, you will see the output and will be asked if you want to create daily_briefing.md file or not.
What just happened: Claude Code didn’t just categorize tickets. It reasoned across them — noticing that two separate tickets from different companies might share a common cause from the same software release. That is agentic reasoning, not autocomplete.
Level Up: Three Easy Extensions
Once your basic agent is running, these three additions take it from a demo to a daily workflow tool:
1.Auto-run every morning
Add a cron job (Mac/Linux) or Task Scheduler entry (Windows) to run the agent automatically at 8 AM every day:
# Add to crontab (run: crontab -e)
0 8 * * * cd ~/support-analyzer && claude "Read all tickets and produce a daily briefing"
2.Send the briefing to Slack
Add one line to your CLAUDE.md instructions to have the agent post the briefing summary directly to a Slack channel via webhook:
## Additional Output
After saving the report, POST the Executive Summary section as plain text to:
SLACK_WEBHOOK_URL (set as environment variable SLACK_SUPPORT_WEBHOOK)
3.Add a knowledge base
Create a knowledge/ folder with your FAQ docs, known-issue lists, and escalation procedures. Update CLAUDE.md to tell the agent to reference these when generating recommended actions. Now the agent’s output reflects your team’s actual playbooks — not generic advice.
The Bigger Picture
What you just built in 20 minutes is exactly what Epic’s support staff discovered on their own: a tool that removes the repetitive cognitive load from knowledge work and returns it as structured, actionable output.
The CLAUDE.md file is the key. It is what separates a one-time demo from a production-grade tool. Every rule you add, every format you specify, every edge case you define makes the agent more reliable and more aligned with how your team actually works.
This example uses three tickets. Your real deployment might use 300. The command is the same. The output structure is the same. The time investment from your team is zero.
That is what agentic AI actually looks like in practice. Not a chatbot. An employee.