Tools & troubleshooting
Advanced: Use Claude Code to Check JSON Exports Before You Share Them
Cihan's view: Give Claude Code a read-only inspection brief, ask for a validation report, and review the report and proposed fixes before changing or sharing any export.
A JSON export can look tidy and still contain a missing ID, an empty email field, or a date in the wrong shape. The first useful step is often a report, not an automatic fix.
This advanced builder lesson uses Claude Code in a local folder to inspect two fictional JSON files. It produces a validation report and leaves the originals alone. It does not connect to a customer system or upload anything.
Evidence label: Documentation-based and illustrative. Anthropic documents Claude Code’s terminal surfaces, file access, command execution and permission controls. The files and expected report are fictional. No Claude Code run or validation result is claimed.
What you will make
You will create a small local folder containing two JSON exports and a plain-text validation report. The report checks:
- each record has an
id - each record has a non-empty
email statusis one ofactive,paused, orclosedcreated_atusesYYYY-MM-DD
The original JSON files remain unchanged. The decision is whether the export is ready for a human to inspect, not whether it is safe to import.
Prerequisites
This is Advanced builder content. You need Claude Code installed and an approved local terminal session. Claude Code can read a codebase, edit files and run commands. Its permission system distinguishes file reads, shell commands and file modifications, so review each approval and do not use a bypass mode for real data.
Create a new empty folder and add these complete files.
customers-good.json
[
{"id":"c-101","email":"ana@example.test","status":"active","created_at":"2026-10-12"},
{"id":"c-102","email":"omar@example.test","status":"paused","created_at":"2026-10-13"}
]
customers-review.json
[
{"id":"c-201","email":"lea@example.test","status":"active","created_at":"2026-10-14"},
{"id":"c-202","email":"","status":"active","created_at":"2026/10/15"},
{"email":"mert@example.test","status":"closed","created_at":"2026-10-16"},
{"id":"c-204","email":"seda@example.test","status":"pending","created_at":"2026-10-17"}
]
Use fictional files while learning. Never paste credentials, production exports or personal data into an unapproved coding session.
Three steps
1. Start in the export folder
Open a terminal in the folder that contains only the two JSON files. Confirm the path and list the files yourself before starting Claude Code. The no-code alternative is to use a local JSON linter and a spreadsheet or script to check the four rules manually, then compare each flagged row with the source.
2. Ask for a read-only validation plan
Run Claude Code from that folder and paste this instruction:
Inspect only the JSON files in the current folder. Do not edit, rename, move, delete, upload, commit, or send any file.
Create a proposed validation report named VALIDATION-REPORT.md, but stop and ask for approval before writing it. The report must check every JSON array record for:
1. a non-empty string id
2. a non-empty string email
3. status equal to active, paused, or closed
4. created_at matching YYYY-MM-DD
For each failure, include the filename, zero-based array index, field, observed value, and a plain-language reason. Include the number of records inspected per file. Do not infer whether an email is deliverable. Do not change the source files.
Before any write, show the exact report content and explain which permission is needed. If a file is not valid JSON, report the parse error and stop.
Review the plan. If Claude Code proposes a write before showing the report, decline it. A read-only first pass is the point of the exercise.
3. Review the report and source rows
If you approve creation of the report, ask Claude Code to write only VALIDATION-REPORT.md. Then open the report and the original files side by side. The expected illustrative findings are a missing email and invalid date in customers-review.json, a missing id, and a disallowed pending status. Those are expected findings from the fictional input, not a reproduced run.
Checkable artifact
The report should include:
- a record count for both files
- the filename and zero-based index for each failure
- the observed value, including an empty string where relevant
- the rule that failed
- a statement that source files were not modified
A report that only says invalid data found is not enough to review.
Acceptance checks
The workflow passes when:
- both source JSON files are still byte-for-byte unchanged
customers-good.jsonhas zero reported failurescustomers-review.jsonreports the empty email at index 1customers-review.jsonreports the date format at index 1customers-review.jsonreports the missing ID at index 2customers-review.jsonreportspendingat index 3- the report does not claim the data is safe to import
- no external system or file is changed
Troubleshooting
Claude Code tries to edit the JSON. Repeat the read-only boundary, reject the write approval, and ask for the report content in the chat instead.
The folder contains unrelated files. Stop and create a clean practice folder. Do not broaden the instruction to scan a personal or production directory.
A status is accepted without checking the allowed list. Ask for a separate allowed-values failure for every value outside active, paused, and closed.
A date is called valid because it looks readable. Require the exact YYYY-MM-DD pattern and compare the source string character by character.
Limits and decision
This check validates four simple shapes. It does not prove that an email works, that a customer exists, that a status is correct, or that an import will succeed. JSON can also be valid while its business meaning is wrong.
TRY it on a disposable sample folder when you can review every finding.
SKIP it for production exports until your team’s security, retention and change controls approve the session and the workflow.
USE the report as a review queue, not as permission to import or share the data.
For a nontechnical starting point, see Choose your first AI workflow at work. The next task is to define the fields and allowed values with the system owner before changing any export.
Want one practical AI-for-work lesson each week? Join The Weekly Verdict.