Captures Claude Code conversation sessions in structured markdown format tied to work items with redaction
Captures Claude Code conversations in structured logs linked to issue numbers, with automatic redaction of sensitive data. Starts when you request session tracking and stops to finalize metrics and validate against session schema.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-logs@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
docs/session-logging-guide.mdscripts/append-message.shscripts/link-to-issue.shscripts/start-capture.shscripts/stop-capture.shworkflow/capture-session.mdv2.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>
When starting a new session:
Execute scripts/start-capture.sh with issue_number:
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": ""
}
Invoke log-writer skill:
Receive: log_path, log_id
Store active session state:
Report session started with path
When appending messages:
Check if session is active:
Execute scripts/apply-redaction.sh:
[A-Za-z0-9_-]{32,} in key fieldsghp_, sk-, bearer tokens[REDACTED:{TYPE}] per session standardsAdd 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...
Execute scripts/append-message.sh:
When stopping capture:
Load session context
Execute scripts/stop-capture.sh:
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
Extract from conversation:
Invoke log-validator skill:
Remove session from active state
Report session finalized with summary
When logging specific message:
If active session exists:
Follow append workflow
</WORKFLOW> <SCRIPTS>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)
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)
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)
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
<COMPLETION_CRITERIA> Operation complete when:
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>
If session already active:
If trying to stop/append without active session:
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
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
If cannot write to log directory:
</ERROR_HANDLING>
What changed:
What stayed the same:
Benefits: