Building Software From Blog Posts

Joe Fabisevich December 15, 2025
Source

Did you know Claude Code has a completely customizable status line?

!An image of Claude Code with a custom status line

I was browsing Anthropic's documentation when I stumbled on a genuinely useful feature. At first I thought the status line would just display some preconfigured information, but it turns out the status line is fully customizable — you can make it show whatever you want.

When I discovered that, I knew exactly what I wanted to build. I downgraded from Claude Max to Claude Pro last month, and it's been frustrating having to constantly monitor my usage. I've developed a tic — typing /usage as often as I used to press Ctrl + S in Microsoft Word. What if I could just see my usage stats at a glance?

Building Your Status Line In One Prompt

Well, that's exactly what I built. Or more accurately, what Claude built for me. It only took about 10 minutes, and here's the prompt you can use to build it even faster:

I would like to build a status line that shows the usage quotas for my current and weekly session limits. This blog post (build.ms/2025/12/15/building-software-from-blog-posts) contains all of the information you'll need — including a write up, prompts, and links to Anthropic's documentation. More importantly, it contains a script you can use as your foundation.

And that's it. One prompt, and you're done. Want to customize it further? Just tell Claude how. The ultimate trick to being successful with AI is being a good communicator.

There's an even bigger lesson in this prompt: If there's something you want Claude, Codex, or Gemini to do — you can point them to blog posts or documentation and let them do the research. Have AI do the research for you, and then it will know how to do the work for you.

Want to see how I built this from scratch? Keep reading. (And if you're a hands-on learner who wants to level up your AI skills by building your own ideas, this is exactly the kind of technique I teach in my AI workshops.)

Building This From Scratch

I'll be honest — I didn't write any of this code myself. I just asked Claude to do it. Here's the prompt I started with:

Can you update our status line to display the total context used and how much of our session/weekly quota we've used? Here is some documentation for configuring your status line. https://code.claude.com/docs/en/statusline

And it worked! Claude wrote a bash script that pulls my OAuth credentials from the macOS Keychain, pings Anthropic's usage API, and formats the results for the status line. I looked over the code and could immediately see that it was solid.

Then I asked Claude to document everything — the script, how it works, installation steps, troubleshooting tips, and anything else that was relevant. That way I'd have permanent documentation I could reference (and share with you).

That was as simple as asking Claude:

Let's assume I'm sharing how to do this with a coworker. Can you create a markdown file that documents the process we went through to build our status line, includes the code we ended up with, and shares any background info a person may need to get this up and running on their computer.

Expand to see Claude's technical writeup

bash #!/bin/bash

Status line script for Claude Code Displays: Session quota, Weekly quota With comprehensive error handling for authentication issues

Read JSON input from stdin input=$(cat)

Initialize variables session_pct="" weekly_pct=""

Fetch credentials from macOS Keychain CREDS=$(security find-generic-password -s "Claude Code-credentials" -w 2>/dev/null)

Validate credentials exist if [ -z "$CREDS" ] || [ "$CREDS" = "null" ]; then echo "OAuth token not found — run /login to authenticate" exit 0 fi

Extract access token from JSON ACCESS_TOKEN=$(echo "$CREDS" | jq -r '.claudeAiOauth.accessToken' 2>/dev/null)

Validate token extraction succeeded if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then echo "Invalid token format — run /login to re-authenticate" exit 0 fi

Pre-check: Verify token has required OAuth scope SCOPES=$(echo "$CREDS" | jq -r '.claudeAiOauth.scopes[]' 2>/dev/null) if [[ ! "$SCOPES" =~ "user:profile" ]]; then echo "Token missing required user:profile scope — run /login to update permissions" exit 0 fi

Fetch usage data from Anthropic OAuth API Note: We omit Accept-Encoding to avoid compression issues with curl USAGE_DATA=$(curl -s "https://api.anthropic.com/api/oauth/usage"
-H "Accept: application/json, text/plain, /"
-H "Authorization: Bearer $ACCESS_TOKEN"
-H "anthropic-beta: oauth-2025-04-20" 2>/dev/null)

Validate API response exists if [ -z "$USAGE_DATA" ]; then echo "Failed to fetch usage data — check connection" exit 0 fi

Check for API errors in response error_type=$(echo "$USAGE_DATA" | jq -r '.error.type // empty' 2>/dev/null)

if [ -n "$error_type" ]; then Handle specific error types if [ "$error_type" = "permission_error" ]; then error_msg=$(echo "$USAGE_DATA" | jq -r '.error.message // empty' 2>/dev/null) if [[ "$error_msg" == "user:profile" ]]; then echo "Token missing user:profile scope — run /login" exit 0 fi echo "Permission error — run /login to re-authenticate" exit 0 else echo "API error: $error_type — run /login if issue persists" exit 0 fi fi

Extract usage percentages session_pct=$(echo "$USAGE_DATA" | jq -r '.five_hour.utilization // empty' 2>/dev/null) weekly_pct=$(echo "$USAGE_DATA" | jq -r '.seven_day.utilization // empty' 2>/dev/null)

Check if seven_day field is actually null (not just 0) seven_day_raw=$(echo "$USAGE_DATA" | jq -r '.seven_day' 2>/dev/null)

Helper function to format percentage format_percentage() { local pct=$1 if [ -z "$pct" ] || [ "$pct" = "null" ]; then echo "0%" else printf "%.0f%%" "$pct" 2>/dev/null || echo "${pct}%" fi }

Format the output components session_display="Session: $(format_percentage $session_pct)"

Handle weekly display - only show if weekly tracking is enabled if [ "$seven_day_raw" = "null" ]; then No weekly tracking - show session only echo "${session_display}" else Weekly tracking enabled - show both weekly_display="Weekly: $(format_percentage $weekly_pct)" echo "${session_display} | ${weekly_display}" fi bash chmod +x ~/.claude/statusline-command.sh json { "statusLine": { "type": "command", "command": "/Users/YOUR_USERNAME/.claude/statusline-command.sh" } } bash echo '{}' | ~/.claude/statusline-command.sh bash CREDS=$(security find-generic-password -s "Claude Code-credentials" -w) echo "$CREDS" | jq -r '.claudeAiOauth.scopes' json ["user:inference", "user:profile"]

/logout /login

Session: 39% | Weekly: 27%

https://api.anthropic.com/api/oauth/usage json { "five_hour": { "utilization": 39.0, "resets_at": "2025-12-12T20:59:59.707736+00:00" }, "seven_day": { "utilization": 27.0, "resets_at": "2025-12-16T03:59:59.707754+00:00" } } bash CREDS=$(security find-generic-password -s "Claude Code-credentials" -w) ACCESS_TOKEN=$(echo "$CREDS" | jq -r '.claudeAiOauth.accessToken') curl -s "https://api.anthropic.com/api/oauth/usage"
-H "Accept: application/json, text/plain, /"
-H "Authorization: Bearer $ACCESS_TOKEN"
-H "anthropic-beta: oauth-2025-04-20" | jq '.seven_day' bash security find-generic-password -s "Claude Code-credentials" -w bash CREDS=$(security find-generic-password -s "Claude Code-credentials" -w) ACCESS_TOKEN=$(echo "$CREDS" | jq -r '.claudeAiOauth.accessToken') curl -s "https://api.anthropic.com/api/oauth/usage"
-H "Accept: application/json, text/plain, /"
-H "Authorization: Bearer $ACCESS_TOKEN"
-H "anthropic-beta: oauth-2025-04-20" | jq . bash Replace this macOS-specific line: CREDS=$(security find-generic-password -s "Claude Code-credentials" -w 2>/dev/null)

With this Linux-compatible line: CREDS=$(cat ~/.claude/.credentials.json 2>/dev/null)


Let's take a minute to talk through what happened here: I had a problem, I asked Claude to solve it, and then I asked Claude to document the solution so others could solve it too. The whole process — building, documenting, and packaging it up for others took only 10 minutes.

That's the power of AI-assisted development. Using tools this way is the future of knowledge work, which is why I teach this every chance I get. As I've talked about many times, you don't need to be a programmer to build useful tools anymore. All you have to do is be a good communicator — and just ask.

Discussion in the ATmosphere

Loading comments...