Problem: Agents like OpenClaw burn tokens with no per-task cost tracking. You see an aggregate bill, not "this refactor cost $3.20 and that bug fix cost $0.12."
Solution: codesession-cli is a CLI + OpenClaw skill. The agent calls `cs start` at task beginning, `cs log-ai` after each API call (cost auto-calculated from a built-in pricing table of 17+ models), and `cs end` when done. File changes and git commits are tracked via git diff.
Setup: npm i -g codesession-cli clawhub install codesession
No manual work after install the agent follows the skill instructions.
Tech: TypeScript, SQLite (WAL mode, better-sqlite3), Commander.js. All data local (~/.codesession). JSON output on every command for machine consumption. Structured errors, schema versioning for forward compat.
MIT. Looking for feedback on what stats/queries would be most useful.
nesh23•1h ago