Install
$ agentstack add skill-johnkozan-clawcounting-skill ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
ClawCounting Accounting
ClawCounting is a double-entry bookkeeping engine designed for AI agents. Single Rust binary, single SQLite database. All accounting logic is enforced — balanced entries, immutable journals, period controls — so you can post with confidence.
Installation
# From source (requires Rust toolchain)
cargo install --git https://github.com/johnkozan/clawcounting
# Verify
clawcounting --version
Interfaces
CLI (recommended for agents):
clawcounting [--json] # --json for machine-readable output
The CLI connects directly to the SQLite database. No server needed. Set CLAWCOUNTING_DB to control the database path (default: ./clawcounting.db). The database must be initialized first with clawcounting init.
Commands that create accounting records (journal entries, reversals, period close) require an API key for user attribution:
# Via flag
clawcounting journal-entries create --file entry.json --api-key tsk_... --json
# Via environment variable
export CLAWCOUNTING_API_KEY=tsk_...
clawcounting journal-entries create --file entry.json --json
Admin commands (user/currency/account/period creation, reports, settings) work without an API key.
HTTP API (requires server):
GET/POST/PATCH /api/v1/...
Authorization: Bearer
Initialize with clawcounting init, then start with clawcounting serve. See [references/setup-guide.md](references/setup-guide.md) for full server setup.
Both interfaces share identical validation and business logic.
Amount Handling
All monetary amounts are i128 integers in the smallest currency unit:
- USD with
asset_scale=2:"1050"= $10.50 - ETH with
asset_scale=18:"1000000000000000000"= 1.0 ETH - BTC with
asset_scale=8:"100000000"= 1.0 BTC
API responses include both raw amounts and display_* fields formatted with the currency's decimal places.
Key Rules
- Double-entry: Every journal entry MUST balance (total debits = total credits). Minimum 2 lines. All lines same currency.
- Immutability: Journal entries cannot be edited or deleted. Corrections are made via reversing entries only.
- Period enforcement: Every entry must fall within an open financial period. Closed periods cannot be reopened.
- Control accounts: Accounts with
has_subledger=truecannot be posted to directly — post to their sub-accounts instead. - Currency identifiers: All currencies use CAIP-19 format (fiat:
swift:0/iso4217:USD, crypto:eip155:1/slip44:60).
Setup Workflow (first-time)
Follow these steps in order. See [references/setup-guide.md](references/setup-guide.md) for detailed examples.
- Initialize the database —
clawcounting init(creates the SQLite file and runs migrations) - Start the server or use CLI directly (both work with the same database)
- Create a user account — via web UI setup page (first visit) or
clawcounting users createCLI - Create a service account —
clawcounting users create-service-accountto get an API key for CLI write operations and agent access - Add currencies — via the web UI currency picker (fiat with flags, popular crypto tokens with logos, token list import, or custom), or CLI (
currencies create-fiatfor fiat,currencies createfor crypto) - Create a financial period — define the date range for your fiscal period
- Build chart of accounts — create asset, liability, equity, revenue, and expense accounts
- Configure settings — set the retained earnings account (required for period close)
Day-to-Day Operations
See [references/operations-guide.md](references/operations-guide.md) for detailed procedures.
- Post journal entries — balanced debit/credit entries with date, description, and line items
- Query balances — per-account, per-period, or cumulative
- Generate reports — trial balance, balance sheet, income statement, general ledger
- Reverse entries — create a correcting entry that swaps all debits and credits
- Close periods — preview the closing entry first, then commit (zeroes revenue/expense to retained earnings)
API Reference
See [references/api-reference.md](references/api-reference.md) for all endpoints, request/response shapes, and query parameters.
Accounting Rules & Constraints
See [references/accounting-rules.md](references/accounting-rules.md) for domain rules, subledger mechanics, currency handling, and error recovery.
Error Handling
Errors follow RFC 7807 and always include a suggestion field with recovery guidance:
{
"code": "PERIOD_CLOSED",
"message": "Period FY2025 is closed",
"field": null,
"suggestion": "Post to period FY2026 which is currently open"
}
Always read the suggestion before retrying. Common error codes:
VALIDATION_ERROR— field-level validation failureUNBALANCED_ENTRY— debits != creditsPERIOD_CLOSED— target period is closedNOT_FOUND— resource does not existUNAUTHORIZED/FORBIDDEN— auth issues
Response Envelope
Single resource:
{ "data": { ... } }
List (cursor-paginated, Stripe-style):
{ "data": [...], "has_more": true, "next_cursor": "..." }
Pagination: ?limit=50&cursor=. Default limit 50, max 200.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: johnkozan
- Source: johnkozan/clawcounting
- License: MIT
- Homepage: https://clawcounting.com/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.