Skip to content

Instantly share code, notes, and snippets.

View ben-vargas's full-sized avatar

Ben Vargas ben-vargas

View GitHub Profile
╭────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code! │
│ │
│ /help for help, /status for your current setup │
│ │
│ cwd: C:\Users\ben\Documents\git\unsynced\tetris │
╰────────────────────────────────────────────────────╯
Tips for getting started:

MoonshotAI Kimi K2 model not invoking tools despite listed support

Description

The moonshotai/kimi-k2 model is listed as supporting "Tools" and "Tool Choice" on the OpenRouter model page, but when making requests with tools defined, the model responds with regular text instead of invoking the requested tools.

Steps to Reproduce

  1. Make a request to moonshotai/kimi-k2 via OpenRouter API with tools defined
  2. Use the standard OpenAI-compatible tool/function format
# Tetris Game - Product Requirements Document
## Overview
A classic Tetris game implementation that provides an engaging puzzle experience where players arrange falling blocks to create and clear complete horizontal lines.
## Core Features
### 1. Game Mechanics
- **Falling Tetrominoes**: 7 standard Tetris pieces (I, O, T, S, Z, J, L) that fall from top to bottom
- **Movement Controls**:
Here's your complete statusline setup that you can replicate on another machine:
Status Line Configuration Details
Your setup uses an enhanced custom script (~/.claude/statusline-enhanced.sh) that displays:
- Time (12-hour with AM/PM)
- Current directory with color-coded Git status (blue=clean, orange=dirty)
- Model name (shortened)
- Token usage (~character count/4)
- Global 5-hour session timer with progress percentage

Subagent Token Tracking - Investigation Findings

Executive Summary

After thorough investigation of GitHub issue #313 regarding subagent token tracking, we discovered that the reported issue is more nuanced than initially described. While users are experiencing real problems with token limits, the root cause is not exactly what was initially documented. This report details our findings, corrections to initial assumptions, and the improvements we've implemented.

Initial Problem Report (Issue #313)

Users reported hitting 5-hour token limits while ccusage showed only 10-20% usage when using subagents (Task tool). The initial assessment suggested that:

Git Bare Repository Worktree Workflow for Claude Code

🚨 CRITICAL: Understanding My Project Structure

I use a bare Git repository approach with Git worktrees extensively. Every subdirectory in my projects represents a different git branch as a worktree.

When you see a project like /home/code/projects/my-app/:

  • my-app/ = project container (NOT a working tree)
  • my-app/.bare/ = actual Git repository database
  • my-app/.git = pointer file directing Git commands to .bare/

Tool Streaming Support for AI SDK Provider Claude Code

Issue Summary

GitHub Issue: #36 - Intermediate tool calls Requested by: @Evanfeenstra Date: August 22, 2025

The user is requesting support for intermediate tool calls in streamText and streamObject to enable building UIs that show tool calls and results as they happen, similar to other AI SDK providers.

Current State Analysis

Implement an Anthropic OAuth CLI and Populate ~/.claude/.credentials.json

This gist shows how to implement your own OAuth workflow so your tool can acquire Anthropic OAuth tokens and write them in the format the Claude Code SDK expects at ~/.claude/.credentials.json.

Notes

  • Uses an Authorization Code + PKCE flow via https://claude.ai/oauth/authorize and token exchange at https://console.anthropic.com/v1/oauth/token.
  • Default client id commonly used by tools: 9d1c250a-e61b-44d9-88ed-5944d1962f5e (override with your own if issued).
  • The authorize endpoint supports a copy/paste mode (no local server). Your CLI opens/prints a URL; the user pastes a code back.
  • Treat tokens as secrets; never log them.
@ben-vargas
ben-vargas / v5-tool-streaming-codex-cli.md
Created September 19, 2025 04:05
Tool Streaming Support for AI SDK Provider Codex CLI

Tool Streaming Support for AI SDK Provider Codex CLI

Issue Summary

GitHub Issue: #2 - Streaming tool calls? Requested by: @hbmartin Date: January 2025

The user is requesting support for streaming tool calls in streamText and streamObject, similar to the functionality planned for the Claude Code provider. This would enable building UIs that show tool calls and results as they happen.

Important Note on JSON Mode

@ben-vargas
ben-vargas / install-codex.sh
Created September 23, 2025 16:18
Codex Binary Install Script
#!/usr/bin/env bash
set -euo pipefail
# ==============================
# Codex Installer Script
# Repository: https://github.com/openai/codex
# ==============================
# Config (overridable via env or flags)
REPO="${REPO:-openai/codex}"