{"slug": "show-hn-decant-understand-how-you-spend-tokens", "title": "Show HN: Decant – Understand how you spend tokens", "summary": "Dosu released Decant, a local-first CLI and web tool that analyzes Claude Code and Codex session logs to show token usage, estimated cost, context, and agent activity, with full-text search and exports. The tool runs via npx, npm, Homebrew, or Docker, supports macOS and Linux on x64 and arm64, and makes no outbound network calls at runtime.", "body_md": "Decant turns the Claude Code and Codex session logs on your machine into tangible insights. See where tokens, cost, and agent time go, inspect context usage, find the files and tools agents touch, and search complete transcripts from a CLI or local web UI.\n\nDecant is local-first. It makes no outbound network calls at runtime, and your transcripts never leave your machine.\n\nBuilt by\n[Dosu](https://dosu.dev?utm_source=decant&utm_medium=github&utm_campaign=attribution&utm_content=readme),\nKnowledge Infrastructure for Agents. Dosu helps make agents faster, cheaper,\nand more effective.\n\nRun Decant with `npx`\n\nwith no Bun install or global package required.\n\n```\nnpx @dosu/decant@latest\n```\n\nThis starts the local UI at [http://127.0.0.1:3000](http://127.0.0.1:3000), indexes the Claude Code and\nCodex logs on your machine, and watches for changes.\n\n- One SQLite archive for Claude Code and Codex sessions.\n- Full-text search across messages, tool calls, and transcripts.\n- Token,\n[estimated cost](/dosu-ai/decant/blob/main/docs/pricing.md), context, activity, tool, MCP, and file analytics. - Browsable sessions, projects, files, and ingest diagnostics.\n- Markdown, JSON, report, and trajectory exports.\n- Deterministic scripts, replays, and agent instructions distilled from command history.\n\nPublished binaries support macOS and Linux on x64 and arm64. Native Windows binaries are not currently available.\n\nInstall a persistent command with npm:\n\n```\nnpm install --global @dosu/decant@latest\ndecant\n```\n\nOr use Homebrew:\n\n```\nbrew install dosu-ai/dosu/decant\ndecant\n```\n\nOr install the latest release without Node.js or Bun:\n\n```\ncurl -fsSL https://raw.githubusercontent.com/dosu-ai/decant/main/install.sh | sh\ndecant\n```\n\nSee [Distribution](/dosu-ai/decant/blob/main/docs/distribution.md) for installer options, Docker, source\nbuilds, and release verification.\n\n```\ndocker run --rm \\\n  -p 127.0.0.1:3000:3000 \\\n  -v decant-data:/var/lib/decant \\\n  -v \"$HOME/.claude/projects:/sources/claude:ro\" \\\n  -v \"$HOME/.codex:/sources/codex:ro\" \\\n  ghcr.io/dosu-ai/decant:latest\n```\n\nKeep the `127.0.0.1:`\n\nprefix. Publishing `-p 3000:3000`\n\nexposes the\nunauthenticated archive API on every host interface. Custom container networks\nmay need the trusted-peer setting documented under\n[Docker distribution](/dosu-ai/decant/blob/main/docs/distribution.md#docker).\n\n```\ndecant                         # start the local web UI\ndecant sync                    # index new and changed sessions\ndecant ls                      # list sessions\ndecant show 1                  # render a transcript\ndecant search \"auth bug\"       # full-text search\ndecant stats --by model        # usage and cost rollups\ndecant economics               # token, cost, and time breakdowns\ndecant files --group ext       # file hotspots\ndecant tool stats              # tool usage\ndecant mcp stats               # MCP server usage\ndecant export 1 > session.md   # export a session\n```\n\nRun `decant --help`\n\nor `decant <command> --help`\n\nfor all commands and flags.\nRead commands support `--json`\n\n; global flags include `--db`\n\n, `--format`\n\n,\n`--quiet`\n\n, `--no-color`\n\n, and `--no-sync`\n\n.\n\nTo index selected files or a temporary source tree:\n\n```\ndecant --db /tmp/decant.db sync --path ./session.jsonl --path ./sessions\n```\n\nThe OpenAPI 3.1 contract is [docs/api/openapi.yaml](/dosu-ai/decant/blob/main/docs/api/openapi.yaml), and\na running server exposes it at\n[http://127.0.0.1:3000/api/openapi.json](http://127.0.0.1:3000/api/openapi.json). See [API recipes](/dosu-ai/decant/blob/main/docs/api/recipes.md)\nfor examples.\n\n[Analytics methodology](/dosu-ai/decant/blob/main/docs/analytics-methodology.md)[Pricing estimates](/dosu-ai/decant/blob/main/docs/pricing.md)[Archive and data lifecycle](/dosu-ai/decant/blob/main/docs/data-lifecycle.md)[Local Serve API](/dosu-ai/decant/blob/main/docs/api/routes.md)[Distribution and release verification](/dosu-ai/decant/blob/main/docs/distribution.md)[Architecture](/dosu-ai/decant/blob/main/docs/architecture.md)\n\nContributions are welcome. Read [CONTRIBUTING.md](/dosu-ai/decant/blob/main/CONTRIBUTING.md) for setup,\ntests, and privacy requirements. Coding agents should also read\n[AGENTS.md](/dosu-ai/decant/blob/main/AGENTS.md).\n\nUse synthetic session data in issues and tests. Real transcripts can contain source code, prompts, credentials, and local paths.\n\nReport vulnerabilities privately as described in [SECURITY.md](/dosu-ai/decant/blob/main/SECURITY.md).\n\nDecant is built and maintained by\n[Dosu](https://dosu.dev?utm_source=decant&utm_medium=github&utm_campaign=attribution&utm_content=about),\nKnowledge Infrastructure for Agents. Dosu helps make agents faster, cheaper,\nand more effective. Decant shows what your agents spent, read, and touched via\nyour agent logs.\n\nDecant was inspired in part by\n[Letta's Trajectory](https://github.com/letta-ai/trajectory), which normalizes\nagent transcripts across runtimes into a shared record format.\n\nDecant is licensed under the [Apache License 2.0](/dosu-ai/decant/blob/main/LICENSE).", "url": "https://wpnews.pro/news/show-hn-decant-understand-how-you-spend-tokens", "canonical_source": "https://github.com/dosu-ai/decant", "published_at": "2026-08-12 21:56:21+00:00", "updated_at": "2026-08-12 22:10:38.411030+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["Dosu", "Decant", "Claude Code", "Codex", "OpenAI", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/show-hn-decant-understand-how-you-spend-tokens", "markdown": "https://wpnews.pro/news/show-hn-decant-understand-how-you-spend-tokens.md", "text": "https://wpnews.pro/news/show-hn-decant-understand-how-you-spend-tokens.txt", "jsonld": "https://wpnews.pro/news/show-hn-decant-understand-how-you-spend-tokens.jsonld"}}