work-reconcile
Skill1 starsChanged 50 days agoMITView on GitHub
Reconcile the timesheet for a past period (week, month) across all sessions. Reconstructs what you actually worked on — primarily from agent session logs, confirmed by git/GitHub/Calendar/ClickUp — diffs it against what is already logged in Toggl/ClickUp, and after you approve each item writes only the missing time. Use when the user says "/work-reconcile", "doplň výkaz", "dorovnej timesheet", "co jsem zapomněl vykázat", "fill my timesheet", "reconcile my hours", "co chybí ve výkazu za minulý měsíc". For gaps in just the current session, that is tracker-backfill.
In this repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- anonymize-outputSkill
- cart-fillSkill
- client-questionsSkill
- code-reviewSkill
- conventional-commitSkill
- critical-pathSkill
- debate-replySkill
- decision-analysisSkill
- dependency-diagramsSkill
- dm-catchupSkill
- dm-composeSkill
- dockerizeSkill
- epic-breakdownSkill
- geo-page-auditSkill
- init-projectSkill
- kodexSkill
- launchpad-fixSkill
- mail-catchupSkill
- mcp-server-adoptSkill
- merge-prSkill
- mikrotik-auditSkill
- oponenturaSkill
- pr-rebase-sweepSkill
- raw-source-checkSkill
- resource-busySkill
- retroSkill
- second-opinionSkill
- semver-releaseSkill
- session-recallSkill
- skill-dry-runSkill
- skillifySkill
- skillset-adoptSkill
- task-deliverySkill
- task-estimateSkill
- teammate-checkSkill
- team-standupSkill
- token-auditSkill
- tracker-backfillSkill
- tracker-log-entrySkill
- tracker-setup-trackerSkill
- tracker-startSkill
- tracker-stopSkill
- wireguard-diagnoseSkill
- work-endSkill
- work-setupSkill
- work-standupSkill
- work-startSkill
- work-statusSkill
- worktree-cleanupSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Load effective config: Read ~/.claude/plugins/work/config.json.
- Very specific: line 37
If missing: stop with (in the configured language) "Žádná konfigurace work skillů.
- Distinctive: line 98
Echo the resolved window: before doing anything else, e.g.
- Very specific: line 316
Call mcp_Google_Calendar__list_events for [since, until].
- Very specific: line 326
mark, but do not drop, a solo event: no attendee other than the user *and* the user is the organizer → add 'solo?' to origin_marks.
- Distinctive: line 347
If the MCP is absent, append a one-line warning "Kalendář nedostupný — schůzky vynechány." and skip.
- Very specific: line 604
If project_filter (--project) is set, drop blocks whose resolved project does not match it (case-insensitive substring).
- Very specific: line 609
If its timestamp falls inside an existing AI block's [start, end] (same repo/project where determinable), attach it: add a mark to that …
- Very specific: line 614
If it falls outside every AI block, promote it to a standalone candidate_block with source='commit' (or gh/clickup), origin='commit-only', …
- Very specific: line 623
If project_filter is set, drop any newly-promoted commit-only block whose paired project does not match it (same rule as step 5's filter).
- Distinctive: line 733
COVERED means "already logged", not "impossible": When a block is buried under an entry for a *different* project, the overlap may be real …
- Very specific: line 842
If dry_run, stop here after printing what *would* be written, grouped like the summary.
- Very specific: line 848
Safety (identical to the
tracker-log-entryskill): never put the API key in argv. - Very specific: line 858
If the block's end is null (commit-only or manual items filled in without an end time), derive it with date as start + duration before …
- Distinctive: line 899
Per-item failure isolation: if one write fails, record the error and
- Very specific: line 902
Idempotency: before writing, and on any re-run, treat an existing entry that already carries sink.reconciled_tag overlapping the same block …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Work Reconcile
Retrospective timesheet backfill: what did I actually work on that I never logged — and write the missing time. The forward-looking siblings answer different questions:
| Skill | Question | Direction |
/work-start | What should I do? | forward |
/work-status | What changed? | since AM |
/work-end | What did I close today? | today |
/work-standup | What did I do since last time? | back (report) |
/work-reconcile | What did I do but not log — and fill it in | back (write) |
Unlike the others, this skill writes to the tracker. It never writes automatically: the flow is always propose → confirm → write.
Arguments
--since YYYY-MM-DD(optional): start of the reconcile window (bare date =T00:00local). Default: see step 2.--until YYYY-MM-DD(optional): end of the window (bare date =T23:59:59local). Default: now.--project <name>(optional): restrict to one project by name (case-insensitive substring).--dry-run(optional): run the full flow through review and only print the proposals — write nothing.
Steps
- Load effective config. Read
~/.claude/plugins/work/config.json.- If missing: stop with (in the configured language) "Žádná konfigurace work
skillů. Spusť
/work-setup." / "No work skills config. Run/work-setup." - Parse it. Read
config.language(defaulten); phrase all user-facing text in it, keeping proper nouns/IDs/URLs/durations unchanged. Every quoted user-facing string in this skill — review labels, menu options, warnings, the summary line — is an example written incs. Render it inconfig.language; none of them is a literal the user must see verbatim. Where a string is given as"<czech>" / "<english>", those are one message in two languages, not two messages. - Build
effective_configby overlaying thereconcileblock on these defaults (a MISSINGreconcileblock or any missing key falls back here — do not crash):default_window=last_month,gap_threshold_min=15,edge_pad_min=2,round_to_min=5,min_block_min=5,coverage_covered=0.9,coverage_missing=0.1,ai_sessions.enabled=true,ai_sessions.harnesses=auto(every adapter in step 3A whose root exists — all of them, not the first one found),ai_sessions.projects_dir(root of the Claude Code layout; default~/.claude/projects, and~/.gemini/antigravity-cli/projectsis read with the same adapter when it exists),ai_sessions.codex_dir=~/.codex/sessions,calendar.as_work=true,calendar.exclude_all_day=true,calendar.exclude_declined=true,calendar.exclude_keywords=["oběd","lunch","dovolená","holiday", "vacation","day off","out of office"],sink.target=toggl,sink.billable=true,sink.reconciled_tag=reconciled.calendar.as_workalso gates the Calendar source: when false, Calendar is not fetched at all. - Where the
reconcileblock is read from. The canonical location is top-levelconfig.reconcile.*— that is what/work-setupwrites, andcalendar.*lives atconfig.reconcile.calendar.*. A hand-edited config often puts the calendar half where it feels natural instead, underconfig.sources.google_calendar.reconcile.*; observed live on 2026-08-26, where a user's ownexclude_keywordssat there and was silently ignored, so the built-in defaults ran and their filter never applied. Read that nested block as a fallback, and say so out loud — "Kalendářové nastavení načteno zesources.google_calendar.reconcile(zastaralé umístění); přesuň ho doreconcile.calendar." / "Calendar settings read fromsources.google_calendar.reconcile(legacy location); move them toreconcile.calendar." Never merge both halves silently: two live locations for one setting is how the first one stops being read.
- If missing: stop with (in the configured language) "Žádná konfigurace work
skillů. Spusť
- Resolve the window
[since, until].until:--untilif given (bare date →T23:59:59local), else now.since:--sinceif given (bare date →T00:00local), else derive fromeffective_config.reconcile.default_window:last_month(default): first day of the previous calendar month at00:00local; and if--untilwas not given, setuntilto the last moment of that previous month (so the default run reconciles exactly last month).last_week: now minus 7 days at00:00local.- a bare
YYYY-MM: that whole month. Computelast_monthboundaries withdate(never by hand):
# macOS: first day of previous month 00:00 local date -v1d -v-1m -v0H -v0M -v0S +%Y-%m-%dT%H:%M:%S # macOS: last moment of previous month = (first day this month) - 1 second date -v1d -v0H -v0M -v0S -v-1S +%Y-%m-%dT%H:%M:%S # Linux: date -d "$(date +%Y-%m-01) -1 month" +%Y-%m-%dT00:00:00 # date -d "$(date +%Y-%m-01) -1 second" +%Y-%m-%dT%H:%M:%S- Store
project_filter=--projectvalue or null;dry_run= whether--dry-runwas passed. - Echo the resolved window before doing anything else, e.g. "Dorovnávám
výkaz od
<since>do<until>." so an unexpected default is visible.
Fetch all enabled sources — IN PARALLEL where they are MCP calls (one message, multiple tool_use blocks). Probe each MCP source with
ToolSearchfirst; if absent, append a warning and skip. Build the listblocks. Into that same message put everything else that needs only the window: the local session-log scans of source A (scripts, no MCP), the Toggl project list of step 5, and step 7's existing-entries reads of the trackers insink.target. Only git (source C) waits for a second round, because its repo list comes from the session scan.A. Agent session logs (primary, if
effective_config.reconcile.ai_sessions.enabled):Read every harness the user runs, and treat none of them as primary. People mix harnesses — one as the daily driver, another as a fallback when a usage limit hits or for a particular kind of task — and each keeps its own log tree. Reading only one makes the days spent in the other look empty, and an empty day reads as "nothing to reconcile". Measured 2026-10-06: in a one-week window, two whole working days of one project ran only in a second harness, without a single line in the first one's tree — about four and a half hours of agent time that a single-harness read would never have seen.
Each harness is read through an adapter that answers the same few questions; everything after extraction — clipping to the window, the per-day split, gap-capping, project pairing, the coverage diff — is shared:
Harness Root Session file User prompt Working dir Subagent tell Claude Code projects_dir<slug>/<session>.jsonl(depth 1)type: userlines with text contentcwdon each linelives in <slug>/<session>/subagents/Codex codex_dirYYYY/MM/DD/rollout-<start>-<id>.jsonlevent_msg+payload.type: item_completed+payload.item.type: UserMessagesession_meta.payload.cwdsession_meta.payload.sourceis an object with asubagentkey~/.gemini/antigravity-cli/projectsis read with the Claude Code adapter — that is the layout this skill has always assumed for it — but it has not been re-verified against this procedure; if its files yield no timestamps, handle it as an unknown harness (below) rather than reporting no work.A harness without an adapter here is inspected before it is counted. Open one of its files, tally the line types, and find the timestamp field, the shape of a user prompt, the working directory and how a subagent's file differs from its parent's; then write the adapter. Never fold such files in through a guessed parser: a parser that matches nothing returns zero, and zero is indistinguishable from a day without work.
All adapters feed one pool. Two harnesses can run at the same wall-clock, so the per-day union in step 4 runs over the timestamps of every harness together; summing per-harness totals counts that time twice.
Claude Code layout. Session logs live at
<projects_dir>/<encoded-path>/*.jsonl, one file per session; the directory name is the working directory with/→-. Each line is a JSON object withtimestamp(ISO 8601 UTC),type(user/assistant/ai-title/…).Three properties of this tree cost real hours if you take it at face value — all three measured on a live
~/.claude/projectson 2026-08-26, where the naive reading inflated one month from 141 h to 254 h:- Subagent transcripts are nested one level deeper, at
<projects_dir>/<slug>/<session-uuid>/subagents/agent-*.jsonl(775 of 1340 files on that machine). A subagent runs inside its parent session, so its timestamps are already covered by the parent's — counting them adds the same minutes twice. A recursivefindsweeps them in silently, so match at depth 1 only. - A
.jsonlis a resumable session, not a work block. The worst case observed spanned 2026-07-15 → 2026-08-09 with 24 259 messages and gap-capped to 3 425 min (57 h) in a single row. Split every session into one block per local calendar day. - A session can straddle the window edge, so compute from timestamps
inside
[since, until]only — clippingstart/endwhile summing all of them charges the window for work outside it (that same session carried nine days of August).
DIR="${projects_dir/#\~/$HOME}" # expand ~ # `since`/`until` are LOCAL wall-clock (step 2). On macOS `date -u -j -f` # parses its input as UTC, so converting them that way shifts the window by # the zone offset — verified 2026-08-26 in CEST: a July reconcile dropped the # first two hours of 1 July and pulled in the last two hours of 31 July as # "1 August" rows. Parse as local first (plain `-j -f` → epoch), then format # as UTC; this also picks up the DST rule in force *on that date*, which # appending a literal `$(date +%z)` would not. SINCE_UTC=$( { E=$(date -j -f "%Y-%m-%dT%H:%M:%S" "<since>" +%s) && date -u -r "$E" +%Y-%m-%dT%H:%M:%SZ; } 2>/dev/null \ || date -u -d "<since>" +%Y-%m-%dT%H:%M:%SZ) # Linux: -d already parses as local UNTIL_UTC=$( { E=$(date -j -f "%Y-%m-%dT%H:%M:%S" "<until>" +%s) && date -u -r "$E" +%Y-%m-%dT%H:%M:%SZ; } 2>/dev/null \ || date -u -d "<until>" +%Y-%m-%dT%H:%M:%SZ) # depth 1 only: <slug>/<session>.jsonl, never <slug>/<uuid>/subagents/*.jsonl find "$DIR" -mindepth 2 -maxdepth 2 -name '*.jsonl' -type fFor each
*.jsonl, extract with a small Python filter (robust to non-JSON lines) the in-window timestamps grouped by local day, plus theai-title:python3 - "$f" "$SINCE_UTC" "$UNTIL_UTC" <<'PY' import json, sys, collections, datetime f, since, until = sys.argv[1], sys.argv[2], sys.argv[3] P = lambda x: datetime.datetime.fromisoformat(x.replace('Z','+00:00')) lo, hi = P(since), P(until) ts, title = [], None for line in open(f, encoding='utf-8', errors='replace'): try: d = json.loads(line) except Exception: continue if not isinstance(d, dict): continue t = d.get('timestamp') if t: ts.append(t) if d.get('type') == 'ai-title': # the field is 'aiTitle'; 'content' is a tolerant fallback for other # harnesses. Reading only 'content' yields None on every Claude Code # session (verified 2026-08-26: 550 of 567 files carry aiTitle), so # every row degrades to the "Práce v <dir>" placeholder. title = (d.get('aiTitle') or d.get('content') or title) ts = sorted(P(t) for t in ts if t) ts = [t for t in ts if lo <= t <= hi] # clip, do not merely mark if not ts: sys.exit(0) perday = collections.defaultdict(list) # local day (use the TZ offset for t in ts: # the machine reports) perday[t.astimezone().strftime('%Y-%m-%d')].append(t.isoformat()) for day, dts in sorted(perday.items()): print(json.dumps({'day': day, 'first': dts[0], 'last': dts[-1], 'n': len(dts), 'title': title, 'ts': dts})) PYEach emitted line is one
candidate_block:source='ai',harness='claude',raw_messages_ts=ts(that day's slice, kept for step 4),start/end= that day's first/last ts converted to local (viadate),title= theai-title(or, if null, "Práce v<dir>"),project_hint= the decoded working directory (see step 5 — the whole path, not just its last segment). The encoding is lossy: it maps both/and.to-, so-Users-…-www-example-shop-czcould be any of several real paths. Do not guess — resolve the slug by longest-prefix match against directories that actually exist under the checkout root, and where the directory is gone (a deleted worktree) keep the raw slug and let the step 5 markers speak,origin_marks=[].
Drop sessions a hook started, not a person. Some setups run a PostToolUse hook that spawns a fresh agent session to review each diff for security issues; those land in the same tree as ordinary sessions, under the repo's own slug. Their tell is the content: every user prompt in them is the hook's fixed brief (e.g. "Review this change for security vulnerabilities"). They run inside a session the user is already working in, so their minutes are either covered by that parent or pure agent time — never time to bill. Measured 2026-09-22 and 2026-09-24: 6 and 17 such sessions in two windows, each one to three minutes long. Skip a block when all its user prompts carry the hook's brief. The rule holds for every adapter, not only this one.
Codex layout. Session files live at
<codex_dir>/YYYY/MM/DD/rollout-<start>-<id>.jsonl; every line carries atimestamp(ISO 8601 UTC), atypeand apayload. Three traps, all measured on a live tree on 2026-10-06:- The date directory is the day the session started, not the days it
ran. A session filed under 30 September carried lines from 1 October.
Select files by modification time (
mtime >= since) and clip their timestamps to the window — never by the directory name. - Subagents sit beside their parent, not below it. The approval
reviewer (
source: {"subagent": {"other": "guardian"}}) and spawned threads ({"subagent": {"thread_spawn": …}}) get their own rollout file in the same day directory, with the parent's working directory — 10 of 17 files in that window, one of them worth two hours on its own. Like Claude Code subagents they run inside a parent session, so skip every file whosesession_meta.payload.sourceis an object with asubagentkey; a top-level session has a string there (cli,vscode). - Not every
role: usermessage is the user.response_itemlines withrole: useralso carry the instructions file the harness injects at the start of a turn, so reading prompts from them makes every session look like it is about whatever that file says — which breaks both the hook rule above and the content check in step 5. Read prompts only fromevent_msglines whose payload isitem_completedwith an item of typeUserMessage.
# one Codex rollout file -> per-day blocks; run once per file selected by mtime import json, sys, collections, datetime f, since, until = sys.argv[1], sys.argv[2], sys.argv[3] P = lambda x: datetime.datetime.fromisoformat(x.replace('Z', '+00:00')) lo, hi = P(since), P(until) ts, prompts, cwd, sub = [], [], None, False for line in open(f, encoding='utf-8', errors='replace'): try: d = json.loads(line) except Exception: continue if not isinstance(d, dict): continue pl = d.get('payload') or {} if d.get('type') == 'session_meta': cwd = pl.get('cwd') src = pl.get('source') sub = isinstance(src, dict) and 'subagent' in src t = d.get('timestamp') if not t: continue ts.append(P(t)) it = pl.get('item') or {} if pl.get('type') == 'item_completed' and it.get('type') == 'UserMessage': prompts.append((t, ' '.join(c.get('text', '') for c in it.get('content', []) if isinstance(c, dict)))) if sub: sys.exit(0) # covered by the parent session perday = collections.defaultdict(list) for t in sorted(t for t in ts if lo <= t <= hi): # clip, do not merely mark perday[t.astimezone().strftime('%Y-%m-%d')].append(t.isoformat()) for day, dts in sorted(perday.items()): ps = [p for p in prompts if P(p[0]).astimezone().strftime('%Y-%m-%d') == day] print(json.dumps({'day': day, 'first': dts[0], 'last': dts[-1], 'n': len(dts), 'cwd': cwd, 'title': (ps[0][1][:60] if ps else None), 'prompts': ps, 'ts': dts}))Codex writes no session title, so the first prompt of the day stands in for one. Each emitted line becomes a
candidate_blockexactly as above, withsource='ai',harness='codex'andproject_hint=cwdtaken as is — it is a real path, not a lossy slug.B. Google Calendar (primary, if
effective_config.reconcile.calendar.as_workis true and MCP present — probeselect:mcp_Google_Calendar__list_events):Call
mcp_Google_Calendar__list_eventsfor[since, until]. For each returned event, apply the work filter fromeffective_config.reconcile.calendar:- drop all-day events if
exclude_all_day, - drop events the user declined if
exclude_declined, - drop events the user marked as Free —
transparency: "transparent"(equivalentlyavailability: "AVAILABILITY_FREE"). That flag is the user's own statement that the slot is not work, and unlike a keyword list it needs no maintenance. Observed 2026-08-26: four grocery-courier slots carried it and had matched no keyword. - mark, but do not drop, a solo event: no attendee other than the user
and the user is the organizer → add
'solo?'toorigin_marks. A block of focused solo work looks exactly like this, so dropping it would lose real time; but so does everything personal that was never meant as work. On the same day the Free flag caught the courier slots it did not catch a 150-minute cinema showing — that event carries notransparencyfield at all, it is a plain busy event, andkinowas in nobody's keyword list. It would have been proposed as billable. (A note added here on 2026-08-26 claimed the Free flag covered that case; it did not — the two events were conflated.) Measured over the same month, "no other attendee and organizer is self" separated every unambiguous work event from every unambiguous personal one, 6 for 6 — which is why it is a prompt, not a filter. - drop events whose title matches any
exclude_keywords(case-insensitive substring). The default list is deliberately whole-word-ish: matching is a plain substring test, so a short token added here (pto,ooo,off) silently eats unrelated events —ptohits "symptom review",offhits "offsite". When adding keywords, prefer the longer form. Each surviving event → acandidate_blockwithsource='calendar',start/end= event start/end (local),title= event summary,project_hint= null (resolved during project pairing, step 5),origin_marks=[],raw_messages_ts=[]. If the MCP is absent, append a one-line warning "Kalendář nedostupný — schůzky vynechány." and skip.
B2. Meeting recordings (if a voice-recorder MCP is present — e.g. a Plaud server exposing
list_filesandget_note; probe for it like the others): a recurring meeting nobody put in the calendar — a stand-up, typically — is invisible to source B, but its recording is not. Measured 2026-10-15 and 2026-10-23: the same weekly stand-up had no calendar event in either window, and both times only the recording timed it. List the recordings for[since, until]by date;start_atis UTC anddurationis in milliseconds. The recording title is generated from content, not set by the user, and the recorder also catches personal life (calls, errands, lectures), so read the recording's note before attributing it and keep only those whose content names the project's people, topics or tickets. Two recordings minutes apart on one topic (a meeting and its follow-up chat) form one block spanning both. Each kept recording → acandidate_blockwithsource='recording',start=start_atconverted to local,end=start + duration,titlefrom the note,project_hint= null (step 5 resolves it from the note),origin='recording-exact'. A recording that overlaps a calendar event of the same meeting confirms the event instead of adding a block.C. Confirmatory sources (git always; GitHub/ClickUp if enabled+present):
- git (local, free): not just the current repo — that is almost
never where the window's work happened. Measured 2026-08-26 from a
checkout of this very collection: the current repo held 0 in-window
commits while 131 existed across seven others, so the whole source
contributed nothing. Derive the repo list from the work you already found:
every session block's decoded working directory (step 3A), resolved to its
enclosing git repo. Add any configured root on top. Skip paths with no
.gitand say how many you skipped, so a missing local clone reads as "unconfirmed", never as "no work". Then in each repo collect commits authored by the user in the window:--since/--untilfilter on the commit date, while%aIis the author date — the one that says when the work happened, and the one a timesheet wants. Rebasing and amending move the commit date forward and leave the author date alone, so the two drift apart (7 of the commits in one repo's four-day window on 2026-08-26). Filtering on one and recording the other lets commits land outside the window: a commit authored at2026-07-27 02:00surfaced in a reconcile starting2026-07-28. Git has no author-date range filter, so over-fetch on commit date and filter on%aIyourself. A commit's author date effectively never postdates its commit date, so padding--sincebackwards a little (clock skew) and dropping--untilentirely is enough:
Each surviving commit is a confirmatory hit with a timestamp, its repo name, and subject. Not a block yet — see step 5.git log --all --since="<since> -7 days" \ --author="$(git config user.email)" \ --pretty='%h|%aI|%s' 2>/dev/null \ | awk -F'|' -v s="<since_iso>" -v u="<until_iso>" '$2 >= s && $2 <= u' - GitHub (probe
select:mcp__github__search_pull_requests): search PRs reviewed/merged and issues closed byeffective_config.sources.github.usernamein the window. Each is a confirmatory hit (timestamp = merged/review time, subject = title). - ClickUp (probe
select:<mcp_prefix>clickup_filter_tasks, the prefix beingeffective_config.sources.clickup.mcp_prefix): there is no updated-date filter — that tool ranges only overdue_date_*anddate_closed_*, so "tasks updated by the user in the window", which this step used to ask for, cannot be expressed and an agent rediscovers that every run. Usedate_closed_gt/date_closed_ltfor tasks the user closed in the window, andclickup_get_task_commentson the tasks you already have in hand for their comment timestamps. Both are confirmatory hits (timestamp = close/comment time, subject = task name). Anything needing "was this touched in the window" is out of reach here — say so once rather than fetching everything and filtering client-side. Absent MCP → warn once, skip that source.
D. Work that never ran through an agent (ChatGPT/Gemini sessions, manual work, phone calls): sources A–C see none of it, so a window that looks empty may just be work done elsewhere. Before concluding "nothing to reconcile", ask whether the period included such work; when it did, reconstruct it from:
- Artifacts on disk. Anything downloaded from a chat UI or produced by
hand carries a creation time. On macOS read birth time, elsewhere mtime;
each file is a timestamped anchor proving work happened at that moment.
Cluster anchors that fall close together into one block; a cluster's span is a lower bound on the block, never its length — the thinking around it leaves no file.python3 -c " import os, datetime, pathlib, sys for f in sorted(pathlib.Path(sys.argv[1]).rglob('*')): if f.is_file() and f.name not in ('.DS_Store',): st = f.stat(); b = getattr(st, 'st_birthtime', st.st_ctime) print(f'{datetime.datetime.fromtimestamp(b):%Y-%m-%d %a %H:%M} {f}') " <dir> - IM history (Slack/ClickUp DMs with whoever commissioned the work). Messages sent around the artifacts date the block from the other side and often state the work's substance. Best of all, the user's own past estimates ("cca 2 h, z toho 1 h už mám za sebou") are the strongest calibration available — prefer them over your own reconstruction.
- The session's own pauses. Manual work done during an agent session
leaves a gap in its log, and gap-capping reduces any gap over
gap_threshold_minto oneedge_pad_min. Read the first user prompt after each such gap: when it reports work finished in the meantime ("I set the secrets in the test environment", "seeded", "done, it was painful"), the gap was work, not a break. Propose it as amanualrow spanning the gap and quote the prompt as evidence. Measured 2026-09-24: a 15-minute stretch of seeding a secrets store by hand, invisible to gap-capping, surfaced only from the prompt that followed it.
Blocks from this source get
source='offline',origin='anchored', and aminutesestimate the user MUST confirm — the anchors fix when, never how long.- Subagent transcripts are nested one level deeper, at
Estimate a duration for each block. The estimate is always a default to hand-edit, never authoritative.
AI blocks — gap-capping.
raw_messages_tsis one local day's slice of one session, already clipped to the window by step 3A — never a whole file. Sorted; UTC is fine here since we only take differences. WithG = gap_threshold_min,E = edge_pad_min:minutes_raw = 0 for consecutive (a, b) in raw_messages_ts: gap = (b - a) in minutes minutes_raw += gap if gap <= G else E # long pause = break → only pad minutes_raw += E # trailing pad after last msgRationale: a session left open overnight has one huge inter-message gap; it contributes only one
E, not 8 hours. Compute in Python:python3 - <<'PY' from datetime import datetime ts = [ ... raw_messages_ts ... ] G, E = 15, 2 # from config def m(x): return datetime.fromisoformat(x.replace('Z','+00:00')) secs = 0 for a,b in zip(ts, ts[1:]): gap = (m(b)-m(a)).total_seconds()/60 secs += gap if gap<=G else E secs += E print(round(secs)) PYThen round to
round_to_minand setminutes. Ifminutes < min_block_min, drop the block as noise. Setorigin='ai-gapcapped'. Apply that threshold once more after placement (step 9): a block that rounds up tomin_block_mincan still have no free wall-clock to land in.Sanity gate — per block AND per day. Per-day splitting bounds a block at 24 h, which is not the same as plausible: an agent left running unattended produces a dense timestamp stream with no gap long enough to break, and gap-capping happily sums it. Presence in the log proves the agent was working; it does not prove the user was.
- Per block: over ~6 h in one day → mark
'long?'inorigin_marks. - Per day: once every block exists, sum them per local calendar day —
AI blocks only. A meeting is wall-clock time someone else can vouch
for; folding calendar hours into the gate would raise the threshold on
exactly the days that are legitimately full of meetings. A
day over ~10 h is implausible on its own, and the per-block gate will not
catch it — the inflation usually arrives as dozens of small blocks across
parallel repos, none individually long. Mark every block of such a day
'day?'. Measured on 2026-08-26, four July days reconstructed to 19–30 h each with no single block above 6 h.
The per-day gate matters most where the coverage diff (step 7) cannot help. Where the tracker already holds a normal day's entries, that diff absorbs almost all of the inflation on its own — 30.3 h reconstructed against 10.6 h logged proposed only 1.6 h. The exposure is the thinly-logged day: 12.6 h reconstructed against 1.0 h logged proposed 8.7 h, and a reconcile targets exactly those days. So treat
'day?'as the backstop for the case the diff is blind to, not as a routine warning.Summing blocks and unioning timestamps give different totals, and neither is the true one — say so rather than picking one silently. Parallel sessions covering the same wall-clock each produce their own block, so a per-block sum counts that time twice; the obvious fix is to union all of a day's timestamps and gap-cap the merged stream once. But the union is not simply the smaller, more conservative number. Merging streams makes them denser, so a pause that exceeded
gap_threshold_mininside one session — and therefore contributed only oneedge_pad_min— can fall under the threshold once another session's timestamps land inside it, and then it is counted in full. Measured 2026-09-07: the per-block sum gave 4.17 h and the union gave 5.33 h over the same window. So the sum double-counts overlap but misses the bridges between sessions, and the union does the reverse; the honest answer is a range, and the review (step 8) should present it as one when the two differ by more than a few percent. Where the day already carries a full tracker load, the difference is moot — nothing is being written there anyway.A bridge in the union can be made of nothing but a notification. A background task that finishes while its session waits for an answer writes a
queue-operationline and anattachmentline and starts no turn. Those lines carry timestamps, and in the union they can land just insidegap_threshold_minof another session's last activity and bridge a pause that was a break. Measured 2026-10-23: a notification at 11:02, in a session that had been waiting on a question since 10:44, stretched another session's 10:47 stop to 11:00 — 13 minutes of non-work. Before trusting a bridge, check that auserorassistantline sits inside it; when none does, cut the stream at the bridge.Calendar blocks:
minutes= exact(end - start)rounded toround_to_min(no gap-capping — a meeting is contiguous). Setorigin='calendar-exact'.Origin marks drive the review display (step 8). The label says where the number came from and how much to trust it; the third column is only how that reads in
cs:originLabel means Rendered ( csexample)ai-gapcappedestimate, from session gaps; names the harness when more than one was read ~<m>m (AI/codex, gap-capped)calendar-exactexact, from a meeting's length <m>m (kalendář)recording-exactexact, from a recording's length (step 3 B2) <m>m (nahrávka)commit-onlyno duration known — user must supply one ? (jen commit — DOPLŇ ČAS)manualsupplied by the user <m>m (ručně)- Per block: over ~6 h in one day → mark
- Pair every block to a project (same mechanism as
/tracker-startand/tracker-log-entry):- Fetch active Toggl projects (
mcp__toggl__toggl_list_projects, or the API key from~/.claude/plugins/session-tracker/config.jsonas fallback). - For AI blocks:
project_hintis the whole decoded working directory. Walk its segments right to left and take the first that matches a project name case-insensitively; on a hit setproject. Do not just take the last segment — measured against a live tree, that yields13for…/some-repo/.claude/worktrees/TASK-13and2026for…/some-cluster-2026, neither of which is a project. Skip segments that are purely numeric or are known scaffolding (.claude,subagents,src). The repository name — the segment right after the<host>/<owner>/prefix — is simply the last segment to try, not a fallback that assigns anything: if it also fails to match, the block has no project. For Calendar blocks with no hint, leaveproject=nullfor now. - A worktree never names the project — the repository above it does. On
a path containing
/.claude/worktrees/, truncate it there and match only the part to the left; the worktree's own name is a branch label chosen for a ticket or a topic and means nothing about billing. Measured 2026-08-26:…/<repo>/.claude/worktrees/monitoringresolved to the Toggl projectMonitoring— a different client's — for 12 blocks, and because the match succeeded no'project?'gate fired to surface it. Skipping the literal tokenworktreesis not enough; the segment after it has to go too. Codex puts its worktrees the other way round, outside the repository:~/.codex/worktrees/<id>/<repo>. There the last segment is the repository and the<id>before it is an opaque hash, so skip everything up to and including the<id>and match the rest. - Even the repository is only a hint — the session's content decides. A
worktree named for a topic rather than a ticket (
questions-<person>,ai-cr,standup) can host work for a different client entirely. Measured 2026-09-22: two sessions in<repo-A>/.claude/worktrees/questions-<person>spent 60 min drafting replies about<repo-B>'s staging environment, and path-based pairing put all of it on repo A's project — again with no'project?'gate, because the match succeeded. For every topic-named worktree, grep the session's user messages (thetype: userlines) for the other projects' names before trusting the path, and reassign the block when they win. Say in the review which blocks were reassigned and why; when--projectthen drops them, say that too, so the time is not silently lost for the other project. - Matching rule. Take the project name's last
/-separated part as its key. Normalise key and segment alike: lowercase, and collapse every-,_and.to one separator character. A segment matches when it equals the key, or when the key is its trailing separator-delimited component. Nothing else counts.www-example-shop-cz≡ the key ofwww.example-shop.cz→ equal, match.billing-system-ACCends with the componentacc, the key ofOrg/ACC→ match.webserverdoes not match the keyserver: no separator precedes it, so it is not a component. Requiring that boundary is the whole point — a plain substring test makes the segmentczmatch every*.czproject andservermatch three at once. An earlier wording said "equality … after replacing-/_with nothing" and then gavebilling-system-ACC→Org/ACCas an example of it. Those contradict — folding yieldsbillingsystemacc, which equals nothing — and read literally it left 96 of 97 blocks unattributed on a live run, including 31 h of the very project the example names. If two projects match equally well, treat it as no match and let step 8 ask.
- No match means no project — never a configured default. Set
project=nulland add'project?'toorigin_marks; the review (step 8) then forces the user to pick before the block can be approved. Do not fall back tosources.toggl.project_idordefault_project_id: those name the project a timer starts on, which is a different question from where unattributed reconstructed time belongs. Measured on a live config on 2026-08-26, that fallback put roughly four fifths of the proposed hours onto a billable client project — a fifth of them from a personal repo — and because the configured id was non-null, the'project?'branch below was unreachable, so nothing ever surfaced for review. A reconcile writes to a timesheet someone bills from; an unanswered question is cheap there and a silent default is not. Bulk-assigning a whole group to one project stays one keystroke away in step 8. - If
project_filter(--project) is set, drop blocks whose resolvedprojectdoes not match it (case-insensitive substring).
- Fetch active Toggl projects (
- Fold confirmatory hits into blocks — never double-count. For each
confirmatory hit (git commit / GitHub PR / ClickUp update):
- If its timestamp falls inside an existing AI block's
[start, end](same repo/project where determinable), attach it: add a mark to that block'sorigin_marks(git✓ Ncwith a commit count,gh✓ #<pr>,clickup✓), and optionally enrich the blocktitle. Do not create a new block and do not add time. - If it falls outside every AI block, promote it to a standalone
candidate_blockwithsource='commit'(orgh/clickup),origin='commit-only',minutes=null(unknown — user must fill in),start= the hit timestamp,end= null,projectresolved by step 5's matching procedure applied to the hit's repo name (so it can also end upnullwith a'project?'mark). - Merge multiple outside-hits that are close in time on the same project into
one
commit-onlyblock (list their subjects) to avoid a flood of tiny rows. - If
project_filteris set, drop any newly-promotedcommit-onlyblock whose pairedprojectdoes not match it (same rule as step 5's filter).
- If its timestamp falls inside an existing AI block's
- Diff against what is already logged — propose only the missing time.
- Toggl only serves recent history —
toggl_get_time_entriesrejects astart_dateolder than roughly three months with"start_date must not be earlier than <date>". When the window starts before that cutoff, say so instead of reporting an empty busy-map as "nothing logged". A cheap cross-check for a project that did not exist yet:GET /api/v9/workspaces/<wid>/projects/<pid>returnscreated_at, which caps how far back entries could possibly go. - A month-plus window overflows the tool result — expect it and parse from
disk. On 2026-09-07 a five-week window returned 316 entries / ~277k
characters, over the inline limit, and the harness wrote it to a file
instead. That is the normal shape of this call at reconcile scale, not an
error: take the path from the result and parse the JSON there in a script
(the document is
{"count": N, "entries": [...]}). Do not re-fetch the window in narrower slices to dodge the limit, and do not read the file back in chunks to summarise it — you need every entry as structured data to build the busy map, and prose summarisation of a busy map loses exactly the timestamps the diff runs on. - Load existing entries for
[since, until]only from the trackers insink.target(reading a ClickUp busy-map is pointless when writing only to Toggl). Toggl:mcp__toggl__toggl_get_time_entries(start_date/end_date). ClickUp: probeselect:<mcp_prefix>clickup_get_time_entriesfirst; if present, call it withstart_date/end_dateandassignee=["me"]-equivalent (omitassignee— it defaults to the authenticated user's own entries, which is what a personal reconcile wants). If the tool is absent, treat the ClickUp busy-map as best-effort: skip it, warn once ("ClickUp historie nedostupná — kontrola překryvu jen přes Togglu."), and fall through to Toggl-only coverage for ClickUp-bound blocks (they will simply not be marked COVERED by pre-existing ClickUp entries). Each existing entry → (start, end, project). A running entry has no end: Toggl returns it withstop: nulland a negativeduration. Treat it as busy fromstartto now, never skip it — a timer left running since the morning is exactly the entry that already covers the work you are about to propose. - Build a busy map per (project, day): the union of already-logged intervals. Also build an all-projects per-day bucket — the union of every entry that day regardless of project.
- A block with
project=nullcompares against the all-projects bucket for its day, never against an empty one. Since step 5 stopped applying a default, unmatched blocks are the common case, not the exception: bucketing them by a project they do not have means no existing entry can ever mask them and every one is proposed as missing. Measured 2026-08-26, that is not a small error — a four-day window already carrying 33.8 h of tracked time produced zero COVERED blocks and proposed 66.6 h on top. A block whose project is unknown is a block whose overlap is unknown too; compare it against everything logged that day, and let step 8 refine it once the user supplies the project. For each candidate block, split it per calendar day if it crosses midnight, then measure against its bucket —
(project, day)when the project is known, the all-projects day bucket when it is not.Do not divide wall-clock overlap by the gap-capped estimate. They are different units:
block_minutesis gap-capped and routinely a fraction of the block's[start, end]span, so that ratio exceeds 1.0 for any block with long internal pauses (23 of 89 blocks on a live run) andblock_minutes - overlapgoes negative. Scaling by the covered fraction of the span is no better — it assumes activity is spread evenly across the span, and on the same window it proposed 29.2 h on top of a period that already held 33.3 h.Instead subtract the busy intervals from the block's activity intervals. Turn
raw_messages_tsinto intervals with the step 4 rule — each consecutive pair(a, b)becomes[a, b]when the gap is at mostgap_threshold_minand[a, a + edge_pad_min]when it is longer, plus a trailing[last, last + edge_pad_min]— merge them, cut every busy interval out, and sum what is left. That measures the un-logged work directly rather than inferring it, needs no density assumption, is bounded in[0, 1]by construction, and hands step 9 the free pieces themselves:activity = gap_capped_intervals(raw_messages_ts) # same G and E as step 4 free = activity minus every busy interval minutes_left = total length of free coverage = 1 - minutes_left / block_minutesAn earlier version re-ran the gap-capping over only the timestamps that fall outside the busy intervals. That counts every gap that jumps over a logged entry: two outside timestamps ten minutes apart, one on each side of a nine-minute entry, add ten minutes of "un-logged" work the entry already holds. Measured 2026-10-23: 14 min proposed for a stretch where 4 were free. For a Calendar block there are no timestamps to re-cap — it is contiguous, so
minutes_leftis its span minus the busy overlap.Overlapping intervals are not the only way a block can already be logged — compare DESCRIPTIONS too. Coverage is measured from overlapping time, so it is structurally blind to work the user entered retrospectively under an estimated start: the entry exists, its description matches the block word for word, and the two intervals do not touch. Measured 2026-09-07 over a 1 Aug – 7 Sep window, twice in one run — the block titled after a merge task, reconstructed at 24 Aug 00:01–00:36 (35 m) was already in Toggl under that exact description at 01:32–02:07 (35 m): 1.5 h away, zero overlap, coverage 0.00, proposed as MISSING; and one titled after a staging deployment, reconstructed at 00:41 on 5 Sep, logged 00:48–00:53. Writing either would have billed a second time for work the user had already recorded honestly, which is a worse failure than missing an hour — it inflates the invoice rather than shrinking it.
So after the coverage pass, match every surviving proposal's
titleagainst the descriptions of that project's entries from[day-1, day+1]— not the same day alone, because night work crosses midnight and the reconstruction and the entry can land on opposite sides of it — using a normalised similarity ratio (difflib.SequenceMatcherover lowercased, whitespace-collapsed strings). At or above ~0.55, treat the block as a suspected duplicate: show the colliding entry with its time and duration, and do not write it unless the user says it is genuinely separate work. Both confirmed duplicates scored 1.00, so the threshold is deliberately generous. It fails in the other direction on short titles — "TASK-09" against "TASK-05" scores 0.86 and they are different tasks — so for titles under ~10 characters ignore the ratio and judge from the time and the surrounding entries instead.- Decide with
coverage_covered(0.9) andcoverage_missing(0.1):coverage >= coverage_covered→ COVERED: drop the block from the proposals; it still counts toward the summary line and the roll-up below.coverage_missing <= coverage < coverage_covered→ PARTIAL: keep, with proposedminutes = minutes_left; label~<m>m (doplněk k <block_minutes - minutes_left>m).coverage < coverage_missing→ MISSING: keep whole block; label~<m>m (chybí).
commit-onlyblocks (minutes=null) skip coverage math (nothing to measure) and always appear, flagged to fill in.COVERED means "already logged", not "impossible". When a block is buried under an entry for a different project, the overlap may be real parallel work — common when an agent runs unattended on one project while the user works another. Attention splits across parallel work, so a block approved as an overlap usually deserves fewer minutes than its anchors span.
How to surface those without drowning the review. An earlier version of this step said both "drop the block, count it for the summary only" and "do not silently drop those, show the colliding entry" — fine while cross-project collisions were an occasional edge case, but once unmatched blocks compare against the all-projects bucket, every COVERED block is covered by some other project's entry, so the second rule would fire on all of them (32 blocks, 50 h of anchors, on a live run). Print a one-line roll-up per (project, day) —
pokryto: <N> bloků, <Σ>m, kolidují s <projekt(y)>— never a row each, and let the user expand a day on request. Reserve the full colliding-entry detail (including itsatfield, which reveals whether the entry was measured live or entered retrospectively as one lump — the latter is far weaker evidence) for a day the user opens.When the user may not overlap entries within one client, a block COVERED by another project of that client is a decision, not a drop. The minutes are real work, but writing them over the colliding entry bills the same wall-clock twice. Report the parallel minutes per day, then ask the user to choose: (a) leave them out, or (b) move them into a free slot of the same day — placed like any other item in step 9, with descriptions of the work only. When the day has no free slot in the past (a timer still running past midnight), offer the preceding evening of the same working night and say so. Do not settle this silently in either direction: measured 2026-10-23, an earlier run had left such time out, and when the next run asked, the user chose (b) for 114 minutes over three days.
- Check the other direction too: time logged that no work backs. The
diff above only finds work missing from the tracker; a timer left running
while the user was away is the mirror error, and nothing else in this
skill sees it. For every entry in the window longer than ~60 min, measure
the stretch inside it with no session timestamp in any repo (not just
the project's — the user may have moved to another client) and no commit
authored in any repo found in step 3C. When that idle stretch exceeds
~45 min, list the entry under its own heading — start, stop, duration,
the idle span, the last activity before it — and whether the
atfield equals its stop time (stopped live, so a forgotten timer is the likely story) or lies later (entered by hand, so the user chose that length). Offer to trim it to the last activity plusedge_pad_min; never trim without an explicit yes, because manual work outside any agent (a phone call, a console session, a UI) leaves exactly this shape. Measured 2026-09-29: one entry ran 11:35–18:00 (385 min) while every log and every repo stayed silent from 12:50 until the next timer started at 17:55 — 310 min over-logged, more than the whole missing time the same run proposed. Write the trim as aPUTon the entry's id, with the same stdin-fed auth as step 9. - ClickUp coverage is bucketed per (project, day), not per-task, so
same-project same-day ClickUp time can mask a distinct task's block — the
reconciled_tagidempotency check (step 9) is the finer backstop.
- Toggl only serves recent history —
Review — the heart of "confirm". First print a grouped table (by project, then day), each row: proposed minutes + origin label +
origin_marks. Order groups by total proposed minutes, largest first, and put the unattributed (project=null) group first rather than leaving it unplaced — it is where the user's attention is actually needed, and it is usually the biggest. Sorting it last put a single 5-minute row at the top of a live run and buried a 28-row group beneath it. End with a summary line:N návrhů (Σ h) · K pokrytých skryto · M bez času. Example:Projekt X — po 2026-06-02 ~90m fix auth bug (AI, gap-capped) [git✓ 3c, PR#42✓] 35m code review (doplněk k 25m) [GitHub✓] 60m Sprint planning (kalendář) ? hotfix deploy (jen commit — DOPLŇ ČAS) Souhrn: 12 návrhů (8.5 h) · 5 pokrytých skryto · 1 bez časuThen approve in batches, one group (project/day) at a time, offering four options — referred to below by their function, and rendered in
config.language(cs: Vše / Vybrat / Přeskočit / Upravit časy):- all → approve every item in the group.
- select → list the group's items so the user picks a subset.
- skip → approve nothing in this group.
- edit → let the user overwrite
minutes(and optionallyproject/title) on a chosen item. - A block with
minutes=null(the?items) CANNOT be approved until the user supplies a duration — force the prompt; never write anull. - A block with
'project?'inorigin_marksCANNOT be approved until the user picks a project. Since step 5 no longer applies any default, a month's worth of personal-repo work can arrive as dozens of such blocks — so when a group holds more than one, offer to set the project for the whole group in one answer (with the per-block path shown) before falling back to asking block by block. The gate exists to stop a silent misattribution, not to charge a keystroke per row. - A block marked
'long?'(over ~6 h in one day, step 4) is shown with its span and message count before approval, so the user can tell a genuinely long day from an agent that ran unattended while they were elsewhere. It can be approved as-is, but never silently as part of a bulk all. - A block marked
'solo?'(step 3B: a calendar event with no other attendee, organised by the user) is shown with its time of day and location before approval. Solo focus time and a cinema ticket are the same shape to every automatic filter; only the user can tell them apart. - A day whose blocks carry
'day?'(over ~10 h reconstructed, step 4) is announced once at the head of that day's group with its reconstructed total and what the tracker already holds for it, before any of its rows are offered. Bulk all on such a group asks for confirmation first. - If
sink.targetincludesclickup: a ClickUp time entry must attach to atask_id(AI sessions / commits / meetings have no inherent ClickUp task). So for each block the user approves for a ClickUp write, prompt them to pick the target ClickUp task — offer a shortlist fromclickup_filter_tasks(filtered byassignee=<sources.clickup.member_id>, active), or let them paste a task ID / custom ID (e.g.DEV-1234). Store it as the block'sclickup_task_id. A block CANNOT be approved for a ClickUp write without aclickup_task_id. (Toggl writes need no task — this gate applies only to the ClickUp sink.) - Choosing all approves every item in the group but does not
bypass the gates above: any gated item (a
?duration, aproject?mark, or a requiredclickup_task_id) still forces its per-item prompt — all cannot manufacture a missing value. - Offer an "add a manual item" option (
cs: "+ přidat ruční položku") for work no source can see, such as a phone call: ask start, duration, project, description → append assource='manual',origin='manual', fully specified. Everything the user OKs goes intoapproved. Nothing else is written. Ifdry_run, stop here after printing what would be written, grouped like the summary; write nothing.
Write the approved entries. For each item in
approved, write to every tracker insink.target(toggl,clickup, orboth).Safety (identical to the
tracker-log-entryskill): never put the API key in argv. Read it into a shell variable and pass it via a stdin-fed config / header, so it stays out ofpsand transcripts. Do all time conversion withdate, never by hand.Toggl —
POST /api/v9/workspaces/<wid>/time_entries. Use the exact auth pattern proven in thetracker-log-entryskill: Basic auth viacurl --config -fed on stdin (so the key stays out of argv), with the credential lineuser = "<token>:api_token".durationisround(minutes) * 60(seconds;minutesis the approved per-item value). If the block'sendis null (commit-only or manual items filled in without an end time), derive it withdateasstart + durationbefore building the payload.Place the entry in free wall-clock before you write it.
startis the block's first timestamp, butstart + durationcan run into an entry the tracker already holds — rounding toround_to_minalone causes it: a 2-minute sliver wedged between two logged entries rounds to 5 and overlaps the second one. Walk forward fromstart, skipping every existing entry, until the approved minutes are placed; when the free space inside the block's span is belowmin_block_min, drop the item and say so instead of writing an overlap. Measured 2026-09-22: one such sliver, caught only because the write script compared every payload against every fetched entry before posting — keep that comparison, it is the last guard. "Existing" includes the entries this batch has already written, and the items the user supplied in review: when a user-sized item (a call they give 10 minutes to) lands on top of a session row for the same project, shorten the session row and say so rather than writing two entries over the same minutes — the user's number is the stronger evidence. Place at second precision, too: live entries end at arbitrary seconds, so minute-rounded pieces collide with them (2026-09-29: five of thirteen pieces, all overlapping by under a minute, all stopped by the guard). Send whole seconds: Toggl rejects astartwith a fractional part with "Stop and duration mismatch" (2026-10-15). Body carriesstart(UTC ISO),stop(UTC ISO, the derived or original end),duration(seconds),description,project_id(only when resolved),billable(fromsink.billable), andtagsincludingsink.reconciled_tag— mirroring/tracker-log-entry's Toggl body:KEY=<toggl api_key read into a shell var, not echoed> printf 'user = "%s:api_token"\n' "$KEY" | curl -sS --config - \ -H "Content-Type: application/json" \ -X POST "https://api.track.toggl.com/api/v9/workspaces/<wid>/time_entries" \ --data-binary '{"created_with":"work-reconcile","workspace_id":<wid>, "start":"<utc>","stop":"<utc_end>","duration":<secs>,"description":"<desc>", "billable":<bool>,"tags":["<reconciled_tag>"]}'(Add
"project_id":<pid>only when a project was resolved.) ClickUp —<mcp_prefix>clickup_add_time_entrywithtask_id(the block'sclickup_task_id, chosen during review — step 8),start(YYYY-MM-DD HH:MM),duration(Xh Ym),description,billable,tags:[<reconciled_tag>]. A block without aclickup_task_idwas never approved for ClickUp (the step 8 gate) — skip it for this sink.Per-item failure isolation: if one write fails, record the error and continue with the rest; never abort the whole batch.
Idempotency: before writing, and on any re-run, treat an existing entry that already carries
sink.reconciled_tagoverlapping the same block as already-written and skip it (belt-and-braces on top of the coverage diff, so a second/work-reconcilewrites nothing). Scope that check to entries that actually overlap the block: the fetch in step 7 deliberately covers[day-1, day+1]for description matching, so a tagged entry from outside the window sits in the same result set and must not be read as "already written" (2026-09-22: one such entry, a day before the window, from the previous run). After the batch, re-fetch the window and identify your own writes by the ids the writes returned — not bycreated_with, which the entries listing does not return (checked 2026-10-23), and not by the tag or the day, because the user may add entries by hand within minutes of the run (observed the same day: a manual entry carrying the samereconciled_taglanded three minutes after the batch), and the summary must report it as theirs, not claim it.No sink credentials (neither Toggl nor ClickUp key available): do not write. Instead offer an export — print the approved items as a Markdown table (and offer to save a
.csv) so the user can paste them manually. Say so explicitly.- Summary. Print what happened: per project, entries written (with durations) and total; then a line each for skipped-as-covered, skipped (user), and failed (with the error). If nothing was written, say why (dry-run / no approvals / no credentials).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

