Skip to content

feat: allow multiple account tracking #208

Closed

Description

@ccrvlh

Currently using multiple Claude accounts (work, personal, third party, etc).
Would be great to allow tracking multiple accounts (eg. multiple ~/.claude dirs).
Happy to contribute

Activity

  1. iamtoruk commented on May 6, 2026

    @iamtoruk
    Member

    @ccrvlh — quick clarification needed before we merge #227.

    The PR adds CLAUDE_CONFIG_DIRS (an OS-delimited list of Claude data dirs) and pulls sessions from all of them. But the parser merges ProjectSummary entries by project name, so two accounts working on the same path produce one dashboard row with combined totals — not two rows attributed to each account.

    Concretely, if both ~/.claude-work and ~/.claude-personal have sessions in projects/-Users-you-app/, you'd see:

    -Users-you-app $80 work+personal merged

    …rather than:

    work -Users-you-app $50
    personal -Users-you-app $30

    Which one matches your need?

    1. Aggregation only — what feat(claude): support multiple config dirs #227 does today. Useful for "how much am I spending on Claude across everything?" but loses the per-account breakdown.
    2. Per-account attribution — sessions tagged with which dir they came from, dashboard rows split (or filterable) by account. Bigger change: needs a label per dir (work, personal) and a new field on SessionSource.

    If (1) covers your use case we'll merge #227 with a small note. If you actually need (2), it's worth holding the merge and shaping the data model now so we don't ship a half-step.

    Either answer is fine — just want to make sure we ship the thing that's actually useful.

  2. ccrvlh commented on May 9, 2026

    @ccrvlh
    Author

    @iamtoruk thanks. I'd start with total usage - you get insight over the project dimension, and generally the tool itself would give you insight over account level expenditure, so i'd move forward with option 1, implemented on the PR.

    Thanks!

  3. iamtoruk commented on May 10, 2026

    @iamtoruk
    Member

    @ccrvlh CLAUDE_CONFIG_DIRS (option 1, total aggregation) is on main as of #288 (b72e51e).

    The merge happens at the project-rollup layer: two SessionSource entries from different config dirs that share the same sanitized slug naturally land under the same projectMap key in src/parser.ts:scanProjectDirs, so the ProjectSummary you see is one row with both accounts' sessions and combined totals. No account / accountPath fields anywhere; CSV / JSON / dashboard output is identical to the single-dir case.

    How to test before the next release

    It is on main only — not yet on npm. Test from source:

    git clone https://github.com/getagentseal/codeburn
    cd codeburn
    npm install
    npm run build
    
    # Two real Claude config dirs you actually have, e.g.
    CLAUDE_CONFIG_DIRS="$HOME/.claude-work:$HOME/.claude-personal" node dist/cli.js report --format json --provider claude --period 30days | jq '.projects | map({project, sessions: .sessions | length, cost: .totalCostUSD})'
    
    # Same data, dashboard view
    CLAUDE_CONFIG_DIRS="$HOME/.claude-work:$HOME/.claude-personal" node dist/cli.js

    On Windows use ; as the separator: CLAUDE_CONFIG_DIRS=C:\Users\you\.claude-work;C:\Users\you\.claude-personal. If you ever see a one-line stderr hint about unreadable dirs, that means the delimiter is wrong for your platform.

    Sanity checks

    • CLAUDE_CONFIG_DIRS unset → behaves identically to before (default ~/.claude or CLAUDE_CONFIG_DIR if set).
    • Missing dir in the list → the rest are still scanned.
    • Same dir listed twice → not double-counted.
    • Two dirs with the same project → one combined row.

    What to send back

    If you can confirm with a snippet of codeburn report --format json --provider claude (or just a screenshot) that:

    1. The total cost sums correctly across both dirs.
    2. There is no per-account split in the output.
    3. The projects you actually share between the two accounts show up as one row.

    …we'll cut the next npm publish with this included. If anything is off, reply with the output of CLAUDE_CONFIG_DIRS=... node dist/cli.js report --format json --provider claude --verbose 2>&1 and we'll dig in before publish.

    Note: PR #227 (which proposed per-account attribution / option 2) is being closed in favor of this PR. Thanks for the original issue and the design discussion that landed us on option 1.

  4. iamtoruk commented on May 11, 2026

    @iamtoruk
    Member

    Shipped in v0.9.8.

    Set CLAUDE_CONFIG_DIRS to a colon-separated list of paths (semicolon on Windows) and codeburn scans all of them in a single run. Sessions across directories roll up per project, ~ is expanded, missing dirs are skipped gracefully.

    Precedence: CLAUDE_CONFIG_DIRS > CLAUDE_CONFIG_DIR > ~/.claude.

    export CLAUDE_CONFIG_DIRS="~/.claude-work:~/.claude-personal"
    codeburn today
    

    Install: npm i -g [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions