Skip to content

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

@nakatanakatana

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.

if (!isDirectorySync(envClaudeCodePath)) {

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.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions