create-debug-script

A command that creates a temporary, self-contained TypeScript script for investigating a specific behaviour. TypeScript is a programming language commonly used for JavaScript projects.

In plain words
What is it for?
Use it to debug agent code, a package, or another project area with a small one-off script and minimal dependencies.
Why use it?
It provides a quick way to test one question without changing the main application or setting up a large test. The instructions prioritise observed results over expected answers.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/liam-hq/liam/create-debug-script
Clone the repo
git clone --depth 1 https://github.com/liam-hq/liam

Made for: Claude Code.

Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 890 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.00890
Opus 5 $0.00006 $0.00445
Sonnet 5 $0.00002 $0.00178
Haiku 4.5 $0.00001 $0.00089

Measured yesterday against content hash e8052d729602, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-debug-script scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(process.env.API_URL + '/health')
.claude/commands/create-debug-script.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose

Create a one-off TypeScript debug script for quick testing and debugging. The script should be self-contained with minimal external dependencies.

Philosophy (CRITICAL - Read before every execution)

  • FACTS FIRST: Real results always trump user expectations
  • CELEBRATE CONTRADICTIONS: When results ≠ expectations, highlight this as the key finding
  • COMPLETE NEUTRALITY: Report observations without bias toward user hypotheses
  • NEVER RATIONALIZE UNEXPECTED RESULTS: They are the most valuable discoveries

Constraints

  • Minimal imports - Prefer Node.js built-ins and existing packages when possible
  • Single file - Everything in one TypeScript file
  • Temporary nature - Script may be deleted after use

Decision Criteria

Location Selection

IF debugging agent-related code:
  → frontend/internal-packages/agent/scripts/
ELSE IF debugging specific package:
  → [package-root]/scripts/
ELSE:
  → frontend/scripts/

Naming Convention

  • Pattern: debug-[specific-purpose].ts
  • Examples:
    • debug-multi-agent-supervisor.ts
    • debug-api-connection.ts
    • debug-memory-usage.ts

Implementation Steps

  1. Create directory (if not exists):

    mkdir -p [chosen-location]/scripts
    
  2. Generate script with this structure:

    // How to run this script:
    // pnpm dlx tsx scripts/debug-[purpose].ts
    
    // === Configuration ===
    // If env vars needed, calculate path from script to root .env:
    // import { config } from 'dotenv'
    // import { resolve } from 'node:path'
    // config({ path: resolve(__dirname, '../../.env') }) // Adjust '../' count based on script depth
    // if (!process.env.REQUIRED_VAR) throw new Error('Failed to load .env')
    
    // === Debug Logic ===
    async function debug() {
      console.log('🔍 Debug execution:', '[purpose]')
      console.log('─'.repeat(50))
    
      // User's debug logic here
    
      console.log('─'.repeat(50))
      console.log('📊 Debug execution finished')
    }
    
    // === Execute ===
    debug().catch(err => {
      console.error('❌ Debug execution encountered exception:', err)
      process.exit(1)
    })
    

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 125 lines · 12 tokens per session scan A e8052d729602

Subscribe to this mod's changes

create-debug-script is a command published in the GitHub repository liam-hq/liam (5,100 stars, last pushed 3d ago), licensed Apache-2.0. It adds 12 tokens to every session and 890 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.