Extract Claude Code work history and update daily notes. Use when user asks to update daily file with today's work, sync work history, record activities, or generate daily summary from Claude Code history.
Extracts today's Claude Code work history from `~/.claude/history.jsonl` and generates a structured markdown summary grouped by project and ticket. Use when user asks to update daily files, sync work history, record activities, or generate daily summaries from Claude Code history.
/plugin marketplace add devstefancho/claude-plugins/plugin install worktrace-plugin@devstefancho-claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/summarize.mdreferences/template.mdscripts/worktrace.pyExtract today's Claude Code work history from ~/.claude/history.jsonl and generate a structured markdown summary grouped by project and ticket.
MUST DO:
python scripts/worktrace.py --config config.jsonNEVER DO:
~/.claude/history.jsonl directly with Bash/jqfind, grep, cat to read session files manuallyWHY: The script handles complex logic (date filtering, ticket extraction, session lookup) that is error-prone and inefficient when done manually with shell commands. The script is optimized for this task.
When config.json doesn't exist in the plugin directory:
Ask user for output directory (use user's preferred language)
Ask user for ticket patterns (optional)
[A-Z]+-\d+ (matches PROJ-123 style)Create config.json with user's answers:
{
"output_dir": "<user-provided-path>",
"ticket_patterns": ["[A-Z]+-\\d+"],
"timezone": "Asia/Seoul"
}
Set up config (optional but recommended):
cp config.example.json config.json
# Edit config.json to set output_dir
Run with config:
python scripts/worktrace.py --config config.json
Or run directly with CLI args (overrides config):
python scripts/worktrace.py --output-dir /path/to/daily
Priority: CLI args > config.json > defaults
IF config.json does not exist:
1. Ask user for output directory path (in user's language)
2. Ask user for ticket patterns (optional, default: [A-Z]+-\d+)
3. Create config.json with user's answers
4. Continue to Phase 1
# REQUIRED: Run the Python script
python scripts/worktrace.py --config config.json
# Or with CLI overrides
python scripts/worktrace.py --output-dir /path/to/daily --date 2024-01-15
Important:
output_dir is configured: Script saves directly to daily file| Option | Description |
|---|---|
--output-dir PATH | Save to daily file in directory |
--ticket-pattern REGEX | Custom ticket pattern (repeatable) |
--timezone TZ | Timezone for "today" calculation |
--config FILE | Load settings from JSON config |
--json | Output as JSON instead of markdown |
Extract with custom ticket patterns:
python scripts/worktrace.py \
--ticket-pattern "AMAP-\d+" \
--ticket-pattern "IE-\d+"
Use config file:
python scripts/worktrace.py --config config.json
## Claude Code Work History
### PROJ-123 (webapp)
- Implement login form validation
- Fix password reset flow
### API-456 (api-service)
- Fix null pointer exception in user service
### Other (docs)
- Update README documentation
When output_dir is specified:
{YYYY-MM-DD}.md in the directory## Claude Code Work History section onlyFor detailed configuration options including:
| Issue | Cause | Solution |
|---|---|---|
| "No entries found" | No activity for the target date | Check --date option or verify Claude Code was used |
| Script not found | Wrong working directory | Run from plugin root directory |
| Permission denied | File access issue | Check file permissions for ~/.claude/ |
| Config not found | Missing config.json | Run First-time Setup (Phase 0) |
If issues persist, use JSON output for debugging:
python scripts/worktrace.py --config config.json --json
This outputs raw data structure for inspection.
If the Python script fails:
~/.claude/history.jsonl existspython --version)python scripts/worktrace.py --output-dir /path/to/daily