Skip to content

Commit cdbd1b4

Browse files
byapparovclaude
andcommitted
refactor(tool): remove the built-in todo tooling (#182)
Delete todowrite/todoread and everything that only existed for them: the tool, its descriptions, the session Todo store and its drizzle table declaration, the legacy JSON todo migration, the ACP todo-to-plan mapping, the run/github renderers, the subagent denies, and the #164 headless gating together with HeadlessRun, which has no other consumer. TodoWrite mentions are removed from the anthropic base prompt, and two unused prompt files that referenced the todo tool are deleted. Compatibility: - `tools`/`permission` keys naming todowrite/todoread still load (the permission schema's catchall accepts them) and change no offered tool. - The `todo` table and legacy `storage/todo/*.json` files are left in place and ignored; the table stays in the database, as `workspace` did. - `aictrl run --continue` on a session whose history has todowrite tool parts replays that history and runs another turn. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d255d0e commit cdbd1b4

22 files changed

Lines changed: 187 additions & 719 deletions

‎README.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ and [JSON event reference](EVENTS.md).
7070

7171
In headless mode, Aictrl automatically rejects all interactive permission requests, ensuring your pipelines never hang.
7272

73-
`aictrl run` does not offer the `todowrite` tool: its definition adds about 2.4k tokens to
74-
every request, and a one-shot run has nobody following a todo list. To track a plan, instruct
75-
the agent to keep one in a file.
76-
7773
### Skill Scope
7874

7975
`aictrl run` does not list skills from `~/.claude`, `~/.agents` or `~/.opencode`;

‎packages/cli/README.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ Provider failures and stream timeouts retain **1**; SIGINT/SIGTERM retain
9595

9696
In headless mode, Aictrl automatically rejects permissions that would otherwise prompt a user.
9797

98-
`aictrl run` does not offer the `todowrite` tool: its definition adds about 2.4k tokens to
99-
every request, and a one-shot run has nobody following a todo list. To track a plan, instruct
100-
the agent to keep one in a file.
101-
10298
### Skill Scope
10399

104100
`aictrl run` lists project skills (`.aictrl/skill(s)/`, and `.claude/skills/`,

‎packages/cli/src/agent/agent.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,7 @@ export namespace Agent {
9191
general: {
9292
name: "general",
9393
description: `General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.`,
94-
permission: PermissionNext.merge(
95-
defaults,
96-
PermissionNext.fromConfig({
97-
todoread: "deny",
98-
todowrite: "deny",
99-
}),
100-
user,
101-
),
94+
permission: PermissionNext.merge(defaults, user),
10295
options: {},
10396
mode: "subagent",
10497
native: true,

‎packages/cli/src/cli/cmd/agent.ts‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@ import type { Argv } from "yargs"
1414

1515
type AgentMode = "all" | "primary" | "subagent"
1616

17-
const AVAILABLE_TOOLS = [
18-
"bash",
19-
"read",
20-
"write",
21-
"edit",
22-
"list",
23-
"glob",
24-
"grep",
25-
"webfetch",
26-
"task",
27-
"todowrite",
28-
"todoread",
29-
]
17+
const AVAILABLE_TOOLS = ["bash", "read", "write", "edit", "list", "glob", "grep", "webfetch", "task"]
3018

3119
const AgentCreateCommand = cmd({
3220
command: "create",

‎packages/cli/src/cli/cmd/run.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import { TaskTool } from "../../tool/task"
3939
import { SkillTool } from "../../tool/skill"
4040
import { Skill } from "../../skill"
4141
import { BashTool } from "../../tool/bash"
42-
import { TodoWriteTool } from "../../tool/todo"
4342
import { Locale } from "../../util/locale"
4443
import { Log } from "../../util/log"
4544
import { Shutdown } from "../shutdown"
@@ -286,16 +285,6 @@ function bash(info: ToolProps<typeof BashTool>) {
286285
)
287286
}
288287

289-
function todo(info: ToolProps<typeof TodoWriteTool>) {
290-
block(
291-
{
292-
icon: "#",
293-
title: "Todos",
294-
},
295-
info.input.todos.map((item) => `${item.status === "completed" ? "[x]" : "[ ]"} ${item.content}`).join("\n"),
296-
)
297-
}
298-
299288
function normalizePath(input?: string) {
300289
if (!input) return ""
301290
if (path.isAbsolute(input)) return path.relative(process.cwd(), input) || "."
@@ -566,7 +555,6 @@ export const RunCommand = cmd({
566555
if (part.tool === "codesearch") return codesearch(props<typeof CodeSearchTool>(part))
567556
if (part.tool === "websearch") return websearch(props<typeof WebSearchTool>(part))
568557
if (part.tool === "task") return task(props<typeof TaskTool>(part))
569-
if (part.tool === "todowrite") return todo(props<typeof TodoWriteTool>(part))
570558
if (part.tool === "skill") return skill(props<typeof SkillTool>(part))
571559
return fallback(part)
572560
} catch {

‎packages/cli/src/config/config.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,6 @@ export namespace Config {
620620
bash: PermissionRule.optional(),
621621
task: PermissionRule.optional(),
622622
external_directory: PermissionRule.optional(),
623-
todowrite: PermissionAction.optional(),
624-
todoread: PermissionAction.optional(),
625623
webfetch: PermissionAction.optional(),
626624
websearch: PermissionAction.optional(),
627625
codesearch: PermissionAction.optional(),

‎packages/cli/src/session/prompt/anthropic.txt‎

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,57 +20,8 @@ When the user directly asks about Aictrl (eg. "can Aictrl do...", "does Aictrl h
2020
# Professional objectivity
2121
Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving, providing direct, objective technical info without any unnecessary superlatives, praise, or emotional validation. It is best for the user if Aictrl honestly applies the same rigorous standards to all ideas and disagrees when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.
2222

23-
# Task Management
24-
You have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
25-
These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.
26-
27-
It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.
28-
29-
Examples:
30-
31-
<example>
32-
user: Run the build and fix any type errors
33-
assistant: I'm going to use the TodoWrite tool to write the following items to the todo list:
34-
- Run the build
35-
- Fix any type errors
36-
37-
I'm now going to run the build using Bash.
38-
39-
Looks like I found 10 type errors. I'm going to use the TodoWrite tool to write 10 items to the todo list.
40-
41-
marking the first todo as in_progress
42-
43-
Let me start working on the first item...
44-
45-
The first item has been fixed, let me mark the first todo as completed, and move on to the second item...
46-
..
47-
..
48-
</example>
49-
In the above example, the assistant completes all the tasks, including the 10 error fixes and running the build and fixing all errors.
50-
51-
<example>
52-
user: Help me write a new feature that allows users to track their usage metrics and export them to various formats
53-
assistant: I'll help you implement a usage metrics tracking and export feature. Let me first use the TodoWrite tool to plan this task.
54-
Adding the following todos to the todo list:
55-
1. Research existing metrics tracking in the codebase
56-
2. Design the metrics collection system
57-
3. Implement core metrics tracking functionality
58-
4. Create export functionality for different formats
59-
60-
Let me start by researching the existing codebase to understand what metrics we might already be tracking and how we can build on that.
61-
62-
I'm going to search for any existing metrics or telemetry code in the project.
63-
64-
I've found some existing telemetry code. Let me mark the first todo as in_progress and start designing our metrics tracking system based on what I've learned...
65-
66-
[Assistant continues implementing the feature step by step, marking todos as in_progress and completed as they go]
67-
</example>
68-
69-
7023
# Doing tasks
71-
The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
72-
-
73-
- Use the TodoWrite tool to plan the task if required
24+
The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more.
7425

7526
- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are automatically added by the system, and bear no direct relation to the specific tool results or user messages in which they appear.
7627

@@ -93,8 +44,6 @@ user: What is the codebase structure?
9344
assistant: [Uses the Task tool]
9445
</example>
9546

96-
IMPORTANT: Always use the TodoWrite tool to plan and track tasks throughout the conversation.
97-
9847
# Code References
9948

10049
When referencing specific functions or pieces of code include the pattern `file_path:line_number` to allow the user to easily navigate to the source code location.

‎packages/cli/src/session/session.sql.ts‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sqliteTable, text, integer, index, primaryKey } from "drizzle-orm/sqlite-core"
1+
import { sqliteTable, text, integer, index } from "drizzle-orm/sqlite-core"
22
import { ProjectTable } from "../project/project.sql"
33
import type { MessageV2 } from "./message-v2"
44
import type { PermissionNext } from "@/permission/next"
@@ -67,24 +67,6 @@ export const PartTable = sqliteTable(
6767
(table) => [index("part_message_idx").on(table.message_id), index("part_session_idx").on(table.session_id)],
6868
)
6969

70-
export const TodoTable = sqliteTable(
71-
"todo",
72-
{
73-
session_id: text()
74-
.notNull()
75-
.references(() => SessionTable.id, { onDelete: "cascade" }),
76-
content: text().notNull(),
77-
status: text().notNull(),
78-
priority: text().notNull(),
79-
position: integer().notNull(),
80-
...Timestamps,
81-
},
82-
(table) => [
83-
primaryKey({ columns: [table.session_id, table.position] }),
84-
index("todo_session_idx").on(table.session_id),
85-
],
86-
)
87-
8870
export const PermissionTable = sqliteTable("permission", {
8971
project_id: text()
9072
.primaryKey()

‎packages/cli/src/session/system.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Ripgrep } from "../file/ripgrep"
33
import { Instance } from "../project/instance"
44

55
import PROMPT_ANTHROPIC from "./prompt/anthropic.txt"
6-
import PROMPT_ANTHROPIC_WITHOUT_TODO from "./prompt/qwen.txt"
6+
import PROMPT_QWEN from "./prompt/qwen.txt"
77
import PROMPT_BEAST from "./prompt/beast.txt"
88
import PROMPT_GEMINI from "./prompt/gemini.txt"
99

@@ -23,7 +23,7 @@ export namespace SystemPrompt {
2323
if (model.api.id.includes("gemini-")) return [PROMPT_GEMINI]
2424
if (model.api.id.includes("claude")) return [PROMPT_ANTHROPIC]
2525
if (model.api.id.toLowerCase().includes("trinity")) return [PROMPT_TRINITY]
26-
return [PROMPT_ANTHROPIC_WITHOUT_TODO]
26+
return [PROMPT_QWEN]
2727
}
2828

2929
export async function environment(model: Provider.Model) {

‎packages/cli/src/session/todo.ts‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)