My AI Agent Task Organization System

AlexMaster Advanced 2h ago 603 views 9 likes 2 min read

For months I was losing track of what my coding agent had actually done across sessions. I'd ask it to fix a performance regression in the data pipeline, then start a fresh session for a feature branch, and two days later when revisiting the fix it would have no memory of the earlier context. The agent would either repeat work it had already done or produce code that conflicted with prior changes. This wasn't a bug in the tool — it was my process. The root cause: I had no system for persisting task state across invocations.

Here's what I tried and where each approach broke down:

  • Running log in a single .txt file: everything ended up in a monolithic timeline. Context was buried. The agent would still hallucinate task order.
  • Relying on the agent's built-in memory features: tool-specific memory (like Claude Projects or custom instructions) helped for global preferences but couldn't handle per-task context with interdependent subtasks.
  • Spawning a separate shell per task: worked for a few tasks, then you lose track of which shell had which state; also easy to accidentally kill the wrong session.

The solution came down to a single rule: every task gets its own file in a dedicated project directory. I added a /ai/tasks/ folder at the repo root, with one Markdown file per task. Each file uses a simple front-matter block followed by a checklist and a context section.

---
status: active
priority: high
task: "Decrease inference latency in batch processing module"
module: analysis/batch/inference.py
last_active: 2025-03-20
---

## Progress
- [x] Profile current pipeline to identify bottlenecks (noted top 3 functions)
- [ ] Implement caching in the embedding step (blocked: waiting on DB schema change)
- [ ] Test with production-scale data

## Context Dump
Related models: ModelA, ModelB. Key vector columns are in table `embeddings_v2`.
Branch is `latency-fix`, base commit `abc1234`. The last error was a `RuntimeError` about tensor shape mismatch in the attention layer — discussed with team, identified as an index-off-by-one. Fix needs to wrap around to batch boundaries.

Every session starts by loading the relevant task file into the agent's context window. I use a simple shell helper that prepends the markdown content as a system message. This gives the agent a clear status snapshot so it never has to guess where we left off.

The biggest improvement isn't technical — it's discipline. The agent works best when the human structures the input. Writing a clean context dump before closing a session saves 10x that time on the next start.

This approach also makes it trivial to hand a task off to another team member (or to an agent running on a CI machine). Just point them at the .md file and the branch name.

If you're fighting context loss with coding agents, this file-per-task model will probably save you a lot of repeated work. The

Help Wanted

All Replies (3)

S
SoloSage Advanced 1h ago
You forgot rollback. How do you undo if the agent breaks something?
0 Reply
T
TaylorDreamer Intermediate 1h ago
Just use git log with clear commit messages. No need for a whole system.
0 Reply
C
CyberSmith Advanced 1h ago
Does it track task dependencies across agent sessions?
0 Reply

Write a Reply

Markdown supported