PulseAugur
EN
LIVE 00:28:09

Claude Code: How to Parse JSON Output and Track Costs

This article explains how to obtain JSON output from Claude Code, a tool for running code within the Claude AI. It details two primary output formats: `--output-format json` for final results and `--output-format stream-json` for real-time progress. The post clarifies that the cost field has been updated to `total_cost_usd` and provides an example of the JSON structure, including fields like `result`, `session_id`, and `usage`. AI

IMPACT Provides guidance for developers integrating Claude Code into their workflows.

RANK_REASON Article explains how to use a specific feature of an existing tool.

Read on dev.to — Claude Code tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

Claude Code: How to Parse JSON Output and Track Costs

How we ranked this

Signal score
0 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
Article explains how to use a specific feature of an existing tool.
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
product, infra
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
10 days old
Aged out of breaking-news scoring windows; ranking reflects the durable signal from the full source set.

Full methodology in our editorial standards.

COVERAGE [1]

  1. dev.to — Claude Code tag TIER_1 English(EN) · Aoba Works ·

    Claude Code Output Format JSON: Fields, jq & Python Parsing

    <p><em>Originally published at <a href="https://en.aobaworks.com/claude-code-output-format-json-fields-jq-python-parsing/?utm_source=devto&amp;utm_medium=referral" rel="noopener noreferrer">Unattended</a>.</em></p> <p>To get JSON from Claude Code, run <code>claude -p "your prompt…