Skip to main content

Agent Worklog

CI Release PyPI Python License: MIT PRs Welcome Ask DeepWiki

English | 繁體中文

Agent Worklog turns coding-agent sessions into weekly reports for managers, saving engineers time.

Agent sessions are grouped into weekly engineering reports

Architecture

flowchart LR
    subgraph Sources["Session sources"]
        OC["OpenCode<br/>(opencode db + export)"]
        CC["Claude Code<br/>(~/.claude/projects transcripts)"]
        CX["Codex<br/>(~/.codex state DB or rollouts)"]
    end

    subgraph Pipeline["Scan pipeline"]
        SC["ScanService<br/>discover → load → filter"]
        RV["RepositoryResolver<br/>origin → common dir → harness → path"]
    end

    subgraph Report["Report pipeline"]
        EX["Extraction<br/>evidence + 300-char cap"]
        RD["Redaction<br/>secret patterns"]
        SU["Summarizer<br/>rule-based or LLM"]
        US["Usage stats<br/>opencode stats or session tokens"]
        RE["MarkdownRenderer"]
        WR["Atomic write<br/>0600 on POSIX"]
    end

    CLI["doctor / scan / report"] --> OC
    CLI --> CC
    CLI --> CX
    OC --> SC
    CC --> SC
    CX --> SC
    SC --> RV
    RV --> EX
    EX --> RD
    RD --> SU
    US --> RE
    SU --> RE
    RE --> WR

Agent Worklog runs one of three sources per harness, loads only the sessions that overlap the requested period, groups them by repository, redacts and summarizes the evidence, and writes the Markdown report atomically with owner-only permissions.

Capabilities

Agent Worklog supports OpenCode, Claude Code, and Codex. Across supported coding-agent harnesses, it can:

  • Find coding-agent sessions across all projects, no matter which folder you are in.
  • Select sessions from recent days, a calendar week, or a specific date range.
  • Group Git worktrees that belong to the same repository.
  • Keep child and subagent sessions linked to the correct repository, or leave them out with --root-only.
  • List each repository's session titles and working folders in the report.
  • Summarize model and token usage when the selected harness provides it.
  • Check session information for common secret patterns before creating a report or sending data to an optional LLM.

Requirements

  • Python 3.11 or newer.
  • Git available as git.
  • One coding-agent harness: OpenCode (default), Claude Code, or Codex. OpenCode needs an opencode executable that provides opencode db and opencode export; Claude Code and Codex need no CLI, only a readable transcript store (~/.claude/projects or ~/.codex).

Installation

The recommended way to install the command-line tool is with pipx:

pipx install agent-worklog

You can also install it in a regular Python environment:

pip install agent-worklog

For development:

git clone https://github.com/mike840609/agent-worklog.git
cd agent-worklog
uv sync --locked --extra dev

Getting started

Check that the selected harness and Git are available:

agent-worklog doctor

Preview how Agent Worklog groups repositories for the previous full week:

agent-worklog scan --period last-week

Create the Markdown report without using an external LLM:

agent-worklog report --period last-week --no-llm

The default output is written under reports/.

Those three commands default to --harness opencode. For Claude Code or Codex, add --harness claude-code or --harness codex to each — no OpenCode installation is needed:

agent-worklog doctor --harness claude-code
agent-worklog report --harness claude-code --period last-week --no-llm
agent-worklog doctor --harness codex
agent-worklog report --harness codex --period last-week --no-llm

Command reference

Command What it does
doctor Checks that the selected harness and git are ready to use.
scan Shows which sessions fall in a period and how they group into repositories.
report Writes the Markdown report for a period.

scan and report share these options:

Option What it does
--days N Reports the last N days, ending now.
--period last-week Reports the previous full calendar week. last-week is the only accepted value.
--since ISO Starts the period at an exact time.
--until ISO Ends the period at an exact time. Requires --since.
--harness NAME Harness to read sessions from: opencode (default), claude-code, or codex.
--root-only Leaves out child and subagent sessions.
--sanitize / --no-sanitize Enables or disables OpenCode export redaction. Raw export is the default. OpenCode only.
--verbose Also shows export, fallback, and LLM warnings. For scan, also lists each repository's session titles and working folders.
--quiet Shows only the session count for scan, or the output path for report.

While scan and report are working, they show a transient progress status with the current stage. Session and repository stages also show a completed/total count. --quiet hides the progress status. For report --dry-run, progress is written to stderr so stdout contains only Markdown.

report also accepts:

Option What it does
--output PATH Writes to this file instead of the default folder.
--force Replaces the output file if it already exists.
--dry-run Prints the Markdown instead of writing a file.
--no-llm Creates the summary without an external LLM.
--allow-remote-llm Explicitly allows extracted, locally redacted evidence to be sent to the configured OpenAI-compatible endpoint for this invocation.
--detail LEVEL How much detail the report contains: full (default) or brief.

--detail brief produces a short report for a status update: it keeps the header, and for each repository the Repository: remote line, the session counts, and the summary and up to five each of Completed, Problems Resolved, and In Progress. It leaves out Key Files, Directories, Sessions, Branches, and the usage table. Warnings are always kept, at both detail levels, because they report data the tool could not read rather than work you did.

doctor also accepts --harness NAME, --quiet, and --verbose. --quiet hides the list of checks and reports only through the exit code; --verbose does not change what doctor prints. With --harness claude-code, doctor checks that the configured ~/.claude/projects directory exists and is readable, instead of checking for the opencode executable and database. With --harness codex, doctor checks that the configured ~/.codex directory exists and is readable, and reports which discovery path it will take: the state database by name, or directory scan when none is present.

Three rules apply:

  • Give exactly one of --days, --period, or --since (scan and report).
  • Use --until only together with --since (scan and report).
  • Do not use --verbose and --quiet together (all three commands).

Configuration

Agent Worklog uses environment variables for its settings. Variable names start with AGENT_WORKLOG_. Use __ between parts of a setting name. For example:

export AGENT_WORKLOG_REPORT__TIMEZONE="Asia/Taipei"
export AGENT_WORKLOG_REPORT__OUTPUT_DIRECTORY="reports"
export AGENT_WORKLOG_HARNESSES__OPENCODE__CLI__EXECUTABLE="opencode"
export AGENT_WORKLOG_HARNESSES__OPENCODE__CLI__SANITIZE="false"
export AGENT_WORKLOG_LLM__MODEL="gpt-5-mini"
export AGENT_WORKLOG_LLM__BASE_URL="https://api.openai.com/v1/"
export AGENT_WORKLOG_LLM__ENABLED="false"

See the configuration guide for a complete list of settings.

Privacy

OpenCode exports are raw by default so reports retain useful work details. Agent Worklog redacts common secret patterns locally and uses the rule-based summarizer unless each report invocation explicitly includes --allow-remote-llm. Use --sanitize for OpenCode's stronger redaction, which intentionally removes most work evidence. Reports may still contain private goals, filenames, commands, and full working paths — always review a report before sharing it.

See Privacy and security for the full details about data safety and current limits.

Exit codes

Code Meaning
0 Success
2 Invalid command options
3 Settings error
4 No matching activity
5 Harness or Git dependency error
7 Report file error

If one session cannot be read, Agent Worklog skips it and adds a warning to the report. If no sessions can be read, the command stops with an error instead of creating an empty report.

Support and limits

OpenCode, Claude Code, and Codex are the supported tools, selected with --harness. Markdown is the only report format, and Agent Worklog keeps no cache between runs.

Development checks

uv sync --locked --extra dev
uv run pytest --cov=agent_worklog --cov-fail-under=80
uv run ruff check .
uv run pyright
uv build

See Releasing Agent Worklog for release instructions.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_worklog-0.6.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_worklog-0.6.0-py3-none-any.whl (69.5 kB view details)

Uploaded Python 3

File details

Details for the file agent_worklog-0.6.0.tar.gz.

File metadata

  • Download URL: agent_worklog-0.6.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agent_worklog-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4ee4cfc0c023180a976fae31f7539f135e564d04f1f42815ce9af72ce89b08e6
MD5 f1dea692e2780f3d364bf878159b3972
BLAKE2b-256 0529fee37329aff520a78a7eb1b8de1774b02aafcb99d8bf695d61cdb84ea439

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_worklog-0.6.0.tar.gz:

Publisher: release.yml on mike840609/agent-worklog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_worklog-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: agent_worklog-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 69.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agent_worklog-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4882d31aef1a30a76680c467c260f1a069e4a055a114d074ff2bad91e9ef49b
MD5 44a7e991cb640224693634f60ec8f546
BLAKE2b-256 b9eb625bf62c1c842155e1da026c5c5ead7b3df5acdacf2e6d9dcc8d2ca3b530

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_worklog-0.6.0-py3-none-any.whl:

Publisher: release.yml on mike840609/agent-worklog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page