Skip to content

Deno: Increased permissions required, command in README fails #90

Description

@nakatanakatana

When I run ccusage v9.0.0 or later with Deno, the following error occurs:

$ deno run -E -R=$HOME/.claude/projects/ -S=homedir -N='raw.githubusercontent.com:443' npm:[email protected]
❌ Denied read access to "/home/tanaka/.claude".
error: Uncaught (in promise) NotCapable: Requires read access to "/home/tanaka/.claude", run again with the --allow-read flag
    at Object.statSync (ext:deno_fs/30_fs.js:415:3)
    at Object.statSync (ext:deno_node/_fs/_fs_stat.ts:163:25)
    at isTypeSync (file:///home/tanaka/.cache/deno/npm/registry.npmjs.org/ccusage/9.0.0/dist/data-loader-Ca8k_uX0.js:396:24)
    at getDefaultClaudePath (file:///home/tanaka/.cache/deno/npm/registry.npmjs.org/ccusage/9.0.0/dist/data-loader-Ca8k_uX0.js:3114:7)
    at file:///home/tanaka/.cache/deno/npm/registry.npmjs.org/ccusage/9.0.0/dist/mcp-BRFYI5rd.js:37550:38

Cause

It seems this issue was introduced because a new process was added in data-loader.ts to check for the existence of CLAUDE_CONFIG_DIR, which now requires read access to the entire .claude directory.

https://github.com/ryoppippi/ccusage/blob/ee7d7b69000f0b9a895f2aca0abb8eb39a9b0d16/src/data-loader.ts#L30

Proposed Solution

The .claude directory contains credentials. I would like to request that the behavior reverts to how it was in v8, where permissions were only required for the .claude/projects subdirectory.

Activity

  1. ryoppippi commented on Jun 17, 2025

    @ryoppippi
    Member

    send me a pr

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions