Skip to content

cost.json never appends after the initial run — extract prints token counts but doesn't persist them #1769

Description

@jsilrecavo

Version: graphifyy 0.9.11 (uv tool install), macOS. Also observed on 0.9.9.

Symptom: graphify-out/cost.json records only the very first extraction run. Subsequent graphify extract runs print their usage to stdout — e.g. today:

[graphify extract] incremental summary: 590 files cached/unchanged, 141 re-extracted, 57 deleted
[graphify extract] tokens: 568,089 in / 49,564 out, est. cost (~claude-cli): $0.0000

— but cost.json afterwards still contains exactly one entry (the original full extraction from days earlier): {"runs": [{"date": "...", "input_tokens": 1384508, "output_tokens": 0, "files": 493}], ...}. So the numbers exist at print time and are simply never appended.

Possibly related to the closed #1694 (cluster-only/label cost tracking), but this is the extract path and persists on 0.9.11.

Why it matters: for teams running scheduled/incremental refreshes on a subscription backend, cost.json is the only ledger of what refreshes actually cost — with only the initial run recorded, "what does a refresh cost us per week" is unanswerable from the tool's own telemetry.

Expected: every extract (and ideally cluster-only/label) appends a run entry with date, input/output tokens, and file counts, updating the totals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions