DEV Community

TORIFUKU Kaiou
TORIFUKU Kaiou

Posted on

Measuring Chat Count After Hitting the Amazon Q Developer (Claude Sonnet 4) Pro Limit

Introduction

I’m an avid user of the Amazon Q Developer CLI.

I mainly use the CLI version rather than the IDE integration.

Of course, I’m on the Pro plan and happily paying for it.

To be honest, I probably overused it. I threw everything at Amazon Q Developer CLI every day—code questions, AWS questions, small talk, anything—until I was told: “Monthly request limit reached - The limits reset on 09/01.” For the past few days I haven’t been able to use it.

That was a problem, so rather than wait around, I decided to act.

Well, it should work again tomorrow. Can’t wait.

By the way, the model used by Amazon Q Developer CLI is Anthropic’s Claude Sonnet 4.

Also by the way, I’m using macOS 15.6.1.

I built a wrapper to count chats (with Codex CLI’s help)

#!/usr/bin/env bash
set -euo pipefail

# q chat usage counter wrapper
# - Counts assistant replies completed during this run by querying SQLite
# - Logs to ~/.local/share/q-wrapper/usage.csv

subcmd="${1:-}"

# Detect DB path
case "${OSTYPE:-}" in
  darwin*) DB_PATH="$HOME/Library/Application Support/amazon-q/data.sqlite3" ;;
  linux*)  DB_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/amazon-q/data.sqlite3" ;;
  *)       DB_PATH="$HOME/Library/Application Support/amazon-q/data.sqlite3" ;;
esac

LOG_DIR="$HOME/.local/share/q-wrapper"
mkdir -p "$LOG_DIR"
LOG_FILE="$LOG_DIR/usage.csv"

# Start and end window in UNIX ms
start_ms=$(($(date +%s)*1000))

# Run q with all arguments
set +e
if ! command -v q >/dev/null 2>&1; then
  echo "[qw] error: 'q' not found in PATH" >&2
  exit 127
fi
q "$@"; exit_code=$?
set -e

end_ms=$(($(date +%s)*1000))

# Only attempt counting for chat subcommand and when DB exists
count=0
dir_key="$(pwd)"
if [[ "$subcmd" == "chat" && -f "$DB_PATH" ]]; then
  # Count history entries whose stream_end_timestamp_ms fell within this run window
  # Escape single quotes for SQL literal
  esc_key=${dir_key//\'/''}
  read -r count < <(sqlite3 -readonly "$DB_PATH" "WITH rows AS (
    SELECT json_extract(h.value, '$.request_metadata.stream_end_timestamp_ms') AS end_ms
    FROM conversations, json_each(conversations.value, '$.history') AS h
    WHERE conversations.key = '$esc_key'
  ) SELECT COUNT(*) FROM rows WHERE end_ms IS NOT NULL AND end_ms >= $start_ms AND end_ms <= $end_ms;") || count=0
fi

# Append CSV log: ts,subcmd,dir,count,exit
ts=$(date -Iseconds)
printf "%s,%s,%s,%s,%s\n" "$ts" "${subcmd:-}" "$dir_key" "$count" "$exit_code" >> "$LOG_FILE"

# Friendly summary
echo "[qw] replies this run: $count (dir=$dir_key, exit=$exit_code)"

exit "$exit_code"
Enter fullscreen mode Exit fullscreen mode

I call it a q wrapper, or qw.

Place this file somewhere convenient, give it execute permission with chmod +x qw, and ensure it’s on your PATH.

You’ll also need the sqlite3 command available.

Usage

Use it like qw chat --resume instead of q chat --resume.

Enjoy your artful development sessions with Amazon Q Developer CLI, and when you exit with /quit, it will count how many chats you had.

Aggregated Results

They accumulate in ~/.local/share/q-wrapper/usage.csv.
Example:

2025-08-29T03:08:20+09:00,chat,/Users/yamauchi/memo,0,0
2025-08-29T03:14:08+09:00,chat,/Users/yamauchi/memo,4,0
2025-08-29T08:57:42+09:00,chat,/Users/yamauchi/Documents/AWS,116,0
2025-08-29T20:29:47+09:00,chat,/Users/yamauchi/Documents/AWS,12,0
2025-08-30T21:13:05+09:00,chat,/Users/yamauchi/memo,2,0
2025-08-30T22:22:11+09:00,chat,/Users/yamauchi/memo,1,0
2025-08-31T10:02:50+09:00,chat,/Users/yamauchi/memo,5,0
2025-08-31T10:25:48+09:00,chat,/Users/yamauchi/PythonProjects/mcp-charcount,0,0
2025-08-31T10:29:16+09:00,chat,/Users/yamauchi/PythonProjects/mcp-charcount,13,0
2025-08-31T10:31:06+09:00,chat,/Users/yamauchi/PythonProjects/mcp-charcount,3,0
2025-08-31T10:32:06+09:00,chat,/Users/yamauchi/PythonProjects/mcp-charcount,3,0
Enter fullscreen mode Exit fullscreen mode

From left to right:

  • Date/time
  • Subcommand (chat)
  • Directory
  • Chat count
  • Exit code

It’s not exact!

To be clear up front, this only gives a rough estimate.

For now, it matches my gut feel.

One round trip equals 1 count: you enter a prompt and the Amazon Q Developer CLI returns an answer.

How was it built?

I had OpenAI’s Codex CLI build it for me.

On my own, I don’t think I could have done something this tricky.

https://github.com/aws/amazon-q-developer-cli

The source code is public, so I asked it to analyze. I told it what I wanted, and it grasped my intent and produced it in no time.

  • The q chat history is recorded in data.sqlite3.
  • It understood the table structure and wrote the SQL for aggregation.

Pro Plan Limits and Current Usage

I don’t know the Pro plan limits or my current usage.

Pro Plan Limits

https://aws.amazon.com/q/developer/pricing/

Even on the pricing page it only says “included,” so I can’t tell at all.

On 2025/08/28 I got “Monthly request limit reached - The limits reset on 09/01,” so there must be some cap. That makes sense. Other AI agents commonly have three tiers like $20/mo, $40/mo, and $200/mo. Amazon’s own Kiro is similar. For Amazon Q Developer, there’s currently only a $19/mo plan.

Current Usage

This is unknown too.

I don’t know the limit, and I also don’t know what fraction of that limit I’ve used. Support confirmed this, so as of 2025/08/29 this is accurate.

For the Free plan, I see the number 50. I don’t know what counts as “1”. That’s why I’m trying to count my own chats to make an educated guess.


Memories with Amazon Q Developer

Here are some memories from this summer with Amazon Q Developer.

I got a Q T‑shirt in June!

Build games with Amazon Q CLI and score a T‑shirt (extended due to popularity!)

I applied and received a T‑shirt!

I was thrilled—thank you!!!

That T‑shirt was super handy this summer, and I proudly felt one step ahead.

In July, using the Free plan, I hit the limit around 7/20

At first I was using an AWS Builder ID. In July I was frequently switched to the claude-3.7-sonnet model, but I accepted that as part of the Free plan. I used it a lot. If “50” is the number of chats, I think I could burn through that in a few hours. Even so, I think I was able to use it until around 7/20. For a while I even wondered if it was unlimited as long as I didn’t use the IDE version. That’s how much the Free plan helped me.

It has significantly changed my Software Development Lifecycle (SDLC), and Amazon Q Developer CLI has become indispensable.

I joined the Pro plan in August

I started paying in August.

However, signing up for the Pro plan was really hard.

I wrote about how hard it was in this post:

[$19/month] I Love Amazon Q Developer CLI (Price Increase After September?)

That said, you only have to do it once, and the benefits to my SDLC after setting up billing are overwhelmingly worth it.

As I mentioned at the top, I overworked Amazon Q Developer (Claude Sonnet 4), and ended up with Monthly request limit reached - The limits reset on 09/01. I can’t wait for 9/1 to arrive.


Lastly

Right now I’m logging back in with the AWS Builder ID that I used during the Free plan days.

In the end, what I did was ask OpenAI’s Codex CLI to analyze the Amazon Q Developer CLI. That’s my summer memory.

Top comments (0)