Keyboard Shortcuts N Next post
P Previous post
S Save / unsave
R Read aloud
T Toggle theme
/ Focus search
Esc Close panels
🔥
Ready to read...
beginner Claude IMCSEIAN JSON Markdown Output Format Prompting Tutorial

Output Shaping: Tables, Lists, JSON, Markdown

Reviewed & accurate
AI Summary
IMCSEIAN · Claude Master Course

Output Shaping: Tables, Lists, JSON, Markdown

Control the format of Claude's output to save follow-up turns.

Phase 1 — Beginner Lesson BE-18 Difficulty: Beginner 6 min read
Course: Claude Phase 1 — Beginner 6 min read Last verified: 2026-08-31

What You Will Learn

  • Request specific output formats.
  • Use format to enable downstream automation.
  • Avoid common format pitfalls.
  • Combine format with role and specificity.
  • Validate structured output.

Why This Matters

Asking 'list the bugs' produces prose; asking 'output as a JSON array of {severity, issue, fix}' produces parseable data. Output shaping saves a follow-up turn and unlocks automation.

Concept Explained

Output shaping means specifying the response format in the prompt. Common formats: bullet list, numbered list, table, JSON, Markdown code block, diff. The format shapes what Claude produces.

How It Works

Format instructions bias Claude toward structured output. Asking for JSON activates JSON-producing patterns; asking for a table activates table-markdown patterns. Combine with a schema for maximum control.

Step-by-Step Tutorial

1. Pick a format

Match format to use: bullet for reading, JSON for automation, table for comparison, diff for edits.

2. Specify in prompt

End with: 'Output as [format]' or 'Format your response as [format]'.

3. Add schema for JSON

For JSON, specify the shape: 'Output as JSON matching: {severity: string, issue: string, fix: string}[]'.

4. Combine with role

'Act as a security reviewer. Output as a table with columns: severity, issue, fix.'

5. Validate

For JSON, run through a parser. For tables, check column count.

Real-World Example

A team wanted to feed Claude's bug review into their issue tracker. Asked: 'Review this function. Output as JSON array of {severity, title, description, suggested_fix}. No prose.' Claude produced clean JSON. They wrote a 10-line script to file issues automatically. Saved 30 minutes per review.

Example Prompts / Commands / Code

Format examplesimcseian
# Bullet list:
List the top 3 performance issues. Output as a bullet list, no prose.

# Table:
Compare these 3 libraries. Output as a markdown table with columns: library, stars, last_release, license.

# JSON with schema:
Review this function for security issues. Output as JSON matching this TypeScript type:
type Issue = { severity: 'high'|'med'|'low'; issue: string; fix: string };
Return Issue[].

# Diff:
Refactor this function. Output as a unified diff, no prose around it.

# Code block only:
Implement the function. Output as a single TypeScript code block, no explanation.

Common Mistakes

  • Asking for JSON without a schema — produces inconsistent shapes.
  • Mixing prose with structured output — defeats the purpose.
  • Forgetting to validate JSON — silent parse failures downstream.
  • Using tables for >5 columns — hard to read.

Best Practices

  • Match format to use: JSON for automation, table for comparison, diff for edits.
  • For JSON, always specify a schema.
  • End with 'no prose' for clean output.
  • Validate structured output before consuming.

Troubleshooting

ProblemHow to Fix
JSON is malformedAdd 'must be valid JSON, no trailing commas, no comments'. Try Opus 4.
Prose creeps inEnd prompt with 'Output ONLY the [format], no surrounding text'.

Practical Exercise

Your Turn

Ask Claude to review a function for bugs. First, ask for prose. Then ask for a JSON array with schema. Compare usefulness for downstream automation.

Key Takeaways

  • Format instructions shape output structure.
  • Common formats: bullet, table, JSON, diff, code block.
  • Always specify a schema for JSON.
  • End with 'no prose' for clean output.
  • Validate structured output.

Frequently Asked Questions

Can I get YAML or XML?
Yes — specify 'Output as YAML' or 'Output as XML'.
Does format affect token cost?
Marginally — longer outputs cost more, but small difference.
Can I get multiple formats?
Yes, but brittle. One format per turn.

Further Reading

Official References

Related lessons: BE-17, BE-19

SEO Metadata

SEO title: Output Shaping: Tables, Lists, JSON, Markdown

Meta description: Control the format of Claude's output to save follow-up turns.

Primary keyword: claude output format

Secondary keywords: claude json output, claude markdown, claude table, claude structured output

Search intent: Informational

URL slug: /claude-output-shaping-tables-json-markdown

Categories: AI Tools, Claude

Tags: Claude, Beginner, Prompting, Output Format, JSON, Markdown, IMCSEIAN, Tutorial, IMCSEIAN

Featured image concept: Multiple output format examples: table, list, JSON, markdown.

Test Your Knowledge
How did you find this?

Comments

Join the discussion! Sign in with your Google or Blogger account, or comment as Anonymous - no account needed. For quick questions, also reach me on Telegram @cytestch.

Comments