ModsCode / Claude Code Mods / Ranking / turn-timeline
turn-timeline
Draws the current turn as a timeline in a pane (/timeline): model requests and tool calls per loop, where the time went, and the slowest steps
What it does
- Draws a pane
- Adds /timeline
- Watches tool calls
- Hooks session.start, turn.complete, turn.start, turn.step
Good points
- No network calls
- Starts no processes
- Small: 377 lines
- Written in TypeScript
Code to start from
A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like turn-timeline by Mehmet Aras (pane), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/arasovic-turn-timeline/
// Written by ModsCode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Timeline" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text } = $.ui.resolve(e)
const length = '…'
const t = '…'
const t2 = '…'
const t3 = '…'
const t4 = '…'
const t5 = '…'
const t6 = '…'
const t7 = '…'
const t8 = '…'
const t9 = '…'
const t10 = '…'
const t11 = '…'
const t12 = '…'
const t13 = '…'
const t14 = '…'
const t15 = '…'
const t16 = '…'
const t17 = '…'
const t18 = '…'
const right = '…'
const t19 = '…'
const t20 = '…'
const t21 = '…'
const t22 = '…'
const t23 = '…'
const t24 = '…'
const t25 = '…'
const t26 = '…'
const t27 = '…'
return (
<Box flexDirection="column" paddingTop={1}>
<Box alignItems="center">
<Box flexGrow={1} height={0.5}>
<Box backgroundColor="userMessageBackgroundHover" />
<Box backgroundColor="userMessageBackgroundHover" />
<Box backgroundColor="userMessageBackgroundHover" />
</Box>
<Box flexGrow={1} height={0.5}>
<Box backgroundColor="userMessageBackgroundHover" />
<Box backgroundColor="userMessageBackgroundHover" />
<Box backgroundColor="userMessageBackgroundHover" />
</Box>
<Box flexGrow={1} height={0.5}>
<Box backgroundColor="userMessageBackgroundHover" />
<Box backgroundColor="userMessageBackgroundHover" />
<Box backgroundColor="userMessageBackgroundHover" />
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
<Text dimColor>
{"╭─ "}
</Text>
<Text bold>
Timeline
</Text>
<Text dimColor>
{" "}
────────
</Text>
<Text dimColor>
{" "}
{`${length} loop`}
{" "}
</Text>
<Text dimColor>
─╮
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t}
</Text>
<Text>
{t2}
</Text>
<Text>
{t3}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t4}
</Text>
<Text>
{t5}
</Text>
<Text>
{t6}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t7}
</Text>
<Text>
{t8}
</Text>
<Text>
{t9}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text dimColor>
╰
────────
╯
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
<Text dimColor>
{"╭─ "}
</Text>
<Text bold>
Where time went
</Text>
<Text dimColor>
{" "}
────────
</Text>
<Text dimColor>
{" "}
main loop
{" "}
</Text>
<Text dimColor>
─╮
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t10}
</Text>
<Text>
{t11}
</Text>
<Text>
{t12}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t13}
</Text>
<Text>
{t14}
</Text>
<Text>
{t15}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t16}
</Text>
<Text>
{t17}
</Text>
<Text>
{t18}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text dimColor>
╰
────────
╯
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
<Text dimColor>
{"╭─ "}
</Text>
<Text bold>
Slowest
</Text>
<Text dimColor>
{" "}
────────
</Text>
<Text dimColor>
{" "}
{right}
{" "}
</Text>
<Text dimColor>
─╮
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t19}
</Text>
<Text>
{t20}
</Text>
<Text>
{t21}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t22}
</Text>
<Text>
{t23}
</Text>
<Text>
{t24}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text>
<Text dimColor>
{"│ "}
</Text>
<Text>
{t25}
</Text>
<Text>
{t26}
</Text>
<Text>
{t27}
</Text>
<Text dimColor>
{" │"}
</Text>
</Text>
<Text dimColor>
╰
────────
╯
</Text>
</Box>
</Box>
)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
turn-timeline/hooks/register.tsx lines 222–376 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text } = $.ui.resolve(e)
const t = await read($, turn)
const now = await $.clock.now()
const w = Math.max(30, e.props.bodyColumns - 1)
const inner = w - 6
const isGrid = e.surface === 'terminal'
if (!t) return <Text dimColor>The timeline starts with the next turn.</Text>
const draw = (row: Row, width: number) =>
fit(row, width).map((s, j) => <Text key={String(j)} color={s.c} dimColor={s.d} bold={s.b}>{s.t}</Text>)
// A row as a flex line, for surfaces that draw text in a proportional font.
const items = (row: Row) =>
row.map((s, j) => {
if ('cells' in s) {
const total = Math.max(1, s.parts.reduce((n, p) => n + p.n, 0))
return <Box flexGrow={1} height={0.5}>{s.parts.map(p => <Box flexGrow={(p.n / total) * 1000} backgroundColor={p.c ?? TRACK} />)}</Box>
}
if (s.fill) return <Box flexGrow={1} />
const text = <Text key={String(j)} color={s.c} dimColor={s.d} bold={s.b} wrap="truncate-end">{!s.w ? s.t : s.right ? s.t.trim() : s.t.trimEnd()}</Text>
return s.w || s.keep ? <Box width={s.w} flexShrink={0} justifyContent={s.right ? 'flex-end' : 'flex-start'}>{text}</Box> : text
})
const line = (row: Row) => (row.length ? <Box alignItems="center">{items(row)}</Box> : <Box height={0.5} />)
const frame = (title: string, tone: string, rows: Row[], right = '') => {
if (!isGrid)
return (
<Box flexDirection="column" marginTop={2} borderStyle="round" borderColor={tone} borderDimColor>
<Box marginBottom={1}>
<Box flexShrink={0}>
<Text color={tone} bold>{title}</Text>
</Box>
<Box flexGrow={1} />
{right ? <Text dimColor wrap="truncate-end">{right}</Text> : null}
</Box>
{rows.map(line)}
</Box>
)
const rule = Math.max(0, w - 6 - title.length - (right ? right.length + 2 : 0))
return (
<Box key={title} flexDirection="column" marginTop={1}>
<Text>
<Text color={tone} dimColor>╭─ </Text>
<Text color={tone} bold>{title}</Text>
<Text color={tone} dimColor> {'─'.repeat(rule)}</Text>
{right ? <Text dimColor> {right} </Text> : null}
<Text color={tone} dimColor>─╮</Text>
</Text>
{rows.map((row, i) => (
<Text key={String(i)}>
<Text color={tone} dimColor>│ </Text>
{draw(row, inner)}
<Text color={tone} dimColor> │</Text>
</Text>
))}
<Text color={tone} dimColor>╰{'─'.repeat(w - 2)}╯</Text>
</Box>
)
}
// A background subagent outlives the main turn, so the timeline runs until its last step ends too.
const running = t.end === undefined || t.spans.some(s => s.end === undefined)
const end = running ? now : Math.max(t.end ?? now, ...t.spans.map(s => s.end ?? 0))
const duration = end - t.start
const cols = inner - LABEL_W
const main = t.spans.filter(s => s.lane === 'main')
const parts = breakdown(main, t.start, end, now)
const pct = (name: string) => Math.round(parts.find(p => p.name === name)?.pct ?? 0)
const toolPct = Math.max(0, 100 - pct('model') - pct('idle'))
const glance: Row = [
{ t: running ? 'Running ' : 'Last turn ', d: true },
{ t: clock(duration), b: true, keep: true },
{ t: ' model ', d: true },
{ t: `${pct('model')}%`, c: 'suggestion', b: true, keep: true },
{ t: ' tools ', d: true },
{ t: `${toolPct}%`, c: 'success', b: true, keep: true },
{ t: ' idle ', d: true },
{ t: `${pct('idle')}%`, b: true, keep: true },
]
// One row per loop, the busiest first after main; lanes past the room left fold into a count.
const maxLanes = Math.max(1, Math.floor((e.props.scroll.bodyRows - 20) / 2))
const lanes = t.lanes.slice(0, maxLanes)
const laneRows: Row[] = lanes.flatMap((lane, i) => {
const cells = laneCells(
t.spans.filter(s => s.lane === lane.id),
t.start,
end,
cols,
now,
).map(k => CELL[k])
const row: Row = [{ t: column(lane.label, LABEL_W), b: lane.id === 'main', d: lane.id !== 'main', w: LABEL_W }, { cells, parts: runs(cells) }]
return i ? [[], row] : [row]
})
const hidden = t.lanes.length - lanes.length
const timelineRows: Row[] = [
...laneRows,
...(hidden > 0 ? [[{ t: `+${hidden} more loops`, d: true }]] : []),
isGrid ? [{ t: ' '.repeat(LABEL_W) }, { t: axis(duration, cols), d: true }] : [{ t: '', w: LABEL_W }, { t: '0', d: true }, { t: '', fill: true }, { t: clock(duration), d: true }],
[],
isGrid
? [{ t: '█', c: 'success' }, { t: ' tool ', d: true }, { t: '▒', c: 'suggestion' }, { t: ' model ', d: true }, { t: '█', c: 'error' }, { t: ' failed ', d: true }, { t: '·', d: true }, { t: ' idle', d: true }]
: [{ t: '■', c: 'success' }, { t: ' tool ', d: true }, { t: '■', c: 'suggestion' }, { t: ' model ', d: true }, { t: '■', c: 'error' }, { t: ' failed ', d: true }, { t: '□', d: true }, { t: ' idle', d: true }],
]
// Each share as a bar against the turn's length, model and idle named, tools by name.
const barW = inner - 25
const shareRows: Row[] = parts.slice(0, 6).map(p => {
const filled = Math.round((p.pct / 100) * barW)
const tone = p.name === 'model' ? 'suggestion' : p.name === 'idle' ? undefined : 'success'
const left: Row = [
{ t: column(p.name, LABEL_W), d: p.name === 'idle', w: LABEL_W },
{
cells: [{ t: '█'.repeat(filled), c: tone, d: p.name === 'idle' }, { t: '·'.repeat(Math.max(0, barW - filled)), d: true }],
parts: [{ n: filled, c: tone ?? 'promptBorder' }, { n: Math.max(0, barW - filled) }],
},
]
const right: Row = [
{ t: clock(p.ms).padStart(6), d: true, w: 6, right: true },
{ t: `${Math.round(p.pct)}%`.padStart(5), b: true, w: 5, right: true },
]
// A real bar stretches by itself; a spacer beside it would take half the room.
return isGrid ? spread(left, right, inner) : [...left, ...right]
})
const slowest = t.spans
.filter(s => s.end !== undefined)
.sort((a, b) => (b.end ?? 0) - b.start - ((a.end ?? 0) - a.start))
.slice(0, 3)
// A model request has no target of its own, so it is named by its place in its loop: "request 3 of 5".
const requestOf = (s: TimelineSpan) => {
const mine = t.spans.filter(x => x.lane === s.lane && x.kind === 'model')
return `request ${mine.indexOf(s) + 1} of ${mine.length}`
}
const slowRows: Row[] = slowest.length
? slowest.map(s => {
const left: Row = [
{ t: s.kind === 'model' ? 'model' : s.name, c: s.kind === 'model' ? 'suggestion' : s.ok === false ? 'error' : 'success', b: true, keep: true },
{ t: ` ${s.lane === 'main' ? '' : `${t.lanes.find(l => l.id === s.lane)?.label ?? ''} `}${s.kind === 'model' ? requestOf(s) : s.detail}`, d: true },
]
const took = clock((s.end ?? now) - s.start)
// Off the grid only the target gives way; the name and the duration stay whole.
return isGrid ? spread(left, [{ t: took, b: true }], inner) : [...left, { t: '', fill: true }, { t: ` ${took}`, b: true, keep: true }]
})
: [[{ t: 'Nothing has finished yet.', d: true }]]
return (
<Box flexDirection="column" paddingTop={1}>
{isGrid ? <Text>{draw(glance, w - 3)}</Text> : line(glance)}
{frame('Timeline', 'suggestion', timelineRows, `${t.lanes.length} ${t.lanes.length === 1 ? 'loop' : 'loops'}`)}
{frame('Where time went', 'success', shareRows, 'main loop')}
{frame('Slowest', 'warning', slowRows)}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Mehmet Aras Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
How to build this: Pane (panel), Deny a tool call
What its code calls
drives Claudetool calls
What its code shows
Read from the source at commit 9f1bef615562 on 2026-10-11. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.turn-timeline/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.1 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs |
| Reads and sends | Whether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reaches nothing outside |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets ModsCode show its code; otherwise the code is linked.MIT |
| Settings hooks | Hooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone |
| Servers it ships | MCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/ |
| Skills, commands, agents | What its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows |
| Tools and MCP | Whether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command |
| Asks of the model | Completions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command timeline |
| Events it hooks | By what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: command.run (timeline), tool.call · shapes: turn.step · also: session.start, turn.start, turn.complete, ui.render (Pane) |
| Reads, by name | The environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.reads no files, environment variables, settings or transcript |
| Writes, by name | The files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.writes no files, environment variables, settings or conversation rows |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and ModsCode does not vouch for what this code does. Read its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
From its marketplace
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add arasovic/claude-code-mods/plugin install turn-timeline@claude-code-mods/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (9f1bef615562). Compare them before you install. /reload-plugins loads it into a session that is already open.
Try the commit ModsCode read
No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:
git clone https://github.com/arasovic/claude-code-modsgit -C claude-code-mods checkout 9f1bef61556227ffb420f219bfac4ea204d77befclaude plugin validate claude-code-mods/turn-timelineclaude --plugin-dir claude-code-mods/turn-timelineThe validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.
Ask Claude about it
With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:
Read the ModsCode mod "arasovic-turn-timeline" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- blast-radiusdeepseek-ai★ 247,289
- replay-theaterdeepseek-ai★ 247,289
- ruview-liveruvnet★ 97,236
- ruflo-swarmruvnet★ 74,323
- code-modernizationAnthropic★ 37,653
- seo-cockpitAgrici Daniel★ 18,364
More from this repository
- cache-timerMehmet Aras★ 6
- change-ledgerMehmet Aras★ 6
- ci-watchMehmet Aras★ 6
- compact-keeperMehmet Aras★ 6
- guardrailsMehmet Aras★ 6
- image-peekMehmet Aras★ 6
See all 14 mods in this repository
Badge for your README
If this is your mod, paste this into your README. It links to this page.
[](https://modscode.com/claude-mods/mods/arasovic-turn-timeline/)