mirror of
https://github.com/wirenboard/agent-vm.git
synced 2026-07-09 16:00:54 +00:00
Add ccusage wrapper for tracking usage across all agent-vm instances
This commit is contained in:
parent
47c362bf1a
commit
1a42270a3a
2 changed files with 18 additions and 0 deletions
13
README.md
13
README.md
|
|
@ -330,6 +330,19 @@ Finally, using a VM means you don't need Node.js, npm, Docker, or any other dev
|
|||
|
||||
For AI agents running with `--dangerously-skip-permissions`, a VM is the only sandbox that provides meaningful security.
|
||||
|
||||
## Usage tracking
|
||||
|
||||
Since each VM instance stores Claude session data in its own state directory rather than the standard `~/.claude/`, tools like [ccusage](https://github.com/ryoppippi/ccusage) won't find them by default. A wrapper script is included that discovers all agent-vm session directories automatically:
|
||||
|
||||
```bash
|
||||
bin/ccusage # Daily report (default)
|
||||
bin/ccusage monthly # Monthly report
|
||||
bin/ccusage --since 20260401 # Filter by date
|
||||
bin/ccusage -i # Break down by project
|
||||
```
|
||||
|
||||
The wrapper sets `CLAUDE_CONFIG_DIR` to include `~/.claude`, `~/.config/claude`, and all `claude-sessions/` directories under `~/.local/state/agent-vm/`.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
|
|
|||
5
bin/ccusage
Executable file
5
bin/ccusage
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
# Wrapper for ccusage that includes all agent-vm session directories
|
||||
agent_vm_dirs=$(find "$HOME/.local/state/agent-vm" -maxdepth 2 -name "claude-sessions" -type d 2>/dev/null | paste -sd,)
|
||||
export CLAUDE_CONFIG_DIR="$HOME/.claude,$HOME/.config/claude${agent_vm_dirs:+,$agent_vm_dirs}"
|
||||
exec npx ccusage@latest "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue