Install
$ agentstack add skill-abhattacherjee-claude-code-skills-error-log ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ● Shell / process execution Used
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Error Log — Capture Error Solutions to Obsidian
Analyze the current conversation for error -> investigation -> fix patterns, structure them as reusable troubleshooting notes, and save to the Obsidian vault.
Tools needed: Bash, Write, Read
Procedure
Follow these steps exactly. Do not skip steps or reorder them.
Step 1 — Read config
Run:
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
python3 -c '
import sys, os
import glob; sys.path.insert(0, max(glob.glob(os.path.expanduser("~/.claude/plugins/cache/*/obsidian-brain/*/hooks")), default="hooks"))
from obsidian_utils import load_config
c = load_config()
if not c.get("vault_path"):
print("ERROR: vault_path not configured", file=sys.stderr)
sys.exit(1)
print("VAULT=" + c["vault_path"])
print("SESS=" + c.get("sessions_folder", "claude-sessions"))
print("INS=" + c.get("insights_folder", "claude-insights"))
'
Parse each output line as KEY=VALUE, splitting on the first =.
If the file does not exist or is invalid JSON, tell the user:
> Config not found. Please run /obsidian-setup first to configure your Obsidian vault.
Stop here if config is missing.
Step 2 — Validate vault access
Run:
test -d "$VAULT_PATH/$INSIGHTS_FOLDER" && test -w "$VAULT_PATH/$INSIGHTS_FOLDER" && echo "OK" || echo "FAIL"
If FAIL, tell the user:
> The insights folder $VAULT_PATH/$INSIGHTS_FOLDER does not exist or is not writable. Run /obsidian-setup to fix this.
Stop here if FAIL.
Step 3 — Identify the error
Check if the user provided an argument after /error-log.
- With argument (e.g.
/error-log BrokenPipeError in subprocess): Use the description to search the current conversation for matching error context, investigation steps, and resolution. - Without argument (bare
/error-log): Scan the full conversation for error -> investigation -> fix patterns. Look for: - Stack traces, error messages, or exception output
- Debugging steps taken (hypothesis, investigation, failed attempts)
- The fix that ultimately resolved the issue
- If multiple errors were resolved, present a numbered list and ask the user which to log
If no error pattern is found in the conversation, tell the user:
> No error -> fix pattern detected in this session. You can run /error-log to manually describe an error to document.
Stop here if no error is found.
Step 4 — Structure the error note
Draft the note body with these four sections. Each section should be concise but complete enough to be useful months later when encountering the same error:
- Error: The exact error message, symptoms, and context where it appeared (include relevant stack trace snippets or command output if available, formatted as code blocks)
- Root Cause: Why the error happened — the underlying reason, not just the surface symptom
- Fix: The specific change or command that resolved it — include code diffs, config changes, or commands as code blocks
- Prevention: How to avoid this error in the future — linting rules, config patterns, pre-checks, or design principles
Step 5 — Auto-generate topic tags
Based on the error content, generate 1-3 topic tags. Tags should be lowercase, hyphenated, and specific to the technology or domain. Examples:
claude/topic/subprocess-pipesclaude/topic/python-asyncclaude/topic/npm-dependenciesclaude/topic/git-hooks
Step 6 — Show preview and ask for edits
Present the full note to the user including frontmatter:
---
type: claude-error-fix
date: YYYY-MM-DD
created_at:
source_session:
source_session_note: "[[]]"
project:
tags:
- claude/error-fix
- claude/project/
- claude/topic/
- claude/topic/
---
#
## Error
## Root Cause
## Fix
## Prevention
Where:
YYYY-MM-DDis today's date- `` is the current UTC timestamp at second precision. Get it via:
``bash python3 -c 'from datetime import datetime, timezone; print(datetime.now(timezone.utc).isoformat(timespec="seconds"))' ` Example: 2026-04-24T18:42:11+00:00`
- `
and` are derived together. Get session context via the shared helper:
``bash cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)" python3 -c ' import sys, os import glob; sys.path.insert(0, max(glob.glob(os.path.expanduser("~/.claude/plugins/cache/*/obsidian-brain/*/hooks")), default="hooks")) from obsidian_utils import load_config, get_session_context c = load_config() ctx = get_session_context(c["vault_path"], c.get("sessions_folder", "claude-sessions")) print("SID=" + ctx["session_id"] + " HASH=" + ctx["hash"] + " PROJECT=" + ctx["project"] + " SESSION_NOTE=" + ctx["session_note_name"]) ' ``
Parse the output to get SESSION_ID, HASH, PROJECT, and SESSION_NOTE.
Important: If SESSION_ID is unknown, use unknown for source_session and omit source_session_note entirely.
- `
is thePROJECTvalue fromgetsessioncontext()` (lowercased, hyphenated basename of cwd) - `` is a short, descriptive title for the error (e.g. "BrokenPipeError when piping subprocess output to head")
- The
source_session_notefield creates an Obsidian backlink to the source session note
Ask the user:
> Preview above. Would you like to: > - save as-is > - edit tags — add or remove tags > - edit content — tell me what to change > - cancel — discard this note
Wait for the user's response. Apply any requested edits and show the updated preview. Repeat until the user says save or cancel.
If cancel, stop here.
Step 7 — Generate filename
Construct the filename from these parts:
- Date:
YYYY-MM-DD(today) - Slug: The error title, lowercased, spaces replaced with hyphens, non-alphanumeric characters (except hyphens) removed, truncated to 50 characters
- Hash: 4-character hex hash derived from the current timestamp:
date +%s | md5 | cut -c29-32(macOS) ordate +%s | md5sum | cut -c1-4(Linux). Do NOT usetail -c 4— it counts the trailing newline as a byte and returns only 3 visible characters. - Suffix:
-error
Final filename: YYYY-MM-DD---error.md
Example: 2026-04-04-brokenpipeerror-subprocess-pipe-a3f2-error.md
Step 8 — Write the note
Run:
mkdir -p "$VAULT_PATH/$INSIGHTS_FOLDER"
Then use the Write tool to write the full note (frontmatter + body) to:
$VAULT_PATH/$INSIGHTS_FOLDER/YYYY-MM-DD---error.md
Then set permissions:
chmod 644 "$VAULT_PATH/$INSIGHTS_FOLDER/YYYY-MM-DD---error.md"
Step 9 — Confirm
Print:
> Error fix logged! > - File: $VAULT_PATH/$INSIGHTS_FOLDER/ > - Tags: claude/error-fix, claude/project/, claude/topic/, ... > - Open in Obsidian to view. This note will appear in the "Error Fixes" section of the Project Index dashboard.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: abhattacherjee
- Source: abhattacherjee/claude-code-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.