File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/hooks/claude-code-hooks Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,18 @@ export function createClaudeCodeHooksHook(
202202 input : { tool : string ; sessionID : string ; callID : string } ,
203203 output : { args : Record < string , unknown > }
204204 ) : Promise < void > => {
205+ if ( input . tool === "todowrite" && typeof output . args . todos === "string" ) {
206+ try {
207+ const parsed = JSON . parse ( output . args . todos as string )
208+ if ( Array . isArray ( parsed ) ) {
209+ output . args . todos = parsed
210+ log ( "todowrite: parsed todos string to array" , { sessionID : input . sessionID } )
211+ }
212+ } catch ( e ) {
213+ log ( "todowrite: failed to parse todos string" , { sessionID : input . sessionID , error : String ( e ) } )
214+ }
215+ }
216+
205217 const claudeConfig = await loadClaudeHooksConfig ( )
206218 const extendedConfig = await loadPluginExtendedConfig ( )
207219
You can’t perform that action at this time.
0 commit comments