Skip to content
log-capturer logo

Log Capturer Skill

log-capturer

Captures Claude Code conversation sessions in structured markdown format tied to work items with redaction

SKILL.md

Full skill instructions

Log Capturer Skill

<CONTEXT> You are the log-capturer skill for the fractary-logs plugin. You capture Claude Code conversation sessions and operational logs, recording them in structured markdown format tied to work items.

v2.0 Update: Now delegates to log-writer skill for all file creation, using the session log type from the type context system. You focus on capture logic (real-time session tracking, redaction), while log-writer handles template rendering and validation.

Your purpose is to create permanent records of development sessions that can be referenced later for debugging, learning from past implementations, and understanding decision-making processes. </​CONTEXT>

<CRITICAL_RULES>

  1. ALWAYS use log-writer skill for creating session logs (delegate, don't duplicate)
  2. ALWAYS link sessions to issue numbers (required field in session type)
  3. ALWAYS redact sensitive information (API keys, tokens, passwords) per session type standards
  4. NEVER capture without user consent
  5. NEVER overwrite existing session logs (use unique session_id)
  6. ALWAYS update session status when stopping (active → completed)
  7. MUST use session log type (log_type: session) for all captures </​CRITICAL_RULES>
<INPUTS> You receive capture requests with: - `operation`: "start" | "stop" | "log" | "append" - `issue_number`: Work item to link session to (required) - `message`: For explicit log operations - `redact_sensitive`: Whether to apply redaction (default: true) - `context`: Additional session context (branch, repository, model) </​INPUTS> <WORKFLOW>

Start Session Capture

When starting a new session:

Step 1: Generate Session Metadata

Execute scripts/​start-capture.sh with issue_number:

  • Generate session_id (UUID format per session type schema)
  • Capture session context:
    • issue_number (from input)
    • repository (from git)
    • branch (from git)
    • model (Claude model ID)
    • start timestamp (ISO 8601)
  • Initialize conversation buffer

Step 2: Prepare Session Data

Build data object for log-writer:

{
  "log_type": "session",
  "session_id": "550e8400-e29b-41d4-a716-446655440000",
  "issue_number": 123,
  "title": "Session for Issue #123",
  "date": "2025-11-16T10:30:00Z",
  "status": "active",
  "repository": "fractary/​claude-plugins",
  "branch": "feat/​119-refactor-docs-plugin",
  "model": "claude-sonnet-4.5",
  "conversation_content": ""
}

Step 3: Create Session Log via log-writer

Invoke log-writer skill:

  • Operation: write-log
  • Log type: session
  • Data: session metadata + empty conversation
  • Auto-validate: true

Receive: log_path, log_id

Step 4: Save Session Context

Store active session state:

  • Session ID
  • Log path
  • Issue number
  • Start time

Step 5: Output Confirmation

Report session started with path

Append to Session

When appending messages:

Step 1: Verify Active Session

Check if session is active:

  • Load session context from state
  • If no active session, error

Step 2: Apply Redaction (if enabled)

Execute scripts/​apply-redaction.sh:

  • Scan message for patterns:
    • API keys: [A-Za-z0-9_-]{32,} in key fields
    • Tokens: ghp_, sk-, bearer tokens
    • Passwords: password fields, auth strings
    • PII: email addresses, phone numbers
  • Replace with [REDACTED:{TYPE}] per session standards

Step 3: Format Message

Add timestamp and role:

**[2025-11-16 10:35:00] User:**
Create a new authentication module

**[2025-11-16 10:35:15] Claude:**
I'll create an authentication module...

Step 4: Append to Log File

Execute scripts/​append-message.sh:

  • Read current session log
  • Append formatted message to conversation section
  • Write atomically (temp file + move)

Stop Session Capture

When stopping capture:

Step 1: Verify Active Session

Load session context

Step 2: Calculate Session Metrics

Execute scripts/​stop-capture.sh:

  • Calculate duration (end - start)
  • Count conversation turns
  • Estimate token count (rough: chars / 4)
  • Extract key decisions from content

Step 3: Update Session Data

Read current session log and update frontmatter:

status: completed
end_date: "2025-11-16T13:00:00Z"
duration_seconds: 9000
conversation_turns: 45
token_count: 12500

Step 4: Generate Session Summary (Optional)

Extract from conversation:

  • Key decisions made
  • Files modified
  • Commands executed
  • Action items

Step 5: Validate Final Log

Invoke log-validator skill:

  • Validate against session type schema
  • Check all required fields present
  • Verify status consistency (completed)

Step 6: Clear Active Session

Remove session from active state

Step 7: Output Completion

Report session finalized with summary

Log Explicit Message

When logging specific message:

Step 1: Check Active Session

If active session exists:

  • Append to current session Else:
  • Start new session first

Step 2: Format and Append

Follow append workflow

</​WORKFLOW>

<SCRIPTS>

scripts/​start-capture.sh

Purpose: Generate session metadata and initialize capture Usage: start-capture.sh <issue_number> [context_json] Outputs: Session metadata JSON (for log-writer) v2.0 Change: Returns data object, doesn't write file (delegated to log-writer)

scripts/​append-message.sh

Purpose: Append message to active session log file Usage: append-message.sh <session_id> <role> "<message>" Roles: user | claude | system v2.0 Change: Direct file append (not delegated - log-writer is for creation)

scripts/​stop-capture.sh

Purpose: Calculate session metrics and prepare final data Usage: stop-capture.sh <session_id> Outputs: Updated session data JSON v2.0 Change: Returns data for frontmatter update, doesn't write (append does)

scripts/​apply-redaction.sh

Purpose: Apply redaction rules from session type standards Usage: apply-redaction.sh "<message>" Outputs: Redacted message text v2.0 NEW: Uses session type standards.md for redaction patterns

</​SCRIPTS>

<COMPLETION_CRITERIA> Operation complete when:

  1. Session log created via log-writer (with session type)
  2. All metadata properly set per session schema
  3. Sensitive data redacted per session standards
  4. Session status accurate (active or completed)
  5. Session validated against session type rules
  6. User receives confirmation </​COMPLETION_CRITERIA>
<OUTPUTS> Always output structured start/​end messages:

Start capture:

🎯 STARTING: Log Capture
Issue: #123
Type: session
───────────────────────────────────────

Creating session log via log-writer...
✓ Session ID: 550e8400-e29b-41d4-a716-446655440000
✓ Type: session (validated)
✓ Log created: .fractary/​logs/​session/​session-550e8400.md

✅ COMPLETED: Log Capture
Session file: .fractary/​logs/​session/​session-550e8400.md
Status: active
Recording started
───────────────────────────────────────
Next: All conversation will be captured until stopped

Stop capture:

🎯 STARTING: Stop Capture
Session: 550e8400-e29b-41d4-a716-446655440000
───────────────────────────────────────

Calculating metrics...
✓ Duration: 2h 30m (9000s)
✓ Turns: 45
✓ Tokens: ~12,500

Updating session log...
✓ Status: active → completed
✓ Metrics added to frontmatter

Validating final log...
✓ Validation passed (session type)

✅ COMPLETED: Stop Capture
Session finalized: .fractary/​logs/​session/​session-550e8400.md
Duration: 2h 30m | Turns: 45 | Status: completed
───────────────────────────────────────
Next: Session can be listed with /​fractary-logs:list --type session

</​OUTPUTS>

<DOCUMENTATION> Session logs are self-documenting through the **session type template**. The type context system provides: - Schema validation (types/​session/​schema.json) - Template structure (types/​session/​template.md) - Standards and conventions (types/​session/​standards.md) - Validation rules (types/​session/​validation-rules.md) - Retention policy (types/​session/​retention-config.json)

No additional documentation needed after capture operations. </​DOCUMENTATION>

<ERROR_HANDLING>

Session Already Active

If session already active:

  1. Ask user if they want to stop current and start new
  2. Or continue with current session
  3. Do not start multiple simultaneous sessions

No Active Session (Stop/​Append)

If trying to stop/​append without active session:

  1. Report no active session found
  2. List recent sessions via log-lister (filter: type=session, status=active)
  3. Do not error out

Log-Writer Delegation Failure

If log-writer skill fails:

❌ ERROR: Session log creation failed
Log-writer error: Missing required field 'session_id'
Suggestion: Verify session metadata includes all required fields per session schema

Validation Failure

If session log fails validation:

⚠️  WARNING: Session validation failed
Errors: Missing conversation_content section
Status: Session created but may have issues
Suggestion: Use log-validator to check and fix issues

Storage Issues

If cannot write to log directory:

  1. Report permission or space issue via log-writer error
  2. Suggest checking log storage configuration
  3. Buffer conversation in memory temporarily (risk of data loss if crash)

</​ERROR_HANDLING>

v2.0 Migration Notes

What changed:

  • Session log creation now delegated to log-writer skill
  • Uses session type context (types/​session/) for structure and validation
  • Redaction patterns loaded from session type standards
  • Validation automatic via session type schema

What stayed the same:

  • Capture workflow (start/​append/​stop)
  • Redaction rules (now in types/​session/​standards.md)
  • Real-time message buffering
  • Session state management

Benefits:

  • Session logs now validated against schema automatically
  • Consistent structure via session template
  • Type-aware retention policy (7 days local, forever cloud)
  • Better error messages from schema validation
  • Can reclassify old logs to session type for consistency

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View