by big0lives
Pre-compaction hooks + a CAS-guarded task pointer that keep Codex agents on-goal across context auto-compaction — no mainline drift, no duplicate work, no conflicting progress in long runs.
# Add to your Claude Code skills
git clone https://github.com/big0lives/codex-task-pointerGuides for using ai agents skills like codex-task-pointer.
codex-task-pointer is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by big0lives. Pre-compaction hooks + a CAS-guarded task pointer that keep Codex agents on-goal across context auto-compaction — no mainline drift, no duplicate work, no conflicting progress in long runs. It has 54 GitHub stars.
codex-task-pointer's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/big0lives/codex-task-pointer" and add it to your Claude Code skills directory (see the Installation section above).
codex-task-pointer is primarily written in PowerShell. It is open-source under big0lives on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh codex-task-pointer against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
On mid-length tasks and long goal runs, Codex auto-compaction can wipe key milestones, drift the objective, redo finished work, or collide with it. This repo maintains a small, schema-checked task pointer through hooks: the pointer is persisted to disk when the agent publishes it and when you submit a prompt; when compaction fires, a hook confirms it is intact, and after compaction SessionStart re-injects it as the post-compaction reference background — so information loss stops turning into drift and rework.
SessionStart(compact) hook re-injects your "goal + next step" into the fresh context, so the model re-anchors instead of drifting.generation + revision. Stale writes fail loudly (STALE_GENERATION / STALE_REVISION), and clearing rotates the generation so an old request can't resurrect state.-WhatIf preview, owned-file backup, atomic hooks.json merge that preserves your other hooks, explicit -Rollback.Long Codex goal runs kept dying quietly: auto-compaction swallowed the plan, the next turn either drifted sideways or redid work that was already done — and I burned another prompt re-explaining where we were, losing tokens and time. So I built the smallest thing that survives "auto-compaction information loss": a schema-checked pointer file plus three root hooks that re-inject it at the right events. It has been running in my own Codex sessions ever since, and has saved me a lot of trouble.
It took me about a month and roughly 3 billion tokens on gpt-5.6-sol, iterating with Codex the whole way, to distill this little thing. I use it in every Codex session I run.
| Before | With codex-task-pointer |
|---|---|
| After every auto-compact: re-paste the plan, re-explain the current step, correct the execution node | The pointer (goal + next step) is re-injected into the fresh context automatically |
| The run drifts onto an unknown goal halfway through | SessionStart restores the mainline anchor before the next turn starts |
Hand-editing hooks.json, one syntax slip kills every hook |
The installer merges atomically, backs up first, and rolls back cleanly |
pwsh --version) — the JSON layer uses ConvertFrom-Json -DateKind, a parameter added in 7.5, so ISO date strings are kept as strings instead of being auto-convertedcodex --version)Paste this directly to your own Codex:
Please read the AGENTS.md in the codex-task-pointer repository and follow its
deployment playbook to install and configure Task Pointer into my CODEX_HOME;
run the repo self-check and an install preview first, and only prompt me for
steps that genuinely require a human (such as trusting the hooks in /hooks).
The agent performs clone, self-check, install preview and apply on its own, and only surfaces the host trust step at the end; it does not touch config.toml, credentials, sessions or Memory.
Clone and self-check (the tests only write to the system temp directory):
git clone https://github.com/big0lives/codex-task-pointer.git
cd codex-task-pointer
pwsh -NoProfile -File .\tests\Test-TaskPointerLifecycle.ps1 # expect failed=0
pwsh -NoProfile -File .\tests\install-smoke.ps1 # expect PASS
Preview, then apply: -WhatIf prints the plan without writing; -Apply copies the runtime to <CODEX_HOME>\task-pointer\ and atomically merges three events into <CODEX_HOME>\hooks.json — your other hooks, config.toml, sessions and Memory are not touched.
pwsh -NoProfile -File .\scripts\install.ps1 -CodexHome $env:CODEX_HOME -Apply -WhatIf
pwsh -NoProfile -File .\scripts\install.ps1 -CodexHome $env:CODEX_HOME -Apply -Confirm:$false
Open Codex, run /hooks, and approve the three task-pointer commands. This is the host's security review — new hooks are discovered but stay inert until a human approves them, and no CLI or config switch bypasses that.
The full E2E additionally requires hooks trusted in your Codex CLI home and usable model auth, so automated verification at install time stops at the static, core and installer gates (tests\run-all.ps1 -SkipAppServer).
Once installed and trusted, day-to-day use is completely hands-off: hooks maintain the task pointer when you submit prompts and when compaction fires, and the pointer is injected into the fresh context automatically — you never run a command. The only things you will ever perceive are the "Restoring task pointer" status at session start and the pointer reference in post-compaction context (your agent confirms the goal and next step against it before continuing).
Read-only probe: confirm the hooks are discovered by the host with no diagnostics; after approving them in /hooks, append --require-trusted to re-verify trust.
node .\tests\app-server-hooks-list.mjs --cwd . --codex-home $env:CODEX_HOME --output $env:TEMP\hooks-list.json
Expect verdict: PASS, target_count: 3, zero errors and warnings.
Roll back an install: use the backup path recorded in the install receipt; only installer-owned files and hook entries are restored, your other configuration is untouched.
pwsh -NoProfile -File .\scripts\install.ps1 -CodexHome $env:CODEX_HOME -Rollback -BackupPath <backup-from-install-receipt>
The pointer is persisted during task execution, not at compaction time:
state.json on disk (one per session);%%{init: {'theme': 'base', 'themeVariables': {'fontSize': '14px'}}}%%
flowchart TD
A[SessionStart hook] -->|inject pointer context| B[Agent works on the task]
B -->|user sends next prompt| C[UserPromptSubmit hook]
C -->|mark DIRTY + return CAS base| D[Agent publishes new pointer]
D --> E[publisher: CAS check + atomic write]
E --> F[(state.json per session)]
B --> G{Auto / manual compact?}
G -->|yes| H[PreCompact hook: confirm pointer durable]
H --> I[Compaction loses conversation detail]
I --> J[SessionStart compact hook]
J -->|read back + inject pointer| B
F -.reads.-> A
F -.reads.-> J
classDef start fill:#3B82F6,stroke:#2563EB,color:#fff,stroke-width:2px
classDef process fill:#10B981,stroke:#059669,color:#fff,stroke-width:2px
classDef decision fill:#F59E0B,stroke:#D97706,color:#fff,stroke-width:2px
classDef storage fill:#8B5CF6,stroke:#7C3AED,color:#fff,stroke-width:2px
class A,J start
class B,C,D,E,H,I process
class G decision
class F storage
| Hook event | Fires on | What it does |
|---|---|---|
SessionStart |
startup / resume / clear / compact | clear writes a CLEARED fence; other sources inject the current pointer (≤ 10 KB) as additional context |
UserPromptSubmit |
every prompt | marks a continuable pointer DIRTY and returns the generation/revision base for the next publish |
PreCompact |
manual or auto compaction | read-only observation point — the pointer was already persisted at publish/prompt time |
The hook-injected context contains the publisher path, the request schema and the current CAS base; task_id (a UUID) is generated by the