| name | log |
| description | Append a structured entry to the agent log with automatic rotation |
| user_invocable | false |
| args | run_id=<id> skill=<name> status=<SUCCESS|FAILED|WARNING> detail=<message> |
Agent Log
Append a structured log entry to <workspace>/.claude/memory/agent-log.md. This skill owns the log format, creation, and rotation. All other skills and agents call this instead of writing to the log directly.
Steps
Setup — Resolve <workspace>: The skill's base directory is <workspace>/.claude/skills/log/; walk up three directory levels and validate that <workspace>/.claude/.workspace exists. Use this <workspace> for all path references below. Abort with a setup-broken error if validation fails.
-
Parse input: Extract the fields from the arguments:
run_id — Identifier linking related entries (e.g., cos-2026-04-11-1). Use manual if no run ID was provided.
skill — Name of the skill or agent that produced this entry
status — SUCCESS, WARNING, or FAILED
detail — Brief description (item counts on success, error reason on failure)
-
Check if log file exists: Read <workspace>/.claude/memory/agent-log.md.
- If it doesn't exist, create it with this header:
# Agent Log
| Timestamp | Run ID | Skill | Status | Detail |
|-----------|--------|-------|--------|--------|
-
Append the entry: Add a new row with the current timestamp in ISO 8601 format (e.g., 2026-04-11T17:30Z).
-
Rotate: Count the data rows (excluding the header and separator lines). If there are more than 200, remove the oldest rows to keep exactly 200. Historical entries are preserved in git history.
-
No output: This skill is silent — it does not print anything to the user. It is a utility called by other skills.