Skip to content

Commit 8c49785

Browse files
Shahinyanmclaude
andcommitted
feat: v0.1.3 — export, TUI search, 71 new tests, README
Major additions: - task-journal export --format md|json — pipe tasks to stdout - TUI: / search filter, session duration, project path in header - 71 new tests across parser, discovery, extractor, chat_view (170 total) - Comprehensive README with installation, commands, architecture docs Version bump: 0.1.2 → 0.1.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e718cc2 commit 8c49785

12 files changed

Lines changed: 1700 additions & 138 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ members = [
77
]
88

99
[workspace.package]
10-
version = "0.1.2"
10+
version = "0.1.3"
1111
edition = "2021"
1212
rust-version = "1.83"
1313
license = "MIT"

README.md

Lines changed: 120 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,119 @@
11
# Task Journal
22

3+
[![Crates.io](https://img.shields.io/crates/v/task-journal-cli.svg)](https://crates.io/crates/task-journal-cli)
34
[![CI](https://github.com/Digital-Threads/Task-Journal/workflows/CI/badge.svg)](https://github.com/Digital-Threads/Task-Journal/actions/workflows/ci.yml)
45
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
56

6-
Append-only journal for AI-coding tasks. Captures the *reasoning chain* — goals, hypotheses, decisions, rejections, evidence — and renders a compact resume pack on demand so an agent can pick up a 2-week-old task with full context.
7+
Reasoning chain memory for AI coding sessions.
78

8-
**Why:** existing memory tools store sessions, issues, or do flat semantic search. None store the *logical chain* of a single task. After two weeks, the code remains but the *why* is gone. Task Journal fixes that.
9+
Task Journal captures the *logical chain* of a coding task -- goals, hypotheses, decisions, rejections, evidence, corrections -- as an append-only event log. When you come back to a two-week-old task, the code is still there but the *why* is gone. Task Journal preserves it.
910

10-
> Task Journal is the first plugin in the `claude-memory` marketplace.
11+
Unlike session-based memory tools that store raw chat history or flat semantic search, Task Journal records structured reasoning events tied to individual tasks, and renders compact resume packs so an agent (or you) can pick up exactly where work left off.
1112

12-
## Install
13+
## Installation
1314

14-
**Option 1 — from crates.io (recommended)**
15+
**From crates.io (recommended)**
1516

1617
```bash
1718
cargo install task-journal-cli task-journal-mcp
1819
```
1920

20-
**Option 2 — pre-built binary**
21+
**As a Claude Code plugin**
2122

22-
Download the right archive for your OS/arch from [GitHub Releases](https://github.com/Digital-Threads/Task-Journal/releases), unpack, put `task-journal` and `task-journal-mcp` somewhere in your `$PATH`.
23+
```bash
24+
claude plugin install github:Digital-Threads/Task-Journal
25+
```
26+
27+
**Pre-built binary**
2328

24-
**Option 3 — build from source**
29+
Download the right archive for your OS/arch from [GitHub Releases](https://github.com/Digital-Threads/Task-Journal/releases), unpack, and place `task-journal` and `task-journal-mcp` somewhere in your `$PATH`.
30+
31+
**From source**
2532

2633
```bash
2734
git clone https://github.com/Digital-Threads/Task-Journal
2835
cd Task-Journal
2936
cargo install --path crates/tj-cli --path crates/tj-mcp
3037
```
3138

32-
## Quick start
39+
## Quick Start
3340

3441
```bash
35-
# Open a task
42+
# 1. Create a task
3643
task-journal create "Add OAuth login"
37-
# tj-x9rz1f
44+
# => tj-x9rz1f
3845

39-
# Record decisions / findings as you work
46+
# 2. Record reasoning events as you work
4047
task-journal event tj-x9rz1f --type hypothesis --text "PKCE vs implicit grant"
41-
task-journal event tj-x9rz1f --type decision --text "Adopt PKCE flow"
42-
task-journal event tj-x9rz1f --type rejection --text "Implicit grant: deprecated"
48+
task-journal event tj-x9rz1f --type decision --text "Adopt PKCE flow"
49+
task-journal event tj-x9rz1f --type rejection --text "Implicit grant: deprecated by RFC"
4350

44-
# Get a resume pack (Markdown)
51+
# 3. Resume later with a context pack
4552
task-journal pack tj-x9rz1f --mode full
4653
```
4754

48-
Sample output:
55+
## CLI Commands
56+
57+
| Command | Description |
58+
|---------|-------------|
59+
| `create <title>` | Create a new task (writes an `open` event) |
60+
| `event <id> --type X --text Y` | Append a typed event to a task |
61+
| `close <id> [--reason "..."]` | Close a task |
62+
| `event-correct --corrects <eid> --task <id> --text "..."` | Append a correction referencing an earlier event |
63+
| `events list [--limit N]` | List events for the current project (most recent first) |
64+
| `search <query> [--all-projects]` | Full-text search across events (FTS5) |
65+
| `pack <id> --mode compact\|full` | Render a resume pack for a task |
66+
| `rebuild-state` | Rebuild SQLite derived state from the JSONL log |
67+
| `stats` | Show classifier accuracy and event counts |
68+
| `export [--format md\|json] [--task <id>]` | Export tasks to stdout as Markdown or JSON |
69+
| `backfill [--dry-run] [--limit N]` | Import events from existing Claude Code session history |
70+
| `ui` / `tui` | Interactive terminal UI for browsing sessions |
71+
| `install-hooks [--scope user\|project]` | Install Claude Code auto-capture hooks |
72+
| `ingest-hook` | Hook entry point (called by Claude Code hooks) |
73+
74+
### Export
75+
76+
The `export` command writes task data to stdout so you can pipe it to a file or another tool:
77+
78+
```bash
79+
# Export all tasks as Markdown
80+
task-journal export > report.md
4981

50-
```markdown
51-
# Add OAuth login [status: open]
82+
# Export a specific task as JSON
83+
task-journal export --format json --task tj-x9rz1f > task.json
5284

53-
## Lifecycle
54-
- 2026-04-30T... opened
85+
# Export from a different project directory
86+
task-journal export --project /path/to/project
87+
```
5588

56-
## Active decisions
57-
- Adopt PKCE flow
89+
## TUI
5890

59-
## Rejected
60-
- Implicit grant: deprecated
91+
The interactive terminal UI (`task-journal ui` or `task-journal tui`) lets you browse Claude Code sessions and read conversation history for the current project. Navigate sessions with arrow keys and inspect individual chat messages.
6192

62-
## Recent events (last 10)
63-
- 2026-04-30T... [rejection] Implicit grant: deprecated
64-
- 2026-04-30T... [decision] Adopt PKCE flow
65-
- 2026-04-30T... [hypothesis] PKCE vs implicit grant
66-
- 2026-04-30T... [open] Add OAuth login
93+
```bash
94+
task-journal ui
95+
task-journal ui --project /path/to/project
6796
```
6897

69-
## Claude Code integration (two paths)
98+
## MCP Integration
7099

71-
### Path A — Plugin (recommended)
100+
Task Journal ships an MCP server (`task-journal-mcp`) that exposes five tools to Claude Code and other MCP-compatible agents:
72101

73-
Adds slash-commands like `/task-journal:create` and `/task-journal:pack`, plus the MCP server, all in one install.
102+
| MCP Tool | Description |
103+
|----------|-------------|
104+
| `task_create` | Create a new task |
105+
| `event_add` | Append a reasoning event |
106+
| `task_pack` | Render a resume pack for context restoration |
107+
| `task_search` | Full-text search across events |
108+
| `task_close` | Close a task with a reason |
74109

75-
From your shell:
110+
**Plugin install (recommended)** -- the plugin registers the MCP server automatically:
76111

77112
```bash
78-
claude plugin marketplace add https://github.com/Digital-Threads/Task-Journal
79-
claude plugin install task-journal@claude-memory
113+
claude plugin install github:Digital-Threads/Task-Journal
80114
```
81115

82-
(Or for a local checkout: `claude plugin marketplace add /path/to/Task-Journal`.)
83-
84-
Restart Claude Code. Six slash-commands become available: `/task-journal:create`, `:event`, `:pack`, `:search`, `:close`, `:stats`.
85-
86-
### Path B — Plain MCP (no plugin)
87-
88-
If you don't want slash-commands or auto-capture hooks, just register the MCP server in `~/.claude/settings.json`:
116+
**Manual MCP registration** -- add to `~/.claude/settings.json`:
89117

90118
```json
91119
{
@@ -95,86 +123,85 @@ If you don't want slash-commands or auto-capture hooks, just register the MCP se
95123
}
96124
```
97125

98-
Five tools become available: `task_pack`, `task_search`, `task_create`, `event_add`, `task_close`.
126+
The MCP server includes built-in instructions that guide Claude Code through the recommended workflow: search for open tasks at session start, record findings/decisions/rejections during work, and close tasks when done.
127+
128+
## Auto-Capture via Hooks
99129

100-
## Auto-capture via Claude Code hooks
130+
Claude Code hooks can automatically classify chat chunks and record events without manual `event` commands:
101131

102132
```bash
103-
export ANTHROPIC_API_KEY=sk-ant-...
104133
task-journal install-hooks --scope user
105134
```
106135

107-
Hooks send chat chunks to Claude Haiku for classification:
108-
109-
- Confidence ≥ 0.85 → confirmed event
110-
- Confidence < 0.85 → suggested event (rendered with `[?]` marker; you decide)
136+
The classifier (powered by `claude -p` with your Pro/Max subscription, or the Anthropic API with `--backend=api`) analyzes each chat turn and appends events to the active task:
111137

112-
Hook commands are wrapped with `|| true` so a classifier failure (network down, rate limit, missing key) **never** breaks Claude Code.
138+
- Confidence >= 0.85 -- confirmed event (auto-recorded)
139+
- Confidence < 0.85 -- suggested event (marked with `[?]`)
113140

114-
See [INSTALL.md](./INSTALL.md) for the full hook walkthrough.
141+
Hook commands are wrapped with `|| true` so classifier failures (network down, rate limit) never break Claude Code. Failed classifications are queued in `pending/` and retried on the next ingest.
115142

116-
## CLI commands
143+
## Event Types
117144

118-
| Command | Purpose |
119-
|---------|---------|
120-
| `task-journal create <title>` | Open a task |
121-
| `task-journal event <id> --type X --text Y` | Append a typed event |
122-
| `task-journal close <id> --reason "..."` | Close a task |
123-
| `task-journal event-correct --corrects <event_id> --task <id> --text "..."` | Correction event |
124-
| `task-journal pack <id> --mode compact\|full` | Render resume pack |
125-
| `task-journal search <query>` | FTS5 search in current project |
126-
| `task-journal search <query> --all-projects` | Search across all projects |
127-
| `task-journal events list` | List events for current project |
128-
| `task-journal rebuild-state` | Rebuild SQLite from JSONL |
129-
| `task-journal stats` | Classifier accuracy + counts |
130-
| `task-journal install-hooks [--scope user\|project]` | Install Claude Code hooks |
145+
| Type | Meaning |
146+
|------|---------|
147+
| `open` | Task created with a title and optional context |
148+
| `hypothesis` | Unverified theory ("I think X might cause Y") |
149+
| `finding` | Verified observation from reading code, logs, or docs |
150+
| `evidence` | Result of a test or experiment that proves something |
151+
| `decision` | Committed choice with rationale ("Use X because Y") |
152+
| `rejection` | Explicitly rejected approach with reason |
153+
| `constraint` | External limitation discovered (rate limits, API restrictions) |
154+
| `correction` | Corrects an earlier event (references `corrects` event ID) |
155+
| `reopen` | Reopens a previously closed task |
156+
| `supersede` | Replaces an earlier event (references `supersedes` event ID) |
157+
| `close` | Task completed with outcome summary |
158+
| `redirect` | Task redirected to a different task or approach |
131159

132160
## Architecture
133161

134-
`task-journal` is a Rust workspace with three crates:
162+
Task Journal is a Rust workspace with three crates:
135163

136-
- **`tj-core`** — event schema (JSONL, append-only), SQLite derived state, pack assembler, classifier client (Anthropic API)
137-
- **`tj-cli`**`task-journal` binary
138-
- **`tj-mcp`**`task-journal-mcp` binary (MCP server using `rmcp`)
164+
| Crate | Package | Description |
165+
|-------|---------|-------------|
166+
| `tj-core` | `task-journal-core` | Event schema, JSONL storage, SQLite derived state, pack assembler, classifier client |
167+
| `tj-cli` | `task-journal-cli` | `task-journal` CLI binary |
168+
| `tj-mcp` | `task-journal-mcp` | `task-journal-mcp` MCP server binary (uses `rmcp`) |
139169

140-
**Source of truth = JSONL event log.** SQLite is rebuildable from it via `rebuild-state`. Pack output is Markdown wrapped in JSON metadata.
170+
**Source of truth = JSONL event log.** SQLite state is derived and fully rebuildable via `rebuild-state`. Pack output is Markdown wrapped in JSON metadata.
141171

142-
Where data lives:
172+
### Data Location
143173

144174
| OS | Path |
145175
|----|------|
146-
| Linux/WSL | `$XDG_DATA_HOME/task-journal` (default `~/.local/share/task-journal`) |
176+
| Linux / WSL | `$XDG_DATA_HOME/task-journal` (default `~/.local/share/task-journal`) |
147177
| macOS | `~/Library/Application Support/task-journal` |
148178
| Windows | `%LOCALAPPDATA%\task-journal` |
149179

150-
Layout:
151-
152180
```
153181
task-journal/
154-
├── events/<project_hash>.jsonl # source of truth (append-only)
155-
├── state/<project_hash>.sqlite # derived state (rebuildable)
156-
├── metrics/<project_hash>.jsonl # classifier telemetry
157-
└── pending/<id>.json # failed classifications awaiting retry
182+
events/<project_hash>.jsonl # source of truth (append-only)
183+
state/<project_hash>.sqlite # derived state (rebuildable)
184+
metrics/<project_hash>.jsonl # classifier telemetry
185+
pending/<id>.json # failed classifications awaiting retry
158186
```
159187

160-
## Design docs
161-
162-
- [`.docs/plans/2026-04-29-tz-task-journal-v2.md`](.docs/plans/2026-04-29-tz-task-journal-v2.md) — original spec
163-
- [`.docs/plans/2026-04-29-task-journal-v1-design.md`](.docs/plans/2026-04-29-task-journal-v1-design.md) — design doc (9 architectural decisions)
164-
- [`.docs/plans/2026-04-29-task-journal-v1-p1-skeleton.md`](.docs/plans/2026-04-29-task-journal-v1-p1-skeleton.md) — P1 plan
165-
- [`.docs/plans/2026-04-30-task-journal-v1-p2-task-pack-core.md`](.docs/plans/2026-04-30-task-journal-v1-p2-task-pack-core.md) — P2 plan
166-
- [`.docs/plans/2026-04-30-task-journal-v1-p3-hooks-classifier.md`](.docs/plans/2026-04-30-task-journal-v1-p3-hooks-classifier.md) — P3 plan
167-
- [`.docs/plans/2026-04-30-task-journal-v1-p4-polish-dogfood.md`](.docs/plans/2026-04-30-task-journal-v1-p4-polish-dogfood.md) — P4 plan
188+
Each project is identified by a hash of its canonical path, so multiple projects share the same data directory without collision.
168189

169190
## Development
170191

171192
```bash
172-
cargo test --workspace # all unit + integration tests
173-
.beads/hooks/p1-demo.sh # P1 skeleton smoke
174-
.beads/hooks/p2-demo.sh # P2 task_pack smoke
175-
.beads/hooks/p3-mock-demo.sh # P3 hooks/classifier mock smoke
176-
.beads/hooks/p4-demo.sh # P4 polish smoke
177-
.beads/hooks/p3-demo.sh # Real Anthropic API (requires ANTHROPIC_API_KEY)
193+
cargo test --workspace
178194
```
179195

180-
License: MIT.
196+
Smoke test scripts are available in `.beads/hooks/`:
197+
198+
```bash
199+
.beads/hooks/p1-demo.sh # P1 skeleton smoke
200+
.beads/hooks/p2-demo.sh # P2 task_pack smoke
201+
.beads/hooks/p3-mock-demo.sh # P3 hooks/classifier mock smoke
202+
.beads/hooks/p4-demo.sh # P4 polish smoke
203+
```
204+
205+
## License
206+
207+
MIT

crates/tj-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name = "task-journal"
1616
path = "src/main.rs"
1717

1818
[dependencies]
19-
tj-core = { package = "task-journal-core", version = "0.1.2", path = "../tj-core" }
19+
tj-core = { package = "task-journal-core", version = "0.1.3", path = "../tj-core" }
2020
anyhow = { workspace = true }
2121
clap = { workspace = true }
2222
tracing = { workspace = true }

0 commit comments

Comments
 (0)