Add console output and logging to make errors visible to agents. Standard out is a critical leverage point - without it, agents cannot see errors or understand application state. Use when agents fail silently, when debugging agentic workflows, or when setting up a new codebase for agentic coding.
Adds console logging to make errors and state visible to agents. Use when functions fail silently, during agentic debugging, or when setting up codebases for autonomous coding.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install google-ecosystem@melodic-softwareThis skill is limited to using the following tools:
Guide for adding console output to make errors visible to agents. This is one of the most critical leverage points - without stdout visibility, agents operate blind.
Agents can only act on what they can see. If your application fails silently:
Standard out is often the missing link when agents fail.
def process_data(data):
return transform(data) # Silent - what happened?
function processData(data) {
return transform(data); // Silent - success? failure?
}
def process_data(data):
try:
result = transform(data)
print(f"SUCCESS: Processed {len(result)} items")
return result
except Exception as e:
print(f"ERROR in process_data: {str(e)}")
raise
function processData(data) {
try {
const result = transform(data);
console.log(`SUCCESS: Processed ${result.length} items`);
return result;
} catch (error) {
console.error(`ERROR in processData: ${error.message}`);
throw error;
}
}
Success with context
Errors with detail
State changes
Look for:
For each function, add output on success:
print(f"SUCCESS: {operation} completed - {context}")
Wrap in try/except with error output:
try:
# operation
except Exception as e:
print(f"ERROR in {function_name}: {str(e)}")
raise # Re-raise so agent sees the error
Run the application and verify:
import logging
# Simple print for immediate visibility
print(f"INFO: Starting {operation}")
print(f"SUCCESS: {operation} complete")
print(f"ERROR: {operation} failed - {error}")
# Or use logging for more control
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger.info(f"Starting {operation}")
logger.error(f"{operation} failed: {error}")
// Simple console for immediate visibility
console.log(`INFO: Starting ${operation}`);
console.log(`SUCCESS: ${operation} complete`);
console.error(`ERROR: ${operation} failed - ${error.message}`);
// Or use a logger
import { logger } from './logger';
logger.info(`Starting ${operation}`);
logger.error(`${operation} failed`, { error });
import "log"
log.Printf("INFO: Starting %s", operation)
log.Printf("SUCCESS: %s complete", operation)
log.Printf("ERROR: %s failed - %v", operation, err)
This is the most common place agents need visibility:
@app.post("/api/upload")
async def upload_file(file: UploadFile):
print(f"INFO: Received upload request for {file.filename}")
try:
result = await process_file(file)
print(f"SUCCESS: Uploaded {file.filename} - {len(result)} rows processed")
return {"status": "success", "rows": len(result)}
except Exception as e:
print(f"ERROR: Upload failed for {file.filename} - {str(e)}")
raise HTTPException(status_code=500, detail=str(e))
# BAD
def fetch_data():
return requests.get(url).json()
# GOOD
def fetch_data():
print(f"INFO: Fetching data from {url}")
response = requests.get(url)
print(f"SUCCESS: Received {len(response.content)} bytes")
return response.json()
# BAD - agent never sees the error
try:
risky_operation()
except:
pass
# GOOD - agent sees what went wrong
try:
risky_operation()
except Exception as e:
print(f"ERROR: risky_operation failed - {str(e)}")
raise
// BAD
try {
riskyOperation();
} catch (e) {}
// GOOD
try {
riskyOperation();
} catch (error) {
console.error(`ERROR: riskyOperation failed - ${error.message}`);
throw error;
}
After adding stdout:
Date: 2025-12-26 Model: claude-opus-4-5-20251101
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.