Skip to content

Instantly share code, notes, and snippets.

View ben-vargas's full-sized avatar

Ben Vargas ben-vargas

View GitHub Profile
@ben-vargas
ben-vargas / AGENTS.md
Last active October 16, 2025 13:27
Bare Git Worktrees AGENTS.md

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/
@ben-vargas
ben-vargas / claude_codex_usage_windows.md
Created October 7, 2025 16:54
Consistent Usage Windows for Claude Code and Codex CLI

Running AI CLI Tools with Cron for 5-Hour Usage Windows

The Challenge

Anthropic and OpenAI enforce a 5-hour usage window - once I make my first request, I have 5 hours fixed usage before the window expires. This meant:

  • ❌ Unpredictable availability - window could expire mid-project or at random times during the work day
  • ❌ Frustration when usage windows expire at unopportune times
  • ❌ Consistent work schedule and usage window planning
@ben-vargas
ben-vargas / agent_sdk_builder_output.js
Created October 6, 2025 20:33
OpenAI Agent Builder - Agent SDK Output
import { OpenAI } from "openai";
import { runGuardrails } from "@openai/guardrails";
import { z } from "zod";
import { Agent, AgentInputItem, Runner } from "@openai/agents";
// Shared client for guardrails and file search
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
// Guardrails definitions
@ben-vargas
ben-vargas / 1-opencode_openai_oauth.md
Last active October 13, 2025 02:38
Config for opencode plugin: opencode-openai-codex-auth

Config for opencode plugin: opencode-openai-codex-auth

For those who might be having edge case behavior, or oddity with start/restart of opencode not retaining last used model properly, or "changing to a different model name" it's likely because of incorrect recommended setup in the opencode.json config file documented in the plugin repo.

You might try the config below, where model id is the key in the models object rather than user-friendly name.

This solved the odd behavior for me with launching opencode and /models slash command - it also provides shorter model names and easier search for all models with "oauth".

image
@ben-vargas
ben-vargas / reasoningEffort_and_reasoningSummary.md
Last active October 3, 2025 07:52
gpt-5 and gpt-5-codex OAuth (backend-api) research

● Complete Testing Results - Clarified for Plugin Normalization


GPT-5 Model (via gpt-5-nano)

reasoningEffort auto concise detailed none
minimal ✅ Success ❌ Unsupported ✅ Success ❌ Invalid
low ✅ Success ❌ Unsupported ✅ Success ❌ Invalid
medium ✅ Success ❌ Unsupported ✅ Success ❌ Invalid
@ben-vargas
ben-vargas / opencode-codex-plugin-model-settings.md
Created October 2, 2025 19:54
opencode plugin for chatgpt oauth - model settings support

Configuration Settings - Implementation Plan

This document serves as a comprehensive development guide for implementing configurable settings in the opencode-openai-codex-auth plugin. It outlines the configuration settings that will be supported for all GPT-5 family models when accessed through ChatGPT OAuth (subscription-based) authentication.

Supported Models

This plugin provides access to the following models via ChatGPT Plus/Pro subscription:

  1. gpt-5-codex - Optimized for coding tasks with built-in code-aware reasoning
  2. gpt-5 - General-purpose reasoning model for complex tasks
@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}"
@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

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.

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