23 wiki pages untouched for 6 months
What should happen to these 23 pages?
23 pages in the team wikis were last edited more than 180 days ago, and 7 of them were last edited by people who have left.
On the 1st of each month: wiki pages in Notion not edited in 180 days, who wrote and last edited each one, and a question on what to do with them.
Reads
You get
The card on the right is a sample. Yours shows your own numbers and updates in place every run.
What lands on your board
What should happen to these 23 pages?
23 pages in the team wikis were last edited more than 180 days ago, and 7 of them were last edited by people who have left.
Every team wiki in Notion has an onboarding page that still tells new hires to ask someone who left a year ago. Nobody deletes it, because nobody is sure it is wrong, and search keeps serving it up.
Once a month the agent lists the wiki pages that have gone 180 days without an edit, with who wrote them and who touched them last. You decide in one answer: ask each owner to look, trash the clearly dead ones, or go through them one by one.
Call POST /v1/search with filter: { property: "object", value: "page" }, sort: { timestamp: "last_edited_time", direction: "ascending" } and page_size: 100, paging with start_cursor. Stop once last_edited_time is less than 180 days old.
Keep pages that sit under the wiki pages or teamspaces you named, walking parent.page_id upward with GET /v1/pages/{id}. Skip pages whose parent is a database, such as task rows and meeting notes, unless you asked for them.
Look up created_by.id and last_edited_by.id with GET /v1/users/{id}. Mark people who no longer appear in GET /v1/users, since their pages have no one to ask.
Post the list as an ask. To ask owners, add a comment on each page with POST /v1/comments that mentions the last editor. To trash a page, call PATCH /v1/pages/{id} with in_trash: true; it can be restored from Trash.
With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.
Pick your agent, where the data comes from and how to schedule it; the commands below follow.
One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.
shellcurl -fsSL https://briefkin.dev/skills/notion-stale-docs-audit/install | shAsk Claude Code:
promptRun the notion-stale-docs-audit skillOr paste the prompt instead of installing:
promptUsing the Notion API (POST /v1/search for pages, sorted by last_edited_time ascending), list the pages under my wiki that have not been edited in 180 days, skipping database rows. For each give the title, where it lives, days since last edit, who created it and who last edited it, and mark people who are no longer in the workspace. Group the count by wiki, sort oldest first, and ask me whether to comment to each owner, trash the oldest, or go one by one. Change nothing until I answer.1st of the month at 10:00, from cron on any machine where Claude Code is signed in:
crontab0 10 1 * * claude -p "Run the notion-stale-docs-audit skill"Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.
Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a question for you. How setup works
SKILL.md---
name: notion-stale-docs-audit
description: "On the 1st of each month: wiki pages in Notion not edited in 180 days, who wrote and last edited each one, and a question on what to do with them. Use when the user asks for this, or when it runs on a schedule."
---
# Notion stale docs audit
On the 1st of each month: wiki pages in Notion not edited in 180 days, who wrote and last edited each one, and a question on what to do with them.
Every team wiki in Notion has an onboarding page that still tells new hires to ask someone who left a year ago. Nobody deletes it, because nobody is sure it is wrong, and search keeps serving it up.
Once a month the agent lists the wiki pages that have gone 180 days without an edit, with who wrote them and who touched them last. You decide in one answer: ask each owner to look, trash the clearly dead ones, or go through them one by one.
## Two ways to get the data
Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.
## Route A: API or MCP server
### What you need
- A Notion integration with Read content and Read user information capabilities, shared with the wiki pages; add Update content and Insert comments if it should act on your answer.
- The Notion MCP server can read these pages too, but its search is built for finding pages by topic; the API integration gives an explicit sort by last edit, which is what this audit needs.
If something is missing, say what and stop; do not invent numbers.
### Steps
1. **Search oldest edits first** (Notion): Call `POST /v1/search` with `filter: { property: "object", value: "page" }`, `sort: { timestamp: "last_edited_time", direction: "ascending" }` and `page_size: 100`, paging with `start_cursor`. Stop once `last_edited_time` is less than 180 days old.
2. **Keep the wiki** (Notion): Keep pages that sit under the wiki pages or teamspaces you named, walking `parent.page_id` upward with `GET /v1/pages/{id}`. Skip pages whose parent is a database, such as task rows and meeting notes, unless you asked for them.
3. **Name the people** (Notion): Look up `created_by.id` and `last_edited_by.id` with `GET /v1/users/{id}`. Mark people who no longer appear in `GET /v1/users`, since their pages have no one to ask.
4. **Ask, then act** (Notion): Post the list as an ask. To ask owners, add a comment on each page with `POST /v1/comments` that mentions the last editor. To trash a page, call `PATCH /v1/pages/{id}` with `in_trash: true`; it can be restored from Trash.
## Route B: the browser
### What you need
- Signed in to Notion as a workspace member with at least Can view on the wikis, Can comment to leave comments, and Full access on a page to trash it.
If something is missing, say what and stop; do not invent numbers.
### Steps
Start at https://www.notion.so/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.
1. **Search with a last-edited filter**: In the Notion web app pick the workspace, open **Search** from the sidebar and leave the query empty. Add the **Date** filter set to **Last edited**, **Before**, with the date 180 days ago, and under **In** pick the wiki page or teamspace to audit. Set **Sort** to `Last edited: Oldest first`. Untick anything that filters to titles only.
2. **Skip database rows**: Each result shows its breadcrumb. Leave out rows that live inside a database (tasks, meeting notes, CRM entries) unless the audit should include them, and keep pages under the wiki.
3. **Read who wrote and last edited each page**: Open each page: the **Edited** timestamp at the top names the last editor on hover, and **Page history** (in the `...` menu) shows the earliest version and its author. Members who are gone show as deactivated or appear in **Settings > People** no longer; mark those.
4. **Ask, then act**: Post the list by wiki, oldest first, and the question. To ask owners, add a comment on the page mentioning the last editor with `@`. To trash, use **Move to Trash** in the page menu; it can be restored from **Trash** in the sidebar.
Note: Notion search returns results in pages of a few dozen as you scroll, and reading the creator means opening each page, so this route suits a wiki of up to a hundred or so stale pages. Workspace owners on Enterprise plans also have a content search under Settings with last-edited columns, which is faster for large workspaces.
## The report
- **Stale pages**: how many, and how many were last edited by people who have left.
- **By space** or top-level wiki page.
- **The list**, oldest first: page, where it lives, last edited, by whom, and who created it.
- The ask: comment to each owner, trash the oldest, go one by one, or leave them.
## Post it to Briefkin
When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.
```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
-H "authorization: Bearer $BRIEFKIN_TOKEN" \
-H "content-type: application/json" \
-d @- <<'JSON'
{
"v": 1,
"event_id": "notion-stale-docs-audit/<date of this run, e.g. 2026-10-16>",
"item_key": "notion-stale-docs-audit",
"project": "Acme",
"source": "Notion stale docs audit skill",
"kind": "action",
"title": "23 wiki pages untouched for 6 months",
"summary": "**23** pages in the team wikis were last edited more than 180 days ago, and **7** of them were last edited by people who have left.",
"action": {
"request": "What should happen to these 23 pages?",
"options": [
"Ask each owner to review",
"Trash the 5 oldest",
"Go one by one",
"Leave them"
]
},
"widget": [
{
"type": "Badges",
"props": {
"items": [
{
"label": "Engineering 11"
},
{
"label": "Company wiki 6"
},
{
"label": "Marketing 4"
},
{
"label": "Customer success 2"
}
]
}
},
{
"type": "Table",
"props": {
"columns": [
"Page",
"Wiki",
"Last edited",
"By"
],
"align": [
"left",
"left",
"right",
"left"
],
"rows": [
[
"Deploying to staging",
"Engineering",
"412 days ago",
"Sam (left)"
],
[
"On-call handbook",
"Engineering",
"298 days ago",
"Priya"
],
[
"Expense policy",
"Company wiki",
"265 days ago",
"Dana"
],
[
"Brand voice guide",
"Marketing",
"240 days ago",
"Lena (left)"
],
[
"Customer onboarding checklist",
"Customer success",
"221 days ago",
"Marco"
],
[
"Local dev setup",
"Engineering",
"196 days ago",
"Theo"
]
]
}
},
{
"type": "Callout",
"props": {
"text": "Start with \"Deploying to staging\": it is the oldest, and the person who last edited it has left.",
"tone": "warn"
}
}
]
}
JSON
```
Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.
## Run it on a schedule
Suggested: 1st of the month at 10:00 (`0 10 1 * *`). From cron, with the agent signed in on that machine:
```bash
0 10 1 * * claude -p "Run the notion-stale-docs-audit skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```
Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/notion-stale-docs-audit#schedule
Source: https://briefkin.dev/skills/notion-stale-docs-audit
A Notion integration with Read content and Read user information capabilities, shared with the wiki pages; add Update content and Insert comments if it should act on your answer.
The Notion MCP server can read these pages too, but its search is built for finding pages by topic; the API integration gives an explicit sort by last edit, which is what this audit needs.
https://mcp.notion.com/mcp. Add Notion from Claude's connector directory, or run claude mcp add --transport http notion https://mcp.notion.com/mcp, and approve access with OAuth; it sees the pages your Notion account can see.ntn_) in NOTION_TOKEN, send Notion-Version: 2025-09-03, and share each page or database with the integration from its ••• menu under Connections.Give the integration only the Read content capability and share just the databases the report uses; Notion MCP acts as you and can edit, so it fits interactive work better than unattended runs.
A Notion integration only sees pages that were shared with it, plus their children. Share the top-level page of each wiki or teamspace with the integration and everything under it is included.
No. Setting in_trash moves the page to Notion's Trash, where anyone with access can restore it until the Trash is emptied. If you would rather keep stale pages, ask the skill to comment on them instead, or to list them for an archive page you move them to by hand.
No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a asks you, so you can glance at it instead of asking again.
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.
Yes. Switch the data source to "Your browser" and the steps change to the Notion pages themselves: the agent opens www.notion.so in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.
Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.
Free during the open beta. No card.