Every AI coding session starts blank. For a real task, the context is scattered across a GitHub issue, its comments, several pull requests, and feature branches in multiple repositories. Re-assembling that by hand for every session is slow and lossy — so I built taskctx to do it in one command.
What it does
taskctx collect <N>— fetches issue #N, its comments, PR states, and per-repo branch state (commits, merge-base, per-commit diffs), then renders a singlecontext-pack.md.taskctx pack <N>— re-renders the pack from the local cache, fully offline.taskctx status <N>— prints only the delta since the last collect, writing nothing.taskctx init— creates the config and aninstruction.mdthat tells any coding agent how to consume packs.
What goes into a pack
- Delta first: what changed since the last collect — new commits per repo, PR state transitions (
web#8636 state: open → merged), new issue comments. - Issue snapshot: title, state, labels, body, and comments — plus automatically extracted open checkboxes (
- [ ]) from the body and every comment. - Repository map: each repo's branch for the issue (matched by configurable patterns like
issue-{N}), commit list with file stats, and paths to full per-commit diffs on disk. - PR states: number, title, state, merged flag, and review decision for every linked PR.
Design decisions
- Cache everything: raw GitHub JSON, manifests, and per-commit diffs live in a
.taskctx/<N>/store. Re-rendering never touches the network, and--offlinerecomputes from local refs only. - Deterministic output: the same store renders the same pack, so packs are diffable and safe to commit.
- Agent-native consumption:
taskctx initwrites an instruction file that points the agent to the pack, the diff directory, and the repo map — the agent reads files instead of running git commands itself. - Multi-repo aware: repos can be local checkouts or remote-only; one repo can be refreshed while the rest come from the previous snapshot.
Stack
| Layer | Tools |
|---|---|
| Runtime | Bun |
| Language | TypeScript (~1,300 LOC) |
| GitHub data | GitHub API via gh |
| Git | local refs, merge-base, per-commit diffs |
| Tests | Vitest (collect, git, github, pack) |
Commands
taskctx init # seed config + agent instruction.md
taskctx collect 123 # fetch + render .taskctx/123/context-pack.md
taskctx pack 123 # re-render from cache, no network
taskctx status 123 # delta only, to stdout
taskctx collect 123 --repo web --offline
The story behind it is in the blog article: Context Packs for AI Coding Agents: Building taskctx.