# Context design comparison

Design: [Composition](https://fzkuji.github.io/OpenProgram/docs/reference/design/context/composition.html). Rows are in wire order within a layer: more stable first, because cache-prefix matching makes order matter. Scattered means present but not assigned to a layer.

| Hermes layer, by stability | OpenProgram |
| --- | --- |
| `stable`: identity, tool guidance, skills, model, platform and environment hints | L0 |
| `context`: caller system_message, context files | L1 project layer |
| `volatile`: memory snapshot, USER.md, external memory | L1 project memory, L2 |

opencode, claude-code, openclaw and pi-mono each carry fewer components than Hermes.

## L0 system: configured once

| Component | hermes | claude-code | Others | OpenProgram |
| --- | --- | --- | --- | --- |
| Overall identity | yes | yes | pi | L0 (identity) |
| Inline agent prompt | yes | yes | no | L0 (inline_prompt) |
| Tool enforcement (act, don't ask) | yes | no | no | L0, base prompt `guides/base.md` |
| Model-specific guidance | yes | no | no | None: a model that needs it gets its own base prompt |
| Platform rendering format | yes | no | no | L1, a line of the environment block per channel |
| Computer-use guidance | yes | no | no | None; applies only when enabled |
| Skills index | yes | no | pi | L1 (capabilities) |
| Tools and MCP schema | yes | yes | opencode, openclaw | L0 |
| Global or user memory | yes | no | no | L1 (memory) |
| Environment (OS, shell, remote backend) | yes | no | no | L0 (OS, shell); cwd handled by tool-runtime |
| Current date, day granularity | yes | no | pi | L0 (current_date) |

Environment changes with the machine or the day, so it goes last.

## L1 session and project

| Component | hermes | claude-code | Others | OpenProgram |
| --- | --- | --- | --- | --- |
| Project identity (AGENTS.md, .cursorrules) | yes | yes | openclaw | L1 |
| Prompt-injection detection, before loading | yes | no | no | Trust rule in the base prompt, `detect_injection_patterns` per file |
| Context-file truncation | yes | no | no | L1, one 32 KiB budget across the AGENTS.md chain (`agents_md.MAX_BYTES`) |
| Project memory | yes | no | no | L1 |
| User profile USER.md | yes | no | no | L1 (Memory Core) |
| Working directory | yes | no | pi | L1 |
| Inside a git repo | yes | no | no | L1, environment block |
| session_id, model, thinking, tier | yes | no | no | L1 |
| Deferred tools catalog | no | no | no | L1 |
| History and tool-call records | yes | no | no | L1, appended per turn, last |

Fixed project information changes only with the project. Detection and truncation sit beside the files they guard.

## L2 task: this turn

| Component | hermes | claude-code | Others | OpenProgram |
| --- | --- | --- | --- | --- |
| Situation (function, call stack, step) | `_situational` | no | no | L2 (situation, call_path, step 6a and 6b) |
| Git branch and status | scattered (git root) | no | no | L2 (git_status, order 20) |
| Todo, plan, progress | no | todo tool | no | L2 (todo_progress, reads `_TODOS`) |
| Token budget hint | no | no | no | None |
| Per-turn memory prefetch | yes | no | no | L2 |
| User input, attachments | yes | yes | yes | L2 |
| Output format or schema | no | yes | no | L2 |
| Output contract | no | no | no | L2, in `_situational_prefix` |
| Timestamp | yes | no | pi | L2, last |
| Kanban multi-agent coordination | yes | no | no | None; specific to Hermes |

Situation, environment and todo are settled for the turn; the timestamp changes every time.

## Not carried

Computer-use guidance, Nous subscription guidance, Kanban coordination, the Hermes profile mechanism and the external memory provider have no feature here. Building one means registering a `ContextComponent`, with no framework change.
