ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 4/5

codesession

codesession (codesession-cli, code session, code-session) — Track AI agent session costs, tokens, file changes, and git commits. Works with Claude Code, OpenClaw, Codex, GPT, Cursor, Windsurf, Cline & any AI agent. Budget enforcement, auto-pricing, MCP server, web dashboard, alerts, insights. v2.5.1.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/brian-mwirigi/codesession
Or

What This Skill Does

The codesession skill is an essential observability tool for AI-driven development. It acts as a bridge between your AI agent's actions and real-world cost and productivity metrics. By integrating directly into your terminal environment, it tracks token consumption, API spend, file modifications, and Git commits in real-time. Whether you are using Claude Code, Cursor, Windsurf, or OpenClaw, this skill ensures you maintain full transparency over your infrastructure usage. It features built-in budget enforcement to prevent runaway API costs, automatic pricing calculations for various LLM models, and a comprehensive web-based dashboard to visualize your project's history and efficiency over time.

Installation

Installation is a two-step process requiring both the global CLI and the OpenClaw agent bridge.

  1. Ensure you have Node.js 18+ and native build tools installed on your system.
  2. Run npm install -g codesession-cli to install the core engine.
  3. Execute clawhub install openclaw/skills/skills/brian-mwirigi/codesession within your OpenClaw environment to register the skill.

Data is securely persisted in ~/.codesession/sessions.db, so ensure your environment has read/write permissions for that directory.

Use Cases

  • Cost Governance: Set hard budget limits on specific coding tasks to avoid surprise cloud billing.
  • Performance Auditing: Analyze how many tokens are consumed by specific architectural refactors or feature implementations.
  • Work Log Automation: Automatically generate audit trails of file changes and Git commits mapped to specific AI agent sessions.
  • Resource Management: Recover stale sessions automatically if your IDE or agent crashes mid-task, ensuring no data loss.

Example Prompts

  1. "Start a new code session named 'Refactor Authentication Module' and check if we are within the current month's budget."
  2. "Show me the dashboard for my recent AI sessions so I can review the total cost of the last three features we built."
  3. "End the current session, summarize the changes made to the codebase, and report the total token usage for this task."

Tips & Limitations

  • Use --json for Agents: Always append the --json flag when calling cs start or cs end from within an automated script to ensure the agent parses the output correctly.
  • Build Tools: This skill compiles a native SQLite module. If you encounter installation errors, verify that build-essential or your OS equivalent (Xcode/VS Build Tools) is correctly configured.
  • Budgeting: Set your budget caps early in the session lifecycle to allow the agent to self-regulate during heavy refactoring tasks. Note that this tool tracks local activity; ensure you provide your API credentials to the underlying LLM provider for accurate billing reflection.

Metadata

Stars4190
Views1
Updated2026-04-18
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-brian-mwirigi-codesession": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#observability#budgeting#billing#developer-tools#analytics
Safety Score: 4/5

Flags: file-read, file-write, code-execution