Skip to content

Instantly share code, notes, and snippets.

@dui
dui / nanonu-codex-day1.md
Created May 7, 2026 00:04
nanonu — Codex day-1 transcript (iOS diet tracker, 18 turns, ~2h to working build)

nanonu — Codex day-1 transcript

Source: Codex VSCode session (~/.codex/sessions/2026/04/25/rollout-...jsonl).

Date: 2026-04-25 (single session, ~7h elapsed wall clock — ~2h to first working build on phone). Turns: 18 user prompts.

Filtered: user prompt + final assistant response per turn (running status commentary stripped).


@dui
dui / README.md
Created April 15, 2026 13:21
Claude Code statusline — two-line bar with context window breakdown, per-call tokens, 5h/7d rate limits, and $ cost

Claude Code Statusline

A two-line statusline for Claude Code showing:

Line 1 — working dir, git branch, context window bar with breakdown (system / messages / free / autocompact buffer), per-call token buckets (new / cache write / cache read / output), session totals, lines changed.

Line 2 — 5-hour rate-limit %, 7-day rate-limit %, session $ cost with per-bucket breakdown, 5h-window $ total, 7-day $ total, wall-clock time.

Requirements

@dui
dui / statusline.sh
Created April 11, 2026 00:07
Claude Code statusline — 2-line context bar with token buckets, 5h/7d rate limits, $ cost breakdown. Pairs with cc_cost.py.
#!/bin/bash
input=$(cat)
# One-shot debug dump: write the latest received JSON so we can verify what
# Claude Code actually sends. Safe to leave on; it's a single file overwrite.
echo "$input" > /tmp/claude-statusline-last.json
# ── Colors ────────────────────────────────────────────────────────
RESET="\033[0m"
GREEN="\033[38;2;74;222;128m"
YELLOW="\033[33m"
@dui
dui / cc_cost.py
Created April 11, 2026 00:05
cc_cost.py — historical token/cost reports against ~/.claude/projects (5h window, 7d, per-day, top windows). Dedupes globally on msg_id.
#!/usr/bin/env python3
"""
cc_cost — quick token / $-cost queries against ~/.claude/projects.
For LIVE current-session info, prefer the authoritative numbers from
Claude Code's statusline JSON (`cost.total_cost_usd`, `rate_limits.*`).
This script is for HISTORICAL queries (per-day, per-window, since-X) that
Claude Code doesn't surface directly.
Usage:
@dui
dui / cc_cost.py
Created April 10, 2026 00:39
cc_cost — see how much you're spending on Claude Code Max in API-equivalent dollars
#!/usr/bin/env python3
"""
cc_cost — quick token / $-cost queries against ~/.claude/projects.
For LIVE current-session info, prefer the authoritative numbers from
Claude Code's statusline JSON (`cost.total_cost_usd`, `rate_limits.*`).
This script is for HISTORICAL queries (per-day, per-window, since-X) that
Claude Code doesn't surface directly.
Usage:
@dui
dui / claude-usage-analysis.md
Last active April 7, 2026 23:31
Claude Code usage analysis — 5h window breakdown with cost ($) at Opus 4.6 list pricing, deduped on msg_id (corrected after discovering streaming-chunk + cross-file replication bugs)

Claude Code Usage Limit Analysis

User: @dui_toledo (Max 20x / $200 plan) Models in dataset: claude-opus-4-5 (Jan 20 – Feb 5) → claude-opus-4-6 (Feb 6 → present), reasoning effort high throughout. Both share the same price tier ($5 / $6.25 / $0.50 / $25 per MTok). Timezone: UTC-3 (BRT, São Paulo) Original report: 2026-04-06 (since corrected — see below) Latest revision: 2026-04-07 evening (added $-cost view, then found a second over-count bug — duplicate streaming chunks + cross-file replication. Numbers are now ~14x lower than the prior revision.)

Two methodology bugs (both now fixed)