{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "claude-sessions",
        "name": "Claude sessions",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795564580,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "48956a2292455efd679e6b5dba365a34c284f79911cf2463885f04711a6668c5"
        },
        "signature": "pBUxb80BbHAnFk9JrPnMy7OO91g42gtcYSIXwyQCaXbYo365H/lw9aJFeS89LbHJeA5WlohYSioCavqpBQRKCA==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "claude-sessions",
        "name": "Claude sessions",
        "description": "Your running Claude Code sessions: folder, working, done or waiting on you, and for how long. Fed by Claude Code hooks on your Mac; with Sync to My Devices it nudges your iPhone too.",
        "icon": "sparkles",
        "version": 3,
        "permissions": [
            "inbox:agent",
            "inbox:tools",
            "inbox:nudge",
            "send:nudge",
            "notify",
            "clipboard.write"
        ],
        "settings": {
            "nudge": {
                "type": "toggle",
                "label": "Nudge my iPhone when a session finishes or needs me",
                "default": true,
                "platforms": [
                    "macos"
                ]
            }
        },
        "state": {
            "sessions": {
                "type": "list",
                "default": [],
                "sync": true
            },
            "prior": {
                "type": "text",
                "default": ""
            },
            "incoming": {
                "type": "text",
                "default": ""
            },
            "changed": {
                "type": "bool",
                "default": false
            },
            "active": {
                "type": "number",
                "default": 0
            },
            "waiting": {
                "type": "number",
                "default": 0
            },
            "mood": {
                "type": "text",
                "default": "idle"
            }
        },
        "sources": {
            "events": {
                "inbox": "agent",
                "on_receive": "seen",
                "platforms": [
                    "macos"
                ]
            },
            "tool_events": {
                "inbox": "tools",
                "on_receive": "seen",
                "platforms": [
                    "macos"
                ]
            },
            "nudges": {
                "inbox": "nudge"
            }
        },
        "actions": {
            "seen": {
                "steps": [
                    {
                        "if": "$args.event.session_id",
                        "then": [
                            {
                                "set": {
                                    "prior": "$sessions | where:'id':$args.event.session_id | pick:0 | pick:'status' | default:'new'"
                                }
                            },
                            {
                                "set": {
                                    "incoming": "$args.event.hook_event_name | map:{SessionStart:'idle', Stop:'done', Notification:'waiting', else:'working'}"
                                }
                            },
                            {
                                "if": "$args.event.hook_event_name | map:{Notification:true, else:false}",
                                "then": [
                                    {
                                        "set": {
                                            "incoming": "$args.event.notification_type | map:{null:'waiting', permission_prompt:'waiting', elicitation_dialog:'waiting', idle_prompt:'done', else:'same'}"
                                        }
                                    }
                                ]
                            },
                            {
                                "if": "$prior | map:{new:false, else:true}",
                                "then": [
                                    {
                                        "if": "$args.event.hook_event_name | map:{SessionStart:true, else:false}",
                                        "then": [
                                            {
                                                "set": {
                                                    "incoming": "same"
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "if": "$incoming | map:{same:true, else:false}",
                                        "then": [
                                            {
                                                "set": {
                                                    "incoming": "$prior"
                                                }
                                            }
                                        ]
                                    }
                                ],
                                "else": [
                                    {
                                        "if": "$incoming | map:{same:true, else:false}",
                                        "then": [
                                            {
                                                "set": {
                                                    "incoming": "working"
                                                }
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "set": {
                                    "changed": "$prior | map:{new:true, else:false}"
                                }
                            },
                            {
                                "if": "$sessions | where:'id':$args.event.session_id | where:'status':$incoming | count | map:{0:true, else:false}",
                                "then": [
                                    {
                                        "set": {
                                            "changed": true
                                        }
                                    }
                                ]
                            },
                            {
                                "if": "$args.event.hook_event_name | map:{SessionEnd:true, else:false}",
                                "then": [
                                    {
                                        "remove": {
                                            "sessions": {
                                                "match": {
                                                    "id": "$args.event.session_id"
                                                }
                                            }
                                        }
                                    }
                                ],
                                "else": [
                                    {
                                        "if": "$prior | map:{new:true, else:false}",
                                        "then": [
                                            {
                                                "push": {
                                                    "sessions": {
                                                        "id": "$args.event.session_id",
                                                        "cwd": "$args.event.cwd",
                                                        "status": "$incoming",
                                                        "started": "$now",
                                                        "since": "$now",
                                                        "message": "$args.event.message"
                                                    }
                                                },
                                                "max": 20
                                            }
                                        ],
                                        "else": [
                                            {
                                                "if": "$changed",
                                                "then": [
                                                    {
                                                        "update": {
                                                            "sessions": {
                                                                "match": {
                                                                    "id": "$args.event.session_id"
                                                                },
                                                                "set": {
                                                                    "status": "$incoming",
                                                                    "since": "$now",
                                                                    "message": "$args.event.message"
                                                                }
                                                            }
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "each": "$sessions",
                                "do": [
                                    {
                                        "if": "$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}",
                                        "then": [
                                            {
                                                "remove": {
                                                    "sessions": {
                                                        "match": {
                                                            "id": "$item.id"
                                                        }
                                                    }
                                                }
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "set": {
                                    "active": "$sessions | where:'status':'working' | count",
                                    "waiting": "$sessions | where:'status':'waiting' | count"
                                }
                            },
                            {
                                "set": {
                                    "mood": "$active | map:{0:'idle', else:'busy'}"
                                }
                            },
                            {
                                "if": "$waiting",
                                "then": [
                                    {
                                        "set": {
                                            "mood": "waiting"
                                        }
                                    }
                                ]
                            },
                            {
                                "if": "$changed",
                                "then": [
                                    {
                                        "if": "$incoming | map:{waiting:true, else:false}",
                                        "then": [
                                            {
                                                "notify": {
                                                    "title": "Claude needs you",
                                                    "body": "{$args.event.cwd | split:'/' | limit:-1 | join}: {$args.event.message | default:'A session is waiting'}"
                                                }
                                            },
                                            {
                                                "if": "$settings.nudge",
                                                "then": [
                                                    {
                                                        "send": {
                                                            "nudge": {
                                                                "event": "waiting",
                                                                "at": "$now"
                                                            }
                                                        },
                                                        "alert": "Claude needs you in {$args.event.cwd | split:'/' | limit:-1 | join}"
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "if": "$args.event.hook_event_name | map:{Stop:true, else:false}",
                                        "then": [
                                            {
                                                "if": "$settings.nudge",
                                                "then": [
                                                    {
                                                        "send": {
                                                            "nudge": {
                                                                "event": "done",
                                                                "at": "$now"
                                                            }
                                                        },
                                                        "alert": "Claude finished in {$args.event.cwd | split:'/' | limit:-1 | join}"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "resume": {
                "args": {
                    "id": "text",
                    "cwd": "text"
                },
                "steps": [
                    {
                        "clipboard.write": {
                            "text": "claude --resume {$args.id}"
                        }
                    },
                    {
                        "toast": "Copied. Run it in Terminal in {$args.cwd | split:'/' | limit:-1 | join}."
                    }
                ]
            },
            "copy_folder": {
                "args": {
                    "cwd": "text"
                },
                "steps": [
                    {
                        "clipboard.write": {
                            "text": "$args.cwd"
                        }
                    },
                    {
                        "toast": "Copied the folder path."
                    }
                ]
            },
            "forget": {
                "args": {
                    "id": "text"
                },
                "steps": [
                    {
                        "remove": {
                            "sessions": {
                                "match": {
                                    "id": "$args.id"
                                }
                            }
                        }
                    },
                    {
                        "each": "$sessions",
                        "do": [
                            {
                                "if": "$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}",
                                "then": [
                                    {
                                        "remove": {
                                            "sessions": {
                                                "match": {
                                                    "id": "$item.id"
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "set": {
                            "active": "$sessions | where:'status':'working' | count",
                            "waiting": "$sessions | where:'status':'waiting' | count"
                        }
                    },
                    {
                        "set": {
                            "mood": "$active | map:{0:'idle', else:'busy'}"
                        }
                    },
                    {
                        "if": "$waiting",
                        "then": [
                            {
                                "set": {
                                    "mood": "waiting"
                                }
                            }
                        ]
                    }
                ]
            },
            "clear": {
                "steps": [
                    {
                        "remove": {
                            "sessions": {
                                "match": {
                                    "status": "done"
                                }
                            }
                        }
                    },
                    {
                        "each": "$sessions",
                        "do": [
                            {
                                "if": "$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}",
                                "then": [
                                    {
                                        "remove": {
                                            "sessions": {
                                                "match": {
                                                    "id": "$item.id"
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "set": {
                            "active": "$sessions | where:'status':'working' | count",
                            "waiting": "$sessions | where:'status':'waiting' | count"
                        }
                    },
                    {
                        "set": {
                            "mood": "$active | map:{0:'idle', else:'busy'}"
                        }
                    },
                    {
                        "if": "$waiting",
                        "then": [
                            {
                                "set": {
                                    "mood": "waiting"
                                }
                            }
                        ]
                    }
                ]
            },
            "recount": {
                "steps": [
                    {
                        "each": "$sessions",
                        "do": [
                            {
                                "if": "$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}",
                                "then": [
                                    {
                                        "remove": {
                                            "sessions": {
                                                "match": {
                                                    "id": "$item.id"
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "set": {
                            "active": "$sessions | where:'status':'working' | count",
                            "waiting": "$sessions | where:'status':'waiting' | count"
                        }
                    },
                    {
                        "set": {
                            "mood": "$active | map:{0:'idle', else:'busy'}"
                        }
                    },
                    {
                        "if": "$waiting",
                        "then": [
                            {
                                "set": {
                                    "mood": "waiting"
                                }
                            }
                        ]
                    }
                ]
            }
        },
        "on_sync": "recount",
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "list": "$sessions",
                            "limit": 8,
                            "item": {
                                "cell": "$item.cwd | split:'/' | limit:-1 | join",
                                "subtitle": "{$item.status | map:{working:'Working', waiting:'Needs you', done:'Done', idle:'Ready'}}{$item.message | map:{null:'', else:' \u00b7 '}}{$item.message}",
                                "status": "$item.status | tone:{working:'accent', waiting:'warn', done:'good', else:'neutral'}",
                                "trailing": {
                                    "timer": "$item.started",
                                    "format": "short"
                                },
                                "on": "resume",
                                "args": {
                                    "id": "$item.id",
                                    "cwd": "$item.cwd"
                                },
                                "context_menu": [
                                    {
                                        "label": "Copy resume command",
                                        "icon": "doc.on.doc",
                                        "on": "resume",
                                        "args": {
                                            "id": "$item.id",
                                            "cwd": "$item.cwd"
                                        }
                                    },
                                    {
                                        "label": "Copy folder path",
                                        "icon": "folder",
                                        "on": "copy_folder",
                                        "args": {
                                            "cwd": "$item.cwd"
                                        }
                                    },
                                    {
                                        "label": "Remove",
                                        "icon": "trash",
                                        "style": "destructive",
                                        "on": "forget",
                                        "args": {
                                            "id": "$item.id"
                                        }
                                    }
                                ]
                            },
                            "empty": "No Claude Code sessions running. Start one in Terminal and it shows here."
                        },
                        {
                            "row": [
                                {
                                    "text": "{$active} working \u00b7 {$waiting} waiting on you",
                                    "size": "xs",
                                    "emphasis": "subtle",
                                    "grow": true
                                },
                                {
                                    "button": "Clear done",
                                    "on": "clear",
                                    "style": "plain",
                                    "size": "s",
                                    "when": "$sessions | where:'status':'done' | count"
                                }
                            ],
                            "align": "center",
                            "when": "$sessions"
                        },
                        {
                            "text": "Click a session to copy its resume command.",
                            "size": "xs",
                            "emphasis": "subtle"
                        }
                    ],
                    "gap": "m"
                }
            },
            {
                "id": "phone",
                "layout": {
                    "column": [
                        {
                            "list": "$sessions",
                            "limit": 8,
                            "item": {
                                "cell": "$item.cwd | split:'/' | limit:-1 | join",
                                "subtitle": "{$item.status | map:{working:'Working', waiting:'Needs you', done:'Done', idle:'Ready'}}{$item.message | map:{null:'', else:' \u00b7 '}}{$item.message}",
                                "status": "$item.status | tone:{working:'accent', waiting:'warn', done:'good', else:'neutral'}",
                                "trailing": {
                                    "timer": "$item.started",
                                    "format": "short"
                                },
                                "context_menu": [
                                    {
                                        "label": "Remove",
                                        "icon": "trash",
                                        "style": "destructive",
                                        "on": "forget",
                                        "args": {
                                            "id": "$item.id"
                                        }
                                    }
                                ]
                            },
                            "empty": "No Claude Code sessions. When one runs on your Mac it shows here."
                        },
                        {
                            "row": [
                                {
                                    "text": "{$active} working \u00b7 {$waiting} waiting on you",
                                    "size": "xs",
                                    "emphasis": "subtle",
                                    "grow": true
                                },
                                {
                                    "button": "Clear done",
                                    "on": "clear",
                                    "style": "plain",
                                    "size": "s",
                                    "when": "$sessions | where:'status':'done' | count"
                                }
                            ],
                            "align": "center",
                            "when": "$sessions"
                        },
                        {
                            "text": "From your Mac, while TailApps is open there.",
                            "size": "xs",
                            "emphasis": "subtle"
                        }
                    ],
                    "gap": "m"
                }
            }
        ],
        "views": {
            "menubar": {
                "icon": "sparkles",
                "label": "{$active} working{$waiting | map:{0:'', else:' \u00b7 '}}{$waiting | map:{0:''}}{$waiting | map:{0:'', else:' need you'}}",
                "label_tone": "$mood | tone:{waiting:'warn', busy:'accent', else:'neutral'}",
                "label_icon": "$mood | map:{waiting:'bubble.left.and.bubble.right', busy:'hammer', else:'sparkles'}",
                "in_menu": "row",
                "card": "main"
            },
            "floating": {
                "card": "main",
                "width": "default"
            },
            "phone": {
                "card": "phone"
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"claude-sessions\",\n  \"name\": \"Claude sessions\",\n  \"description\": \"Your running Claude Code sessions: folder, working, done or waiting on you, and for how long. Fed by Claude Code hooks on your Mac; with Sync to My Devices it nudges your iPhone too.\",\n  \"icon\": \"sparkles\",\n  \"version\": 3,\n  \"permissions\": [\n    \"inbox:agent\",\n    \"inbox:tools\",\n    \"inbox:nudge\",\n    \"send:nudge\",\n    \"notify\",\n    \"clipboard.write\"\n  ],\n  \"settings\": {\n    \"nudge\": {\n      \"type\": \"toggle\",\n      \"label\": \"Nudge my iPhone when a session finishes or needs me\",\n      \"default\": true,\n      \"platforms\": [\n        \"macos\"\n      ]\n    }\n  },\n  \"state\": {\n    \"sessions\": {\n      \"type\": \"list\",\n      \"default\": [],\n      \"sync\": true\n    },\n    \"prior\": {\n      \"type\": \"text\",\n      \"default\": \"\"\n    },\n    \"incoming\": {\n      \"type\": \"text\",\n      \"default\": \"\"\n    },\n    \"changed\": {\n      \"type\": \"bool\",\n      \"default\": false\n    },\n    \"active\": {\n      \"type\": \"number\",\n      \"default\": 0\n    },\n    \"waiting\": {\n      \"type\": \"number\",\n      \"default\": 0\n    },\n    \"mood\": {\n      \"type\": \"text\",\n      \"default\": \"idle\"\n    }\n  },\n  \"sources\": {\n    \"events\": {\n      \"inbox\": \"agent\",\n      \"on_receive\": \"seen\",\n      \"platforms\": [\n        \"macos\"\n      ]\n    },\n    \"tool_events\": {\n      \"inbox\": \"tools\",\n      \"on_receive\": \"seen\",\n      \"platforms\": [\n        \"macos\"\n      ]\n    },\n    \"nudges\": {\n      \"inbox\": \"nudge\"\n    }\n  },\n  \"actions\": {\n    \"seen\": {\n      \"steps\": [\n        {\n          \"if\": \"$args.event.session_id\",\n          \"then\": [\n            {\n              \"set\": {\n                \"prior\": \"$sessions | where:'id':$args.event.session_id | pick:0 | pick:'status' | default:'new'\"\n              }\n            },\n            {\n              \"set\": {\n                \"incoming\": \"$args.event.hook_event_name | map:{SessionStart:'idle', Stop:'done', Notification:'waiting', else:'working'}\"\n              }\n            },\n            {\n              \"if\": \"$args.event.hook_event_name | map:{Notification:true, else:false}\",\n              \"then\": [\n                {\n                  \"set\": {\n                    \"incoming\": \"$args.event.notification_type | map:{null:'waiting', permission_prompt:'waiting', elicitation_dialog:'waiting', idle_prompt:'done', else:'same'}\"\n                  }\n                }\n              ]\n            },\n            {\n              \"if\": \"$prior | map:{new:false, else:true}\",\n              \"then\": [\n                {\n                  \"if\": \"$args.event.hook_event_name | map:{SessionStart:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"set\": {\n                        \"incoming\": \"same\"\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"if\": \"$incoming | map:{same:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"set\": {\n                        \"incoming\": \"$prior\"\n                      }\n                    }\n                  ]\n                }\n              ],\n              \"else\": [\n                {\n                  \"if\": \"$incoming | map:{same:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"set\": {\n                        \"incoming\": \"working\"\n                      }\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"set\": {\n                \"changed\": \"$prior | map:{new:true, else:false}\"\n              }\n            },\n            {\n              \"if\": \"$sessions | where:'id':$args.event.session_id | where:'status':$incoming | count | map:{0:true, else:false}\",\n              \"then\": [\n                {\n                  \"set\": {\n                    \"changed\": true\n                  }\n                }\n              ]\n            },\n            {\n              \"if\": \"$args.event.hook_event_name | map:{SessionEnd:true, else:false}\",\n              \"then\": [\n                {\n                  \"remove\": {\n                    \"sessions\": {\n                      \"match\": {\n                        \"id\": \"$args.event.session_id\"\n                      }\n                    }\n                  }\n                }\n              ],\n              \"else\": [\n                {\n                  \"if\": \"$prior | map:{new:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"push\": {\n                        \"sessions\": {\n                          \"id\": \"$args.event.session_id\",\n                          \"cwd\": \"$args.event.cwd\",\n                          \"status\": \"$incoming\",\n                          \"started\": \"$now\",\n                          \"since\": \"$now\",\n                          \"message\": \"$args.event.message\"\n                        }\n                      },\n                      \"max\": 20\n                    }\n                  ],\n                  \"else\": [\n                    {\n                      \"if\": \"$changed\",\n                      \"then\": [\n                        {\n                          \"update\": {\n                            \"sessions\": {\n                              \"match\": {\n                                \"id\": \"$args.event.session_id\"\n                              },\n                              \"set\": {\n                                \"status\": \"$incoming\",\n                                \"since\": \"$now\",\n                                \"message\": \"$args.event.message\"\n                              }\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"each\": \"$sessions\",\n              \"do\": [\n                {\n                  \"if\": \"$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"remove\": {\n                        \"sessions\": {\n                          \"match\": {\n                            \"id\": \"$item.id\"\n                          }\n                        }\n                      }\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"set\": {\n                \"active\": \"$sessions | where:'status':'working' | count\",\n                \"waiting\": \"$sessions | where:'status':'waiting' | count\"\n              }\n            },\n            {\n              \"set\": {\n                \"mood\": \"$active | map:{0:'idle', else:'busy'}\"\n              }\n            },\n            {\n              \"if\": \"$waiting\",\n              \"then\": [\n                {\n                  \"set\": {\n                    \"mood\": \"waiting\"\n                  }\n                }\n              ]\n            },\n            {\n              \"if\": \"$changed\",\n              \"then\": [\n                {\n                  \"if\": \"$incoming | map:{waiting:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"notify\": {\n                        \"title\": \"Claude needs you\",\n                        \"body\": \"{$args.event.cwd | split:'/' | limit:-1 | join}: {$args.event.message | default:'A session is waiting'}\"\n                      }\n                    },\n                    {\n                      \"if\": \"$settings.nudge\",\n                      \"then\": [\n                        {\n                          \"send\": {\n                            \"nudge\": {\n                              \"event\": \"waiting\",\n                              \"at\": \"$now\"\n                            }\n                          },\n                          \"alert\": \"Claude needs you in {$args.event.cwd | split:'/' | limit:-1 | join}\"\n                        }\n                      ]\n                    }\n                  ]\n                },\n                {\n                  \"if\": \"$args.event.hook_event_name | map:{Stop:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"if\": \"$settings.nudge\",\n                      \"then\": [\n                        {\n                          \"send\": {\n                            \"nudge\": {\n                              \"event\": \"done\",\n                              \"at\": \"$now\"\n                            }\n                          },\n                          \"alert\": \"Claude finished in {$args.event.cwd | split:'/' | limit:-1 | join}\"\n                        }\n                      ]\n                    }\n                  ]\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    },\n    \"resume\": {\n      \"args\": {\n        \"id\": \"text\",\n        \"cwd\": \"text\"\n      },\n      \"steps\": [\n        {\n          \"clipboard.write\": {\n            \"text\": \"claude --resume {$args.id}\"\n          }\n        },\n        {\n          \"toast\": \"Copied. Run it in Terminal in {$args.cwd | split:'/' | limit:-1 | join}.\"\n        }\n      ]\n    },\n    \"copy_folder\": {\n      \"args\": {\n        \"cwd\": \"text\"\n      },\n      \"steps\": [\n        {\n          \"clipboard.write\": {\n            \"text\": \"$args.cwd\"\n          }\n        },\n        {\n          \"toast\": \"Copied the folder path.\"\n        }\n      ]\n    },\n    \"forget\": {\n      \"args\": {\n        \"id\": \"text\"\n      },\n      \"steps\": [\n        {\n          \"remove\": {\n            \"sessions\": {\n              \"match\": {\n                \"id\": \"$args.id\"\n              }\n            }\n          }\n        },\n        {\n          \"each\": \"$sessions\",\n          \"do\": [\n            {\n              \"if\": \"$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}\",\n              \"then\": [\n                {\n                  \"remove\": {\n                    \"sessions\": {\n                      \"match\": {\n                        \"id\": \"$item.id\"\n                      }\n                    }\n                  }\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"set\": {\n            \"active\": \"$sessions | where:'status':'working' | count\",\n            \"waiting\": \"$sessions | where:'status':'waiting' | count\"\n          }\n        },\n        {\n          \"set\": {\n            \"mood\": \"$active | map:{0:'idle', else:'busy'}\"\n          }\n        },\n        {\n          \"if\": \"$waiting\",\n          \"then\": [\n            {\n              \"set\": {\n                \"mood\": \"waiting\"\n              }\n            }\n          ]\n        }\n      ]\n    },\n    \"clear\": {\n      \"steps\": [\n        {\n          \"remove\": {\n            \"sessions\": {\n              \"match\": {\n                \"status\": \"done\"\n              }\n            }\n          }\n        },\n        {\n          \"each\": \"$sessions\",\n          \"do\": [\n            {\n              \"if\": \"$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}\",\n              \"then\": [\n                {\n                  \"remove\": {\n                    \"sessions\": {\n                      \"match\": {\n                        \"id\": \"$item.id\"\n                      }\n                    }\n                  }\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"set\": {\n            \"active\": \"$sessions | where:'status':'working' | count\",\n            \"waiting\": \"$sessions | where:'status':'waiting' | count\"\n          }\n        },\n        {\n          \"set\": {\n            \"mood\": \"$active | map:{0:'idle', else:'busy'}\"\n          }\n        },\n        {\n          \"if\": \"$waiting\",\n          \"then\": [\n            {\n              \"set\": {\n                \"mood\": \"waiting\"\n              }\n            }\n          ]\n        }\n      ]\n    },\n    \"recount\": {\n      \"steps\": [\n        {\n          \"each\": \"$sessions\",\n          \"do\": [\n            {\n              \"if\": \"$item.since | times:-1 | add:$now | tone:{bad:'>43200', else:'good'} | map:{bad:true, else:false}\",\n              \"then\": [\n                {\n                  \"remove\": {\n                    \"sessions\": {\n                      \"match\": {\n                        \"id\": \"$item.id\"\n                      }\n                    }\n                  }\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"set\": {\n            \"active\": \"$sessions | where:'status':'working' | count\",\n            \"waiting\": \"$sessions | where:'status':'waiting' | count\"\n          }\n        },\n        {\n          \"set\": {\n            \"mood\": \"$active | map:{0:'idle', else:'busy'}\"\n          }\n        },\n        {\n          \"if\": \"$waiting\",\n          \"then\": [\n            {\n              \"set\": {\n                \"mood\": \"waiting\"\n              }\n            }\n          ]\n        }\n      ]\n    }\n  },\n  \"on_sync\": \"recount\",\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"list\": \"$sessions\",\n            \"limit\": 8,\n            \"item\": {\n              \"cell\": \"$item.cwd | split:'/' | limit:-1 | join\",\n              \"subtitle\": \"{$item.status | map:{working:'Working', waiting:'Needs you', done:'Done', idle:'Ready'}}{$item.message | map:{null:'', else:' \u00b7 '}}{$item.message}\",\n              \"status\": \"$item.status | tone:{working:'accent', waiting:'warn', done:'good', else:'neutral'}\",\n              \"trailing\": {\n                \"timer\": \"$item.started\",\n                \"format\": \"short\"\n              },\n              \"on\": \"resume\",\n              \"args\": {\n                \"id\": \"$item.id\",\n                \"cwd\": \"$item.cwd\"\n              },\n              \"context_menu\": [\n                {\n                  \"label\": \"Copy resume command\",\n                  \"icon\": \"doc.on.doc\",\n                  \"on\": \"resume\",\n                  \"args\": {\n                    \"id\": \"$item.id\",\n                    \"cwd\": \"$item.cwd\"\n                  }\n                },\n                {\n                  \"label\": \"Copy folder path\",\n                  \"icon\": \"folder\",\n                  \"on\": \"copy_folder\",\n                  \"args\": {\n                    \"cwd\": \"$item.cwd\"\n                  }\n                },\n                {\n                  \"label\": \"Remove\",\n                  \"icon\": \"trash\",\n                  \"style\": \"destructive\",\n                  \"on\": \"forget\",\n                  \"args\": {\n                    \"id\": \"$item.id\"\n                  }\n                }\n              ]\n            },\n            \"empty\": \"No Claude Code sessions running. Start one in Terminal and it shows here.\"\n          },\n          {\n            \"row\": [\n              {\n                \"text\": \"{$active} working \u00b7 {$waiting} waiting on you\",\n                \"size\": \"xs\",\n                \"emphasis\": \"subtle\",\n                \"grow\": true\n              },\n              {\n                \"button\": \"Clear done\",\n                \"on\": \"clear\",\n                \"style\": \"plain\",\n                \"size\": \"s\",\n                \"when\": \"$sessions | where:'status':'done' | count\"\n              }\n            ],\n            \"align\": \"center\",\n            \"when\": \"$sessions\"\n          },\n          {\n            \"text\": \"Click a session to copy its resume command.\",\n            \"size\": \"xs\",\n            \"emphasis\": \"subtle\"\n          }\n        ],\n        \"gap\": \"m\"\n      }\n    },\n    {\n      \"id\": \"phone\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"list\": \"$sessions\",\n            \"limit\": 8,\n            \"item\": {\n              \"cell\": \"$item.cwd | split:'/' | limit:-1 | join\",\n              \"subtitle\": \"{$item.status | map:{working:'Working', waiting:'Needs you', done:'Done', idle:'Ready'}}{$item.message | map:{null:'', else:' \u00b7 '}}{$item.message}\",\n              \"status\": \"$item.status | tone:{working:'accent', waiting:'warn', done:'good', else:'neutral'}\",\n              \"trailing\": {\n                \"timer\": \"$item.started\",\n                \"format\": \"short\"\n              },\n              \"context_menu\": [\n                {\n                  \"label\": \"Remove\",\n                  \"icon\": \"trash\",\n                  \"style\": \"destructive\",\n                  \"on\": \"forget\",\n                  \"args\": {\n                    \"id\": \"$item.id\"\n                  }\n                }\n              ]\n            },\n            \"empty\": \"No Claude Code sessions. When one runs on your Mac it shows here.\"\n          },\n          {\n            \"row\": [\n              {\n                \"text\": \"{$active} working \u00b7 {$waiting} waiting on you\",\n                \"size\": \"xs\",\n                \"emphasis\": \"subtle\",\n                \"grow\": true\n              },\n              {\n                \"button\": \"Clear done\",\n                \"on\": \"clear\",\n                \"style\": \"plain\",\n                \"size\": \"s\",\n                \"when\": \"$sessions | where:'status':'done' | count\"\n              }\n            ],\n            \"align\": \"center\",\n            \"when\": \"$sessions\"\n          },\n          {\n            \"text\": \"From your Mac, while TailApps is open there.\",\n            \"size\": \"xs\",\n            \"emphasis\": \"subtle\"\n          }\n        ],\n        \"gap\": \"m\"\n      }\n    }\n  ],\n  \"views\": {\n    \"menubar\": {\n      \"icon\": \"sparkles\",\n      \"label\": \"{$active} working{$waiting | map:{0:'', else:' \u00b7 '}}{$waiting | map:{0:''}}{$waiting | map:{0:'', else:' need you'}}\",\n      \"label_tone\": \"$mood | tone:{waiting:'warn', busy:'accent', else:'neutral'}\",\n      \"label_icon\": \"$mood | map:{waiting:'bubble.left.and.bubble.right', busy:'hammer', else:'sparkles'}\",\n      \"in_menu\": \"row\",\n      \"card\": \"main\"\n    },\n    \"floating\": {\n      \"card\": \"main\",\n      \"width\": \"default\"\n    },\n    \"phone\": {\n      \"card\": \"phone\"\n    }\n  }\n}\n",
    "files": []
}