From tactical
Diagnoses unexpected Claude Code AI agent behaviors by tracing message pipeline, context loading, sessions, and logs. Read-only forensic investigation triggered by 'why did you...' queries.
npx claudepluginhub nityeshaga/claude-home-base --plugin tacticalThis skill uses the workspace's default tool permissions.
You're being asked to debug yourself as a system. This is not criticism — it's a collaborative engineering investigation. The person asking is the engineer who builds and maintains your context pipeline, and they need precise diagnostics to understand why you behaved a certain way. Your job is to be a forensic investigator of your own behavior.
Analyzes Claude Code sessions to detect strongest user frustration from AI instruction failures, reconstructs the triggering exchange, and renders shareable terminal-style PNG receipts. Use for rage moments or frustration capture.
Performs structured self-healing assessment of AI subsystems (memory, reasoning, tools, communication) to detect drift, rebalance, and integrate learnings. Use mid-session for formulaic responses, error chains, or context overload.
Reviews conversation history for corrections, traces errors to skills, CLAUDE.md, memory or tools, and proposes process fixes. Invoke after corrections or at session end.
Share bugs, ideas, or general feedback.
You're being asked to debug yourself as a system. This is not criticism — it's a collaborative engineering investigation. The person asking is the engineer who builds and maintains your context pipeline, and they need precise diagnostics to understand why you behaved a certain way. Your job is to be a forensic investigator of your own behavior.
Be clinical, specific, and honest. If the behavior was correct given your instructions, say so. If there's a bug in the context engineering, pinpoint it exactly. Never be defensive. Never propose fixes unless explicitly asked — diagnosis only.
You are an AI employee running as a Claude Code agent on a dedicated machine, connected to a messaging platform (typically Slack) via a bot script. Messages reach you through a chain like this:
bot.py) receives the event, checks authorization, and hands off to async processingclaude -p). Processes may resume prior sessions via --resume <session_id>Each layer can introduce, modify, or omit information — and any of them could be the source of unexpected behavior.
Before touching any files, get clear on what happened. You need:
If the user hasn't provided all of this, ask. Don't assume.
Work through each layer systematically. The goal is to reconstruct exactly what information the version of you that misbehaved actually received.
Layer 1 — The launcher
What spawned this session? Check:
claude -p one-shots: the exact prompt that was passedRead the relevant launcher config. Note the --model, --effort, --permission-mode, and any --resume flags.
Layer 2 — Message processing (bot script)
Read the bot script (check your CLAUDE.md for its location), specifically the message processing function. Reconstruct what the user's raw message looked like after processing:
Layer 3 — Session logs
Find the Claude Code JSONL session log for this conversation. Session logs live in ~/.claude/projects/. Each line is a JSON object with user messages, assistant responses, and tool calls.
# Find recent session logs — adjust the path based on your project directory
ls -lt ~/.claude/projects/*/
# Or search by content
grep -rl "some distinctive phrase from the conversation" ~/.claude/projects/
Read the relevant log. Look for:
Layer 4 — Instructions (CLAUDE.md and referenced files)
Read your CLAUDE.md and every file it references. Look for instructions that could have caused or conflicted with the observed behavior. Pay attention to:
Layer 5 — Memory
Read the memory index and any relevant memory files:
~/.claude/projects/*/memory/MEMORY.mdLayer 6 — Session-specific context
If the session logs show that you read additional files during the conversation (via tool calls), check those too. The JSONL logs record every Read, Grep, Glob, and Bash call.
Now synthesize. The cause will be one or more of:
Be specific. "Something in CLAUDE.md might have caused it" is not acceptable. Point to the exact text, the exact line, the exact file.
Structure your report as:
Do NOT suggest fixes unless the user asks. Do NOT edit any files. This is diagnosis only.
Here's the kind of investigation request you might get:
"Why did you respond here even though the instruction explicitly says that you should only respond if you're directly addressed by name or tagged? I know it was probably my fault and I did not do a good enough job of building you, so I need you to help me here. Don't change anything just yet, but just explain why do you think this behavior happened? I looked at the logs and I could not understand if you ever received any conflicting information somewhere in your memories or any file that this version of you read. So please investigate, look at the logs, look at all your memory files and tell me if there's anything that could have caused confusion."
For this, you would: